Docs

Cursor

Add the Foam MCP server to Cursor and check that the agent can see your services.

Before you start

You need your personal Foam MCP token. If you have not copied it yet, follow Get your token first.

Add Foam to Cursor

  1. Open Cursor Settings (Cmd+Shift+J on Mac, Ctrl+Shift+J on Windows and Linux) and go to Tools & MCP.
  2. Click Add Custom MCP. Cursor opens ~/.cursor/mcp.json. Paste this and replace YOUR_MCP_TOKEN with your token:
    {
      "mcpServers": {
        "foam": {
          "url": "https://api.foam.ai/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_MCP_TOKEN"
          }
        }
      }
    }
    If the file already has other servers, add only the foam entry inside mcpServers. This file lives in your home folder, so the token never lands in a repository.
  3. Save. Back in Tools & MCP, foam shows a green dot and two tools. If the dot is red, check the JSON for a missing comma or brace, then restart Cursor.
  4. Open a new Agent chat and type: Using foam, list my services and run a handful of queries. Cursor calls list_tables and run_query. You should see your services listed and rows returned.