- Sign in with Mesh (recommended) — the one-click OAuth flow modern MCP clients ship. Point the client at the Mesh endpoint and it opens a browser where you sign in and choose an organization. No API key to paste.
- API key — pass an
rsk_key in theAuthorizationheader, the same key you use for the REST API. Best for headless or automated clients.
The MCP server is a thin layer over the same routes as the REST API. Every tool call runs the identical authentication, rate-limit, spend-cap, balance, and usage-logging pipeline as a direct API call, and is billed to the same key.
Connection details
https://api.meshapi.ai/mcp without the slash answers with a 307 redirect to /mcp/. Use the trailing-slash URL so a client that doesn’t follow redirects on POST still connects.
Most clients can sign in with Mesh: register the endpoint with no credential and approve the connection in a browser (see below). You can also connect with the same rsk_ API key you use for the REST API, passed in the Authorization header.
Connect a client
Sign in with Mesh
Point your client at the Mesh MCP endpoint without a key. It discovers Mesh’s authorization server from the endpoint, opens a browser where you sign in and choose which organization the connector acts on, and finishes the connection — nothing to copy or paste.- Claude Code
- Claude Desktop / Cursor / VS Code / ChatGPT
--header: the first time you use the server, Claude Code sees that it needs authentication and opens your browser to sign in with Mesh and pick an organization.On approval, Mesh creates an
rsk_ API key bound to the organization you chose and hands the connector a short-lived token for it. The connector’s calls carry that organization’s rate limits, spend cap, model policy, and billing — identical to a key you create yourself. Manage or revoke the connection from Dashboard → API keys: revoking that key disconnects the connector.API key
For a headless agent, CI, or a shared service, connect with anrsk_ key instead of a browser sign-in. Pass it in the Authorization header when registering the server.
- Claude Code
- Claude Desktop / Cursor
- Python (mcp SDK)
openai/gpt-4o-mini”).Available tools
Tools mirror the REST API one-to-one. Inputs are OpenAI-shaped, so anything you know from the API reference carries over directly.Inference
RAG & search
Catalog & account
Prompt templates
The server also exposes a resource,
mesh://models, that returns the full model catalog as JSON — useful for clients that consume MCP resources rather than calling list_models.
Example: give an agent a document Q&A tool
A typical agent flow — upload a file, wait for embeddings, then answer questions grounded in it — is three tool calls:1
Upload the document
Call
upload_file with the file’s bytes base64-encoded. You get back a file_id.2
Wait for embeddings
Poll
get_file with the file_id until embedding_status is ready. Embedding is asynchronous, so a freshly uploaded file is not immediately searchable.3
Search and answer
Call
file_search with a natural-language query, then feed the returned passages into chat to get a grounded answer.Authentication & billing
- Auth: a connector signs in with Mesh (OAuth 2.1); an API-key client sends
Authorization: Bearer rsk_.... Either resolves to anrsk_key before any tool runs. A missing or invalid credential returns 401; a suspended key returns 403. - Limits & billing: billed tool calls inherit the key’s per-key rate limits, spend cap, model allow-list, and credit balance — exactly as a direct REST call. If a call would exceed a limit or your balance is insufficient, the tool returns an error carrying the Mesh message (e.g. “Insufficient balance.”).
- Free tools: the catalog/account reads (
list_models,list_voices,get_balance), the RAG file reads (list_files,get_file,upload_file), template management, androuter_selectare not billed. Everything under Inference, plusweb_searchandfile_search, is billed. - Usage tracking: every billed tool call is logged to your usage history just like a REST request, so MCP traffic shows up in the dashboard and usage reports.
Limitations
The following Mesh capabilities are not yet exposed as MCP tools — use the REST API or an SDK for them:- Audio: text-to-speech and speech-to-text (transcription/translation)
- Video generation and the async Batch API
- Realtime audio (bidirectional WebSocket)
- Usage-report queries