Skip to main content

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

Installation

  1. Open Cursor Settings and go to the "MCP" tab.

    Cursor Settings

  2. 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
    }

  3. 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.

    Flow MCP server ready

How to use Flow MCP in Cursor

Checking Flow Balance

Sample Image 1

Viewing Account Information

Sample Image 2

Getting Contract Source Code

Sample Image 3

Troubleshooting

If you encounter any issues:

  1. Ensure the MCP server is properly installed
  2. Verify the configuration file is in the correct location
  3. Check that the paths in the configuration are correct
  4. Try restarting Cursor
  5. Check the console for any error messages

Additional Resources

Support

For issues or questions: