Connecting to MCP
POST https://api.mety.ai/mcp- Streamable HTTP, stateless. No session id and no SSE stream: every request stands alone.
GETandDELETEanswer405(Allow: POST). - JSON responses. Send
Accept: application/json, text/event-stream(the transport requires both) andContent-Type: application/json. - Auth on every request:
Authorization: Bearer <API key or OAuth access token>. See API keys and OAuth. - Server name
mety. Itsinstructionsexplain the model in five lines; good clients pass them to the model. - Same handlers, scopes, validation, audit (surface
mcp), rate limits (20/s, 1 200/min) and plan limits as REST. - Optional
Mety-Agent-Run: <run id>header, written to the audit log with every change. - Browser requests are refused (
403 FORBIDDEN) unless theirOriginishttps://app.mety.ai. Call it from a server or a native client.
Raw JSON-RPC
Section titled “Raw JSON-RPC”curl -s https://api.mety.ai/mcp \ -H "Authorization: Bearer $METY_KEY" -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'curl -s https://api.mety.ai/mcp \ -H "Authorization: Bearer $METY_KEY" -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'curl -s https://api.mety.ai/mcp \ -H "Authorization: Bearer $METY_KEY" -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"query_records","arguments":{"type":"contact","filters":[{"field":"lastContactedAt","op":"lt_or_null","value":"now-48h"}],"fields":["fullName","email"],"perPage":10}}}'A tool result carries structuredContent (the REST envelope { data, meta? }) and one text item with the same
JSON:
{ "jsonrpc": "2.0", "id": 3, "result": { "content": [{ "type": "text", "text": "{\"data\":[…],\"meta\":{\"page\":1,\"perPage\":10,\"total\":27}}" }], "structuredContent": { "data": [ … ], "meta": { "page": 1, "perPage": 10, "total": 27 } } }}HTTP-level errors
Section titled “HTTP-level errors”These come back as HTTP errors with the Mety error envelope, before any tool runs:
| Status | Code | When |
|---|---|---|
401 |
UNAUTHENTICATED |
No Bearer token. WWW-Authenticate points at the OAuth discovery |
401 |
INVALID_API_KEY / INVALID_TOKEN |
Bad, revoked or expired key or token (error="invalid_token") |
403 |
FORBIDDEN |
A browser Origin other than the app |
405 |
METHOD_NOT_ALLOWED |
Anything but POST |
429 |
RATE_LIMITED |
With Retry-After |
Everything else (validation, scopes, conflicts, plan limits) is a tool result with isError: true. See
errors and results.
Client configuration
Section titled “Client configuration”Client snippets for Claude Code, the Claude Agent SDK, Claude.ai, ChatGPT and Grok are on connecting clients.