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
- Open Cursor Settings (
Cmd+Shift+Jon Mac,Ctrl+Shift+Jon Windows and Linux) and go to Tools & MCP. - Click Add Custom MCP. Cursor opens
~/.cursor/mcp.json. Paste this and replaceYOUR_TOKENwith 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 thefoamentry insidemcpServers. This file lives in your home folder, so the token never lands in a repository. - Save. Back in Tools & MCP,
foamshows a green dot and two tools. If the dot is red, check the JSON for a missing comma or brace, then restart Cursor. - Open a new Agent chat and type: Using foam, list my services. The agent calls
list_tablesand names your services.