Use Flow MCP in Cursor
Adding Flow MCP to Cursor gives you powerful AI-driven tools directly inside your code editor. It allows Cursor's AI to understand, query, and interact with Flow blockchain data and smart contracts through a standard protocol called the Model Context Protocol (MCP).
Specifically, it enables you to:
- Ask the AI in Cursor to fetch on-chain data such as account balances, account information, or contract source code without leaving your editor.
- Speed up development by letting AI perform blockchain queries that would normally require manual steps.
- Improve context for AI assistance by allowing Cursor to pull real blockchain data when needed.
- Automate routine Flow tasks using tools exposed by the MCP server.
- Prototype and debug faster with direct access to live blockchain information.
This tutorial will guide you through setting up and using Flow MCP in Cursor to enhance your Flow blockchain development experience with AI assistance.
Learning Objectives
After completing this tutorial, you should be able to:
- Configure Cursor to connect with the Flow MCP server using the MCP protocol.
- Install and launch the Flow MCP server locally through Cursor.
- Identify when Flow MCP tools are successfully loaded and ready inside Cursor.
- Use Flow MCP tools to retrieve blockchain data such as account balances, account details, and contract source code.
- Troubleshoot common setup and connectivity issues between Cursor and Flow MCP.
Prerequisites
- Cursor - the AI code editor
- Flow MCP GitHub Repository - the Flow MCP server repository
Installation
-
Open Cursor Settings and go to the "MCP" tab.
-
Configure the MCP configuration file in Cursor:
The MCP configuration file is located at the following location based on your operating system:
- macOS:
~/Library/Application Support/Claude/mcp.json
- Windows:
%APPDATA%/Claude/mcp.json
- Linux:
~/.config/Claude/mcp.json
Add the following configuration:
_10{_10"mcpServers": {_10"flow-mcp": {_10"command": "npx",_10"args": ["-y", "@outblock/flow-mcp"]_10}_10}_10} - macOS:
-
Restart Cursor to load the new MCP configuration.
You need to wait for the MCP server to start. Once it's ready, you will see there will be a green spot in the left side of
flow-mcp
server name label and all tools for Flow MCP will be displayed.
How to use Flow MCP in Cursor
Checking Flow Balance
Viewing Account Information
Getting Contract Source Code
Troubleshooting
If you encounter any issues:
- Ensure the MCP server is properly installed
- Verify the configuration file is in the correct location
- Check that the paths in the configuration are correct
- Try restarting Cursor
- Check the console for any error messages
Additional Resources
Support
For issues or questions:
- Open an issue on the Flow MCP GitHub Repository
- Join the Flow Discord community