MCP Endpoint
Connect Cursor and other MCP clients to SmartGate via Streamable HTTP and API keys.
SmartGate exposes a Model Context Protocol (MCP) server over Streamable HTTP (MCP 2025-03-26). Use it from Cursor, Claude Desktop, Windsurf, Hermes, OpenClaw, or any client that supports remote MCP with Bearer authentication.
Legacy HTTP+SSE dual-endpoint transport (MCP 2024-11-05) has been removed. All clients must use POST JSON-RPC to a single URL.
Authentication
Every request must include your team API key:
Authorization: Bearer sk_live_...Create keys under Dashboard → API Keys. Do not commit keys to git or share them in public repos.
Optional header for audit logs:
X-SmartGate-Agent-Platform: cursorEndpoint
| Environment | MCP URL | Method |
|---|---|---|
| Production (via app) | {NEXT_PUBLIC_APP_URL}/api/mcp | POST |
| Local dev (via BFF) | http://localhost:3000/api/mcp | POST |
| Local dev (direct Python) | http://localhost:8000/mcp/ | POST |
Example tools/list:
curl -X POST https://smartgate.network/api/mcp \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-H "X-SmartGate-Agent-Platform: cursor" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'JSON-RPC method | Purpose |
|---|---|
initialize | Session handshake |
tools/list | Discover tools |
tools/call | Invoke a tool — params.name = tool id, params.arguments = args |
OpenClaw quirk: Some builds send "method": "smart_fetch" (tool name as method) instead of "method": "tools/call". SmartGate normalizes these requests automatically on the server.
Per-host setup
| Host | Config file | Transport | Docs |
|---|---|---|---|
| Cursor | ~/.cursor/mcp.json | streamable-http (recommended) | cursor.com/docs/mcp |
| Claude Desktop | claude_desktop_config.json | type: streamable-http | Claude Code MCP |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | serverUrl + streamable-http | Windsurf MCP |
| OpenClaw | ~/.openclaw/openclaw.json → mcp.servers | transport: streamable-http | OpenClaw MCP |
| Hermes | ~/.hermes/mcp.json | streamable-http POST only | Hermes MCP |
| Generic | Host-specific | streamable-http | MCP Transports |
OpenClaw CLI example:
openclaw mcp set smartgate '{"url":"https://smartgate.network/api/mcp","transport":"streamable-http","headers":{"Authorization":"Bearer ${SMARTGATE_API_KEY}"}}'Use Dashboard → Connect for copy-paste JSON per platform.
Audit headers (REST)
Optional headers on POST /api/v1/* REST calls. Values appear in activity logs and power Dashboard → Logs → Tasks aggregation.
X-SmartGate-Correlation-Id: `<task-uuid>`
X-SmartGate-Agent-Platform: openclaw
X-SmartGate-Route: rest
X-SmartGate-Trace-Id: `<session-uuid>`MCP Streamable HTTP calls without headers get route=mcp automatically.
Supported MCP hosts
Any client that supports remote Streamable HTTP and custom Bearer headers, including Cursor, Claude Desktop, Windsurf, Hermes, OpenClaw, Cline, Zed, and custom agents.
For AI hosts (protocol)
On initialize, the server returns Server Instructions. On tools/list, each tool includes an English description, inputSchema, and annotations.
Tools (7)
| MCP tool | Purpose |
|---|---|
smart_fetch | Fetch URL → Markdown |
smart_search | Multi-engine search |
smart_context_gate | Prompt compression |
smart_dedup | Semantic deduplication |
smart_budget_guard | Budget check / count / record |
smart_memory | Memory add / search / get / delete |
smart_pipe | Pipeline templates or custom steps |
smart_pipe step names
In custom steps, use module names (fetch, search, context_gate, dedup, budget_guard, memory) or the same smart_* names as MCP tools. Built-in templates: research, read, remember.
Client compatibility appendix
- Some clients send
"params": []or"arguments": []; SmartGate normalizes those to{}before validation. - Do not pass a foreign
team_idtosmart_budget_guardunless you intend to target that tenant.
Legacy transport removed
The following paths return 405 or 410 with migration JSON:
GET /api/mcp→ 405 (use POST)/api/mcp/messages→ 410 (removed)- Python
/mcp-sse/*→ 404 (unmounted)
See Dashboard → Connect for current configuration templates.
Endpoint contract
Production MCP traffic uses Streamable HTTP on POST /api/mcp with Bearer authentication. SmartGate follows MCP 2025-03-26 transport expectations for remote servers. Legacy dual-endpoint HTTP+SSE paths are removed; clients still calling /messages should update Connect JSON.
Auth and headers
- Authorization: Bearer
<api_key>is required for tool calls. - Platform/deployment headers shown in Connect should be copied verbatim when present.
- REST audit routes use the documented dashboard/API auth for human and automation access—do not assume the MCP Bearer alone unlocks every REST admin path.
Sessions and statelessness
SmartGate hosted MCP path is designed around stateless Streamable HTTP requests suitable for horizontal edge deployment. Do not rely on sticky in-memory session tricks undocumented here. If a host offers both SSE and Streamable HTTP, choose Streamable HTTP as shown in Connect.
Error shapes operators care about
| Code | Meaning | Operator action |
|---|---|---|
| 401 | Auth failure | Fix key / header |
| 405 | Wrong method | Use POST |
| 410 | Legacy route | Update to /api/mcp |
| 429 | Rate entitlement | Back off; check limit_scope |
| 4xx/5xx tool errors | Tool or upstream failure | Inspect Activity Logs params/success |
Relation to REST audit
MCP is the Agent Interface. Audit/trace/export REST routes are how humans and automations read what agents did (Logs). Both share team isolation rules. For schema of tools themselves, call ools/list live or read Tools Reference.
Category reminder
The endpoint exposes an intelligence runtime—Research, Context, Memory, Control, Pipeline—not a chat completion API. Pointing a model gateway at /api/mcp expecting OpenAI chat semantics will fail; point MCP hosts instead.
Practical adoption notes
Treat SmartGate as shared infrastructure: one gateway URL, team-scoped keys, and audit on by default. Prefer pipe templates for repeatable research paths so Activity Logs show a coherent chain instead of ad-hoc tool spam. Keep host-model prompts focused on decisions; let Research and Context primitives prepare evidence. When FinOps asks for savings, export Usage Reports alongside the gateway benchmark explanation—never present Est. USD saved as a vendor LLM invoice. When security asks for evidence, export an audit window and show retention tied to the current plan catalog.
If you are migrating from scripts, replace raw HTTP fetch helpers first, then add dedup and compression, then budget guard. If you are migrating from a model gateway mindset, stop expecting chat completions on /api/mcp and wire MCP hosts instead. If you are writing human-facing product copy, lead with Smart Research / Smart Decision outcomes; keep MCP JSON on builder paths. These habits keep the site and the product aligned with the Positioning Bible: intelligence layer between AI and the world, not an LLM proxy.