Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Token API
        • Hypergraph
          • AI Suite
            • Indexing
              • Graph Horizon
                • Resources
                  AI Suite > Token API MCP

                  2 minutes

                  Using Claude Desktop to Access the Token API via MCP

                  Prerequisites

                  • Claude Desktop⁠ installed.
                  • A JWT token from The Graph Market⁠.
                  • npx⁠ or bunx⁠ installed and available in your path.
                  • The @pinax/mcp package requires Node 18+, as it relies on built-in fetch() / Headers, which are not available in Node 17 or older. You may need to specify an exact path to an up-to-date Node version, or uninstall previous versions of Node to ensure @pinax/mcp uses the correct version.

                  Configuration

                  Create or edit your claude_desktop_config.json file.

                  • OSX: ~/Library/Application Support/Claude/claude_desktop_config.json
                  • Windows: %APPDATA%\Claude\claude_desktop_config.json
                  • Linux: .config/Claude/claude_desktop_config.json

                  REST-based MCP

                  claude_desktop_config.json
                  1{2  "mcpServers": {3    "token-api": {4      "command": "npx",5      "args": ["@pinax/mcp", "--remote-url", "https://token-api.mcp.thegraph.com/"],6      "env": {7        "ACCESS_TOKEN": "<https://thegraph.market JWT Access Token>"8      }9    }10  }11}

                  SQL-based MCP

                  claude_desktop_config.json
                  1{2  "mcpServers": {3    "token-api": {4      "command": "npx",5      "args": ["@pinax/mcp", "--remote-url", "https://token-api.mcp.thegraph.com/sql"],6      "env": {7        "ACCESS_TOKEN": "<https://thegraph.market JWT Access Token>"8      }9    }10  }11}

                  The previous --sse-url option is deprecated, use --remote-url.

                  Troubleshooting

                  To enable logs for troubleshooting the MCP, add the option "--verbose", "true" under "args".

                  claude_desktop_config.json
                  1{2  "mcpServers": {3    "token-api": {4      "command": "npx",5      "args": ["@pinax/mcp", "--remote-url", "https://token-api.mcp.thegraph.com/", "--verbose", "true"],6      "env": {7        "ACCESS_TOKEN": "<https://thegraph.market JWT Access Token>"8      }9    }10  }11}

                  Logs are available under logs/mcp.log and logs/mcp-server-token-api.log inside the folder of your Claude configuration file.

                  ENOENT

                  Error dialog in Claude Desktop showing 'ENOENT' system error, indicating the npx/bunx command wasn't found in the system path.

                  Try to use the full path of the command instead:

                  • Run which npx or which bunx in the command line interface to get the path of the command.
                  • Replace npx or bunx in the configuration file with the full path (e.g. /home/user/bin/bunx).

                  Server disconnected

                  Connection error notification in Claude Desktop displaying 'Server disconnected' message.

                  Double-check your API key. Otherwise, look in your navigator if https://token-api.mcp.thegraph.com/sse is reachable.

                  ⁠Edit on GitHub⁠

                  IntroductionCline
                  On this page
                  • Prerequisites
                  • Configuration
                  • Troubleshooting
                  • ENOENT
                  • Server disconnected
                  The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service