Security
MDP assumes clients may expose sensitive local state, so the server has to treat registration and invocation as policy boundaries.
Auth entry points
The current server can receive auth from multiple places:
- transport headers such as
Authorization,Cookie, andx-mdp-auth-* POST /mdp/auth, which issues anHttpOnlycookie for browser websocket bootstrapregisterClient.authfor message-level registration authcallClient.authfor invocation-time auth forwarded to the client
Authorization hooks
The runtime exposes two explicit policy hooks:
authorizeRegistrationauthorizeInvocation
These hooks receive session context plus any transport-level or message-level auth the server has observed.
TLS and secure endpoints
To expose secure transport endpoints, start the CLI with a certificate and key:
bash
npx @modeldriveprotocol/server --port 47372 --tls-key ./certs/server-key.pem --tls-cert ./certs/server-cert.pemWith TLS enabled, the server endpoints become:
wss://127.0.0.1:47372https://127.0.0.1:47372/mdp/http-loophttps://127.0.0.1:47372/mdp/authhttps://127.0.0.1:47372/mdp/meta
Operational safeguards
The baseline server behavior also includes:
- heartbeat-driven disconnect cleanup
- invocation timeouts
- session replacement when the same client ID reconnects
- capability discovery that reports auth presence, but not secret values
For transport-level details, see Security and Transport. For layered hub and edge startup patterns, see Deployment Modes.