Docs
MCP

Cursor

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

Before you start

You need your Foam token in FOAM_TOKEN. If you have not done that 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_TOKEN with your token:
    {
      "mcpServers": {
        "foam": {
          "url": "https://sdk.api.foam.ai/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_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. The agent calls list_tables and names your services.