Skip to content
OpenSmartRoute
Documentation
Hosted platformREST API reference

MCP server

Model Context Protocol server for IDEs and agents (VS Code, Cursor, Claude, Windsurf): `POST /mcp` speaks JSON-RPC with tools to route, quote, recommend, explain and ask; `GET /mcp` describes it.

Hosted platformAPI version 2.1.0

Authenticate like the REST API.

get/.well-known/oauth-protected-resource

Mcp Protected Resource

Which authorization servers issue tokens for this MCP endpoint and which scopes it understands (empty authorization_servers when the deployment accepts workspace API keys only). resource is the URL the client reached the server on - the API's own or the web origin's /mcp.

No authentication

Responses

200Successful Response
Requestbash
curl -s "$OSR_URL/.well-known/oauth-protected-resource"

get/.well-known/oauth-protected-resource/mcp

Mcp Protected Resource Path

Which authorization servers issue tokens for this MCP endpoint and which scopes it understands (empty authorization_servers when the deployment accepts workspace API keys only). resource is the URL the client reached the server on - the API's own or the web origin's /mcp.

No authentication

Responses

200Successful Response
Requestbash
curl -s "$OSR_URL/.well-known/oauth-protected-resource/mcp"

get/mcp

Mcp Info

What the MCP server offers and how to connect (no key needed) - or, with Accept: text/event-stream and a credential, the server's notification stream: notifications/tools/list_changed and resources/list_changed when the workspace's catalogue, installed listings or tools change, a : ping comment every 15 seconds, closed after max_s seconds (default and ceiling OSR_PLATFORM_MCP_STREAM_MAX_S; reconnect with Last-Event-ID to continue - a resumed stream starts with a list_changed so nothing is missed).

Requires an API key

Parameters

NameInTypeDefaultDescription
max_squerynumber | null
last-event-idheaderstring | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/mcp" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/mcp

Mcp Endpoint

JSON-RPC 2.0 messages (single or batch) per the MCP specification, Streamable HTTP transport. Tools: route, estimate, recommend, explain, list_targets, feedback, ask (plans tier) and marketplace_search / marketplace_get. Every routed call is metered against the workspace like /api/v1/route; notifications return 202. With Accept: text/event-stream the reply is a stream: notifications/progress (for a _meta.progressToken) and log messages while the call runs, then the result. initialize answers with an Mcp-Session-Id to send back on later calls; a browser Origin must be one of the deployment's.

Requires an API key

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/mcp" \
  -H "Authorization: Bearer $OSR_API_KEY"

delete/mcp

Mcp End

End the MCP session named by Mcp-Session-Id: later calls with that id answer 404 until the client initializes again (400 without the header).

Requires an API key

Responses

204Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/mcp" \
  -H "Authorization: Bearer $OSR_API_KEY"

Something wrong or out of date on this page? Tell us - the page is named for you, so a one-line note is enough.