SPM MCP
README.md
# SPM MCP
MCP server for [SPM](https://spmos.ai) memory. It gives an agent recall and
write over a tenant-isolated memory plane where answers must be backed by a
stored source: when nothing supports the question, you get a refusal with a
machine-readable reason instead of a plausible invention.
Five tools: `remember`, `recall`, `status`, `read`, `delete`
(the aliases `add_memory`, `search_memory`, `delete_memory` take the same
arguments).
- **Evidence gate.** `recall` returns `gate_reason` and evidence refs. Only a
`passed` gate carries an answer; everything else says why it abstained.
- **Per-end-user partitions.** One tenant, many people. `user_partition` keeps
one customer's memory out of another's recall.
- **Readable provenance.** Every ref carries a `console_url` that opens the
source in the SPM console.
## Connect (hosted, default)
1. Create a key at <https://app.spmos.ai/api?utm_source=spm-mcp&utm_medium=readme>
with the `memory:read` scope (add `memory:write` to let the agent save).
2. Add the server. In Cline (`~/.cline/data/settings/cline_mcp_settings.json`):
```json
{
"mcpServers": {
"spm": {
"type": "streamableHttp",
"url": "https://api.spmos.ai/mcp",
"headers": { "Authorization": "Bearer spm_live_v1_YOUR_KEY" },
"disabled": false,
"autoApprove": []
}
}
}
```
Any MCP client that accepts a remote URL and an `Authorization` header works
the same way. Claude Code:
```bash
claude mcp add --transport http spm https://api.spmos.ai/mcp \
--header "Authorization: Bearer spm_live_v1_YOUR_KEY"
```
## Connect (local stdio)
For clients that can only run a command (installed from git; newer npm disables git
fetches by default, hence `--allow-git=all`):
```json
{
"mcpServers": {
"spm": {
"command": "npx",
"args": ["-y", "--allow-git=all", "github:VeridicalTech/spm-mcp"],
"env": { "SPM_API_KEY": "spm_live_v1_YOUR_KEY" }
}
}
}
```
Once the npm name exists this becomes `npx -y @spmos/spm-mcp`.
Optional: `SPM_USER_PARTITION` pins every recall and write to one end user,
`SPM_BASE_URL` points at another deployment.
## Ninety seconds: does the partition actually hold
1. With the key from step 1, save one fact in partition `alice`:
```bash
curl -sS -X POST https://api.spmos.ai/v2/ingest \
-H "Authorization: Bearer $KEY" -H 'content-type: application/json' \
-d '{"text":"Alice rotates the deploy key every Monday.","user_partition":"alice"}'
```
2. Ask as `alice`, then as `bob`, with the same question:
```bash
for p in alice bob; do
curl -sS -X POST https://api.spmos.ai/v2/recall \
-H "Authorization: Bearer $KEY" -H 'content-type: application/json' \
-d "{\"query\":\"when is the deploy key rotated\",\"top_k\":1,\"depth\":\"fast\",\"user_partition\":\"$p\"}"
echo
done
```
`alice` answers with `"gate_reason":"passed"` and a source. `bob` returns an
abstention with `gate_reason` such as `no_candidate`. Extraction runs
asynchronously, so the first recall can take a few seconds; `status` tells you
whether a source is ready.
## Tools
| Tool | Scope | Notes |
|---|---|---|
| `remember` | `memory:write` | Idempotent via `idempotency_key`. |
| `recall` | `memory:read` | `depth`: `fast`, `auto`, `deep`. Returns `gate_reason`, evidence refs, `console_url`. |
| `status` | `memory:read` | Whether saved sources are ready to be recalled. |
| `read` | `memory:read` | Original text for a ref; reports truncation counts. |
| `delete` | `memory:delete` | Removes a source and everything derived from it. |
`user_partition` on `remember`/`recall` needs the `memory:partition` scope.
## Failure behaviour
A refused question is a normal result, not an error: the caller sees the gate
reason and can decide to widen the question. Transport failures return an
error with the reason. The local shim reconnects on the next call instead of
exiting.
## Data and isolation
Requests carry the key, the tool arguments and the memory text. Nothing else:
no repository contents beyond what you pass, no telemetry. Tenants are fenced
server-side by the key's tenant; partitions fence end users inside a tenant.
See [SECURITY.md](SECURITY.md).
## Development
```bash
npm install
SPM_API_KEY=spm_live_v1_... npm run smoke # read-only: lists tools, one recall
```
## License
MIT.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues