Model Context Protocol (MCP)
MCP is an open protocol that lets AI agents connect to external tools and data sources. In LocusGraph, MCP is served through the auth worker as a remote OAuth-protected endpoint.
What is MCP?
Model Context Protocol standardizes how AI agents discover and call external tools. Instead of writing custom integrations for each agent framework, you expose a single MCP server. Any compatible client connects instantly.
MCP defines three primitives:
- Tools — functions the agent can call (store knowledge, retrieve wisdom, generate insights)
- Resources — read-only data the agent can browse before calling tools
- Prompts — reusable prompt templates the client can fetch on demand
Why MCP for LocusGraph?
LocusGraph exposes its memory workflows over MCP at the auth worker's /mcp endpoint. The auth worker handles OAuth, binds the token to a selected graph, and then proxies MCP calls into the region server.
The backend currently exposes:
- Four tools:
store_event,retrieve_memories,list_contexts,generate_insights - One resource:
locusgraph://contexts - One prompt:
auto_capture
Use MCP when your client supports remote HTTP MCP with OAuth 2.0. Use the SDKs when you want direct application-level control.
How It Works
- Your MCP client connects to
https://api.locusgraph.com/mcp. - The auth worker challenges the client with OAuth metadata from
/.well-known/oauth-protected-resource. - The client discovers the authorization server at
/.well-known/oauth-authorization-serverand/.well-known/openid-configuration. - The user signs in, approves access, and selects a graph during
/oauth/authorize. - The auth worker issues an OAuth token with scopes such as
profile,memory.read, andmemory.write. - Each authenticated MCP request is proxied to the region server with the selected graph injected via
X-Graph-Id.
Auth Endpoints
The auth worker exposes these MCP-related endpoints:
| Endpoint | Purpose |
|---|---|
POST /mcp | Remote MCP endpoint |
GET /.well-known/oauth-protected-resource | Protected resource metadata for /mcp |
GET /.well-known/oauth-authorization-server | OAuth authorization server metadata |
GET /.well-known/openid-configuration | OpenID configuration |
GET /oauth/authorize | Authorization UI and graph selection |
POST /oauth/register | Dynamic client registration |
POST /oauth/token | Authorization code and refresh token exchange |
GET /oauth/userinfo | User claims for issued access tokens |
The production auth host is https://api.locusgraph.com.