Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

MCP Tools

LocusGraph currently exposes four MCP tools through the region server, with OAuth enforced at the auth worker's /mcp endpoint.

Scopes

OAuth scopes are enforced before the request reaches the graph:

ToolRequired scopes
retrieve_memoriesmemory.read
list_contextsmemory.read
store_eventmemory.read, memory.write
generate_insightsmemory.read, memory.write

The access token is also bound to the selected graph_id, and the auth worker forwards that graph to the region server via X-Graph-Id.

store_event

Writes knowledge into the wisdom graph. The admission pipeline processes the event into a locus automatically.

Parameters:
NameRequiredDescription
event_kindYesEvent kind: fact, action, decision, observation, feedback
payloadNoMemory payload. Recommended shape: { "data": { "topic": "...", "value": "..." } }
context_idNoPrimary context in format type:name
sourceNoEvent source: agent, user, system, validator, executor
reinforcesNoArray of context IDs this event reinforces
extendsNoArray of context IDs this event extends
contradictsNoArray of context IDs this event contradicts
related_toNoArray of related context IDs
timestampNoUnix timestamp as string

Aliases accepted by the backend:

  • context_id: also accepts event_id
  • event_kind: also accepts event_type and eventType
  • payload: also accepts content
{
  "tool": "store_event",
  "arguments": {
    "context_id": "skill:react_hooks",
    "event_kind": "fact",
    "source": "agent",
    "payload": {
      "topic": "useEffect cleanup", "value": "Always return a cleanup function when subscribing to external stores"
    }
  }
}

retrieve_memories

Searches the wisdom graph using semantic similarity and returns ranked results.

Parameters:
NameRequiredDescription
queryYesSearch query string
limitNoMaximum number of results
context_idsNoFilter by specific context IDs
context_typesNoFilter by context types (map of type to names)
include_idsNoInclude locus IDs and context IDs in the response
{
  "tool": "retrieve_memories",
  "arguments": {
    "query": "React hook best practices",
    "limit": 5,
    "context_types": { "skill": ["react_hooks"] }
  }
}

list_contexts

Lists available context IDs with optional filtering and pagination.

Parameters:
NameRequiredDescription
context_typeNoFilter by context type
context_nameNoFilter by context name
limitNoMax results. Default: 100
pageNoPagination page. Default: 0
{
  "tool": "list_contexts",
  "arguments": {
    "context_type": "skill",
    "limit": 10
  }
}

generate_insights

Analyzes stored knowledge and generates insights for a given task.

Parameters:
NameRequiredDescription
taskYesTask description for insight generation
locus_queryNoQuery for searching relevant knowledge
limitNoMaximum number of knowledge items to retrieve
context_idsNoFilter by specific context IDs
context_typesNoFilter by context types

The backend also accepts context_query as an alias for locus_query.

{
  "tool": "generate_insights",
  "arguments": {
    "task": "Refactor the authentication module",
    "locus_query": "authentication patterns and past errors",
    "limit": 10,
    "context_types": { "error": [], "skill": [] }
  }
}

tools/list is discoverable over MCP, but tools/call uses OAuth access tokens issued by the auth worker, not direct LOCUSGRAPH_AGENT_SECRET configuration.

Next

MCP Resources
Browse graph data through read-only MCP resources.
Connect a Client
Set up Claude, Cursor, or Amp to use these tools.