--stdio flag switches the MCP server from Streamable HTTP to the newline-delimited JSON-RPC transport that Claude Desktop (and other local clients) expect.
Transport modes
Anvil supports two MCP transport modes. Choose the one that fits your client:- Streamable HTTP (default)
- stdio (Claude Desktop)
The default mode starts an HTTP server that accepts Point your agent or framework at
POST requests at /mcp. Use this for remote agents, AI frameworks (Vercel AI SDK, LangChain, etc.), or any client that speaks HTTP.http://localhost:3100/mcp (or the host/port you configure with --port and --endpoint).Configure Claude Desktop
To add your Anvil project as an MCP server in Claude Desktop, edit theclaude_desktop_config.json file and add an entry under mcpServers:
/path/to/your/project with the absolute path to the directory that contains your server/ folder. Claude Desktop will spawn npx anvil mcp --stdio in that directory whenever it needs to call one of your tools.
Where to find
claude_desktop_config.json:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Step-by-step setup
Annotate at least one route or add a standalone tool
Make sure you have at least one MCP-exposed route (
meta.mcp.expose = true) or a file in server/tools/. Without any tools, the server starts but Claude Desktop has nothing to call.Verify with a local test
Confirm the server starts cleanly before touching the Claude Desktop config:You should see a line on stderr listing your tools. If there are any schema errors, fix them before proceeding.
Edit claude_desktop_config.json
Open the config file for your OS (see the note above) and add the
anvil server entry:Using a local binary instead of npx
If you haveanvil installed globally or in your project’s .bin/, reference it directly to avoid the npx startup overhead:
Connecting other MCP-compatible clients
The Streamable HTTP mode (anvil mcp without --stdio) works with any client or framework that implements the MCP spec over HTTP:
| Client / Framework | Connect to |
|---|---|
| Vercel AI SDK | http://localhost:3100/mcp |
| LangChain / LangGraph | http://localhost:3100/mcp |
| Custom JSON-RPC client | POST http://localhost:3100/mcp |
| Any MCP-compatible agent | http://localhost:3100/mcp |
--port and --endpoint: