The MCP endpoint lets Claude, Cursor, VS Code, Zed and custom agents use the marketplace as a native tool provider. It is a Streamable HTTP JSON-RPC 2.0 server at /mcp/, authenticated with a ZephAI API key.
https://your-domain.example/mcp/ · Protocol: 2025-06-18 · Auth: Authorization: Bearer zp_live_…Before you connect
- Create a dedicated API key in Dashboard → API keys. Give it a low spend cap and only the scopes you need.
- Confirm the MCP endpoint is enabled in Space → MCP. Staff can disable individual tools or prompts.
- Use a workspace with a positive credit balance. Tool calls use the same metering and ledger as
/v1/chat/completions.
Client configuration
Most MCP clients accept a JSON server definition. Replace the host and key with your own values.
{
"mcpServers": {
"zephai": {
"type": "http",
"url": "https://your-domain.example/mcp/",
"headers": {
"Authorization": "Bearer zp_live_REPLACE_ME"
}
}
}
}For Cursor and VS Code, use the same URL and header in the MCP server settings. For a stdio-only client, put a small proxy in front of the HTTP endpoint; the JSON-RPC messages are unchanged.
Lifecycle
Send initialize, then reply with notifications/initialized.
Call tools/list, resources/list and prompts/list.
Invoke tools/call with a typed name and arguments.
Tools
| Tool | What it does | Metered |
|---|---|---|
list_models | Search live listings by category, vendor, capability, price or context window. | No |
get_model | Return pricing, tiers, endpoint health, benchmarks and vendor facts for one listing. | No |
chat_completion | Run a chat completion through the gateway with tools, streaming and budget enforcement. | Yes |
usage_summary | Read workspace spend, token totals, budget use and recent requests. | No |
search_docs | Search the documentation library and return cited article links. | No |
list_vendors | Browse verified vendors, regions and model counts. | No |
get_status | Read component health, incidents and current latency. | No |
Example tool call
{
"jsonrpc": "2.0",
"id": 7,
"method": "tools/call",
"params": {
"name": "chat_completion",
"arguments": {
"model": "zeph-nexus-4",
"messages": [{"role": "user", "content": "Summarise this incident report."}],
"max_tokens": 400
}
}
}The response uses the standard MCP content array. Gateway metadata such as request id, latency and cost is attached in the tool result so an agent can show it to the user.
Resources and prompts
zephai://models— the live catalog.zephai://models/<slug>— one model with pricing and benchmarks.zephai://status— component health and incidents.zephai://docsandzephai://docs/<slug>— documentation summaries.- Server prompts cover model selection, migration and cost review; they are read-only and never execute tools themselves.
Errors and limits
| Code | Meaning | What to do |
|---|---|---|
-32600 | Invalid JSON-RPC request. | Check the envelope and method name. |
-32602 | Invalid tool arguments. | Read the tool schema from tools/list. |
401 | Missing or revoked API key. | Create a new key with the required scopes. |
402 | Workspace balance or spend cap exhausted. | Top up or raise the cap. |
429 | Key rate limit exceeded. | Back off and retry with jitter. |
Security
MCP uses the same key scopes, workspace balance, spend caps, request logging and audit trail as the REST API. Use a dedicated key, keep it in the client secret store, rotate it regularly and never embed it in a public repository. Staff can disable tools or the whole endpoint from Space → MCP.
Troubleshooting
- “Session not found” — send the
Mcp-Session-Idreturned byinitializeon later requests. - 401 after rotating a key — update the client header and restart the MCP client process.
- Tool list is empty — staff may have disabled the endpoint or all tools; check Space → MCP.
- Streaming stalls — disable proxy buffering for
/mcp/and keep the connection open for the session.
Need a tool that is not listed? Tell us; the MCP contract and this page ship together.
Nossos engenheiros respondem a perguntas sobre API na caixa de entrada de suporte.