Docs
MCP

Claude Code

Add the Foam MCP server to Claude Code for one project, for every project, or for your whole team.

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 Claude Code

  1. In a terminal where FOAM_TOKEN is set, run:
    claude mcp add --transport http foam https://sdk.api.foam.ai/mcp \
      --header "Authorization: Bearer $FOAM_TOKEN"
    This registers Foam for the current project. Add --scope user before the name to have it in every project.
  2. Check the connection:
    claude mcp list
    # ✔ Connected   foam
    Inside Claude Code, /mcp shows the same list with the tools.
  3. Try it: Using foam, list my services.

Share it with your team

Commit this .mcp.json at the repository root instead of running the command. Claude Code fills in FOAM_TOKEN from each person's own shell, so no token is committed:

{
  "mcpServers": {
    "foam": {
      "type": "http",
      "url": "https://sdk.api.foam.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${FOAM_TOKEN}"
      }
    }
  }
}