Docs
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 personal Foam MCP token in FOAM_MCP_TOKEN. If you have not done that yet, follow Get your token first.
Add Foam to Claude Code
- In a terminal where
FOAM_MCP_TOKENis set, run:claude mcp add --transport http foam https://api.foam.ai/mcp \ --header "Authorization: Bearer $FOAM_MCP_TOKEN"
This registers Foam for the current project. Add--scope userbefore the name to have it in every project. - Check the connection:
claude mcp list # ✔ Connected foam
Inside Claude Code,/mcpshows the same list with the tools. - Start
claudeand type: Using foam, list my services and run a handful of queries. Claude Code callslist_tablesandrun_query. You should see your services listed and rows returned.
Share it with your team
Commit this .mcp.json at the repository root instead of running the command. Claude Code fills in FOAM_MCP_TOKEN from each person's own shell, so no token is committed:
{
"mcpServers": {
"foam": {
"type": "http",
"url": "https://api.foam.ai/mcp",
"headers": {
"Authorization": "Bearer ${FOAM_MCP_TOKEN}"
}
}
}
}