Skip to content

APIs

The server exposes transport-facing APIs for MDP clients. This section is split into connection setup, message events, and external interfaces.

Read by task

GoalStart here
Open a bidirectional sessionWebSocket
Use request-response transport instead of socketsHTTP Loop
Bootstrap browser auth before opening a websocketAuth Bootstrap
Probe whether a port is serving MDPGET /mdp/meta
Update a connected client's path catalogupdateClientCatalog
Look up websocket message event typesregisterClient, callClient, ping
Check exact HTTP request and response contractsPOST /mdp/http-loop/connect, POST /mdp/auth, GET /mdp/meta

Connection Setup

SurfaceEntry pointNotes
WebSocketws://127.0.0.1:47372Bidirectional JSON MDP messages
HTTP Loop/mdp/http-loop/connectSession-based long-poll transport
Auth Bootstrap/mdp/authCookie bootstrap mainly for browser websocket clients
Metadata Probe/mdp/metaIdentify an MDP server and read discovery hints

Message Events

EventDirectionPurpose
registerClientClient -> ServerRegister one client descriptor and paths
updateClientCatalogClient -> ServerReplace one registered path catalog
unregisterClientClient -> ServerRemove one registered client session
callClientServer -> ClientInvoke one method+path target on a client
callClientResultClient -> ServerReturn a routed invocation result
pingBoth directionsHeartbeat keepalive
pongBoth directionsHeartbeat acknowledgement

External Interfaces

InterfaceMethodPurpose
POST /mdp/http-loop/connectPOSTCreate one HTTP loop session
POST /mdp/http-loop/sendPOSTSend one client-to-server message
GET /mdp/http-loop/pollGETReceive one server-to-client message
POST /mdp/http-loop/disconnectPOSTClose one HTTP loop session
POST /mdp/authPOSTIssue one auth cookie
DELETE /mdp/authDELETEClear one auth cookie
GET /mdp/metaGETProbe one server for MDP metadata
GET /skills/:clientId/*skillPathGETRead one skill over the direct HTTP route
GET /:clientId/skills/*skillPathGETRead one skill over the nested HTTP route

Shared JSON types

AuthContext:

json
{
  "scheme": "Bearer",
  "token": "client-session-token",
  "headers": {
    "x-mdp-auth-tenant": "demo"
  },
  "metadata": {
    "role": "operator"
  }
}

SerializedError:

json
{
  "code": "handler_error",
  "message": "Something failed",
  "details": {
    "reason": "optional"
  }
}

MDP client catalogs are path-based. Each descriptor in client.paths is one of:

  • an endpoint with an HTTP-like method plus path
  • a prompt served at a *.prompt.md path and invoked with GET
  • a skill served at a *.skill.md path and invoked with GET

Relationship to bridge tools

These APIs are for MDP clients. MCP hosts do not call them directly. MCP hosts use the bridge Tools.

Model Drive Protocol