Démo Ceci est une démo en lecture seule. Documentation Acheter ZephAI
New

Gateway v2 is live — one endpoint, every model, streaming tool-calls. Read the changelog

Gateway

Serveur MCP

Exposez le marché à Claude, Cursor, VS Code et aux agents via le Model Context Protocol.

6 min read·Mis à jour Déc 5, 2026·9 vues

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.

Endpoint: 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.

claude_desktop_config.json
{
  "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

1. initialize

Send initialize, then reply with notifications/initialized.

2. discover

Call tools/list, resources/list and prompts/list.

3. call

Invoke tools/call with a typed name and arguments.

Tools

ToolWhat it doesMetered
list_modelsSearch live listings by category, vendor, capability, price or context window.No
get_modelReturn pricing, tiers, endpoint health, benchmarks and vendor facts for one listing.No
chat_completionRun a chat completion through the gateway with tools, streaming and budget enforcement.Yes
usage_summaryRead workspace spend, token totals, budget use and recent requests.No
search_docsSearch the documentation library and return cited article links.No
list_vendorsBrowse verified vendors, regions and model counts.No
get_statusRead component health, incidents and current latency.No

Example tool call

POST /mcp/
{
  "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://docs and zephai://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

CodeMeaningWhat to do
-32600Invalid JSON-RPC request.Check the envelope and method name.
-32602Invalid tool arguments.Read the tool schema from tools/list.
401Missing or revoked API key.Create a new key with the required scopes.
402Workspace balance or spend cap exhausted.Top up or raise the cap.
429Key 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.

Prompt and completion content follows the same retention policy as the gateway. Metadata is retained for usage and security review; retrieve full payloads only when policy allows it.

Troubleshooting

  • “Session not found” — send the Mcp-Session-Id returned by initialize on 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.

Est-ce que cela a été utile ?
0 j'ai trouvé cela utile
Besoin d'un coup de main ?

Nos ingénieurs répondent aux questions API dans la boîte de réception d'assistance.

Contacter l'assistance