How the server works
The server lives at/api/mcp/ on each deployment. It speaks the Streamable HTTP transport as stateless JSON-RPC 2.0 and answers POST only. There are no sessions and no server-initiated stream, so an authenticated GET or DELETE returns 405.
It supports four methods: initialize, ping, tools/list and tools/call. A request can be a single message or a batch, and a batch is answered in the order it was sent. Notifications get no response; a request made only of notifications returns 202.
During initialize the server negotiates one of the protocol versions 2025-06-18, 2025-03-26 or 2024-11-05, falling back to the newest when the client asks for another.
Authenticate
Access is controlled by one environment variable,MCP_ACCESS_TOKEN. It must be at least 32 characters long. If it is missing or shorter, every request is refused with 401, so the endpoint is effectively off.
- Claude custom connector
- Clients that send headers
Claude’s custom connector takes a URL only, so the token goes in the path:
Connect Claude
1
Set the token
Set
MCP_ACCESS_TOKEN on the deployment to a value of 32 characters or more, then redeploy so the function reads it.2
Add the connector
In Claude, add a custom connector with the URL form above, using your site’s domain and the token.
3
Check the tools
Claude calls
tools/list and shows the tools below. Tools that change data are annotated as not read-only, so Claude can ask before calling them.Site tools
draft_invoice only saves a draft. You review and send it from Admin → Invoices, which creates it in Stripe and emails the client a pay link. See Proposals, contracts and invoices.Brand tools
Every brand tool exceptlist_brand_kits takes kit, which accepts a brand kit’s id or its name (an exact match first, then a unique prefix, ignoring case). Each write saves a new version of the kit, so earlier versions stay in its history.
Errors
A problem you can fix, such as a bad input or a kit that cannot be found, comes back as a tool result withisError set and a message Claude can read. Any other failure returns “The site couldn’t do that just now.” An unknown tool or method is a JSON-RPC error.
Calling the tools from scripts
scripts/siteConnector.mjs calls these tools from local scripts, including the DESIGN.md sync and the website scan. It reads MCP_ACCESS_TOKEN from .env.local, and DESIGN_MD_SITE points it at another deployment. The repo’s own .mcp.json is unrelated: it gives local coding agents a chrome-devtools MCP server. For environment setup, see Local setup.