Connect an MCP client
After this page, you can connect your MCP client to SPM at https://api.spmos.ai/mcp and verify memory operations.
Prerequisite: Keep an SPM API key available and store it outside committed configuration.
1. Configure the client
Use the endpoint and bearer token with your MCP client:
https://api.spmos.ai/mcp
Authorization: Bearer spm_live_...
The server is named SPM. The aliases add_memory, search_memory, and delete_memory behave exactly like remember, recall, and delete. Your agent keeps its existing model conversation unchanged.
Codex uses the official Streamable HTTP configuration. Keep the key in the environment, not the file:
export SPM_API_KEY="<your SPM API key>"
Then add the server:
[mcp_servers.spm]
url = "https://api.spmos.ai/mcp"
bearer_token_env_var = "SPM_API_KEY"
Claude Code and generic MCP JSON use this configuration:
{
"mcpServers": {
"spm": {
"url": "https://api.spmos.ai/mcp",
"headers": {
"Authorization": "Bearer spm_live_..."
}
}
}
}
Restart the client after adding a server. A 401 invalid_token means the server was reached and the key was missing, malformed, expired, revoked, or from another environment.
The MCP service is memory-only: it does not proxy model requests and needs no provider key. /health, /livez and /readyz are unauthenticated; the endpoint itself is not.
2. Call the tools
Five tools cover the round trip: remember, status, recall, read, delete. Each needs its own scope. MCP tool reference lists every parameter, default and result field.
3. Run a memory round trip
- Call
rememberwith a stable idempotency key. - Call
statuswith the returned source ID until it is searchable. Stop and inspectfailed,dead_letter, ornot_foundinstead of polling forever. - Call
recallwith one focused question: the single fact you need, with every qualifier the answer depends on. - Call
readwhen you need the exact original text. - Call
deletewhen you are done with test data.
Reusing a deleted source_id returns 409 SOURCE_ID_PURGED until you clear memory. Use a new ID for new content.
Verify
Run the conformance probe with your own key. It writes a canary in an isolated partition, exercises the whole tool surface, checks the verdict rules, and cleans up:
curl -fsSLO https://docs.spmos.ai/assets/mcp-conformance.py
export SPM_API_KEY=spm_live_...
python3 mcp-conformance.py # scorecard
python3 mcp-conformance.py --json # CI output, exits 1 on a break
Expected: the conformance command exits with status 0.
Share one key across end users
Keep one application key and send a stable opaque partition per end user, normally your internal user ID:
{
"question": "Which writing style do I prefer?",
"user_partition": "user-123"
}
Partitions are isolated inside the tenant, the account boundary, and a read token from one partition does not work in another. Omitting the field uses the tenant default.
status and delete take no partition; target them with source IDs. Your application still has to authenticate end users and keep the key private: a partition is a routing label, not an authorization check.