Spectron's MCP server exposes seven tools at /mcp. Each tool maps to one or more REST endpoints and carries the same authentication and scope semantics.
Note
Authentication
All tools use Authorization: Bearer authentication (same as REST). Pass the token in the MCP configuration:
X-Spectron-Context in MCP client configs is a convenience for templating; the server resolves context from each tool's context_id argument.
Scope handling
Scope is layered on each tool call:
Grant region (from the API key's principal) – enforced server-side; cannot be widened past what the key allows.
Per-call
scopes/lensargument – DNF selector narrowing the operation within the grant (scopeson writes,lenson recall/context).
Register paths with spectron scopes create before first use.
memory_store
Store a memory from the current conversation. Auto-classifies into Identity / Knowledge / Context categories and reconciles against existing memory.
Principal required: agent or management.
Input:
Output:
Underlying REST endpoint: POST /api/v1/{context_id}/facts (or POST .../facts/batch for multi-turn capture)
memory_recall
Retrieve relevant memory and knowledge for a query. Returns a formatted context block ready for prompt injection.
Principal required: any (agent, supervisor, management).
Input:
Output:
The context field is intended for direct injection into the system prompt. The tier field indicates the resolution path: direct, cache, hybrid, or full_context.
Underlying REST endpoint: POST /api/v1/{context_id}/context
memory_reflect
Synthesise patterns or insights from existing memory. Can optionally persist the reflection as new experiential memory attributes.
Principal required: any for persist: false; supervisor or management for persist: true.
Input:
Output:
When persist: true, persisted_attributes lists the attributes stored from this reflection.
Underlying REST endpoint: POST /api/v1/{context_id}/reflect
memory_profile
Get the aggregated profile for the active scope – static facts, dynamic context, preferences, and active instructions – formatted for system prompt injection.
Principal required: any.
Input:
Output:
Underlying REST endpoint: GET /api/v1/{context_id}/profile
knowledge_search
Search the authoritative authoritative knowledge base. Returns ranked document chunks with source references.
Principal required: any.
Input:
Output:
Underlying REST endpoint: POST /api/v1/{context_id}/query (unified recall) or POST .../documents/query (document passages only)
knowledge_get
Fetch a specific document, chunk, or typed knowledge node by ID. Use this after knowledge_search has identified the source – fetching by ID is faster and more deterministic than re-searching.
Principal required: any.
Input:
Output: A typed payload matching the underlying endpoint – document metadata and status, a paginated chunk list, or a knowledge node with its content and related edges.
Underlying REST endpoints:
GET /api/v1/{context_id}/documents/{id}GET /api/v1/{context_id}/documents/{id}/chunksGET /api/v1/{context_id}/entities/{entity_type}/{entity_name}
upload
Upload a document to the knowledge layer. Bytes are base64-encoded on the wire; processing is asynchronous (chunk, embed, index).
Principal required: agent or management (with memory:write grant).
Input:
Output:
Underlying REST endpoint: POST /api/v1/{context_id}/documents
memory_forget
Stop believing something. Sets valid_until on attributes that semantically match the query. Does not physically delete records.
Principal required: agent or management.
Input:
Output:
The deleted count reflects attributes soft-deleted (marked with valid_until).
Underlying REST endpoint: POST /api/v1/{context_id}/forget
Error handling
Operation failures return an isError: true tool result (HTTP transport stays 200), not a JSON-RPC protocol error. The result includes the same HTTP status the REST API would return:
| Status | Meaning | Agent action |
|---|---|---|
401 | Missing or invalid key | Fix credentials; missing Context is masked as 401 (not 404) |
403 | Grant denied | Narrow scope or request access |
404 | Resource not found | Adjust query or id |
429 | Rate or token limit | Back off and retry |
500 | Server fault | Retry; details are redacted |
JSON-RPC error responses are reserved for protocol faults only — malformed params (-32602), unknown tool (-32601), oversized k, and similar.
Denied operations emit the same authz.denied audit events and error metrics as REST.
Tool ACL summary
| Tool | agent | supervisor | management |
|---|---|---|---|
memory_store | ✓ | ✓ | ✓ |
memory_recall | ✓ | ✓ | ✓ |
memory_reflect (no persist) | ✓ | ✓ | ✓ |
memory_reflect (persist=true) | ✗ | ✓ | ✓ |
memory_profile | ✓ | ✓ | ✓ |
knowledge_search | ✓ | ✓ | ✓ |
knowledge_get | ✓ | ✓ | ✓ |
memory_forget | ✓ | ✓ | ✓ |
Streaming
Most tools are synchronous – the full response is returned in a single payload.
memory_reflect with persist: true on a large corpus may take several seconds. The server emits MCP progress notifications while the underlying reflection handler runs.