Model Context Protocol (MCP)
MCP is the open protocol for connecting AI agents to external tools and data. LocusGraph uses MCP to expose Structured Agent Knowledge to any compatible client over a single OAuth-protected endpoint.
Why LocusGraph Speaks MCP
LocusGraph is LLM and IDE agnostic. The same Structured Agent Knowledge graph should be reachable from Claude Code, Cursor, Amp, ChatGPT apps, or any custom agent. MCP gives you that without writing a custom integration per client — and OAuth keeps the graph properly scoped per user and per workspace.
What MCP Provides
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 events, retrieve knowledge, generate insights)
- Resources — read-only data the agent can browse before calling tools
- Prompts — reusable prompt templates the client can fetch on demand
What LocusGraph Exposes
LocusGraph serves MCP at the auth worker's /mcp endpoint. The auth worker handles OAuth, binds the issued token to a selected graph, and 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 over how the agent reads and writes structured agent knowledge.
How a Connection 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.