Docs
Product
MCP
Foam has an MCP server. Connect it to your coding agent and the agent can query your production logs, traces and metrics while it works on your code. Access is read-only and limited to your account. Setup takes about two minutes.
Get your token
- You need a Foam account with at least one service sending telemetry. If you have not installed Foam yet, start with Get started with Foam.
- Open foam.ai/account, find API token, and click Copy. Treat it like a password: it reads all telemetry in your account.
- Put the token in your shell so the setup commands can use it. Add this line to
~/.zshrcor~/.bashrc, then open a new terminal:export FOAM_TOKEN="paste-your-token-here"
Set up your agent
Pick your agent for step-by-step instructions:
Any other client that supports MCP over Streamable HTTP with a custom header works too. Use these values:
- URL:
https://sdk.api.foam.ai/mcp - Transport: Streamable HTTP
- Header:
Authorization: Bearer YOUR_TOKEN
Claude Desktop and claude.ai connectors cannot send a custom header yet, so they cannot connect to Foam today.
What the agent gets
list_tables: your services, the repositories behind them, and the seven telemetry tables with their columns.run_query: one read-only SQL query over those tables, with a row limit and a time limit the agent can set.- Every query runs read-only and sees only your account's services. Results are capped at 1,000 rows and 5 minutes. All times are UTC.
Troubleshooting
- 401 or “authentication failed”. The token is wrong or was regenerated. Copy it again from foam.ai/account and make sure the header reads exactly
Authorization: Bearer <token>, with one space and no quotes around the token. list_tablesreturns no services. Nothing has sent telemetry to your account yet. Install Foam in a service first.- 429. The server allows 120 requests per minute per address. Wait a minute and retry.