# MCP protocol and results

Source: https://usecns.dev/engram-topic-mcp-protocol-and-results/

[Start here](https://usecns.dev/manual-engram/)
[CLI commands](https://usecns.dev/commands-engram/)
[Configuration & integration](https://usecns.dev/engram-topics/)

The stdio server reads one JSON value per line (not Content-Length frames), skips blank lines and writes one response line per request ID. Notifications without `id` receive no response and perform no tool action. It implements `initialize` (protocol `2024-11-05`, tools capability, server name/version), `tools/list` (canonical catalog) and `tools/call` with `{name, arguments}`. No resource/prompt, HTTP serving or workspace-federation protocol is supplied. Example read-only catalog request after selecting an authorized store:

```
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
```

Malformed JSON returns `-32700`; unknown methods `-32601`; missing tool name `-32602`. Unknown tool names, missing/invalid tool inputs and domain/capability refusals return a **successful JSON-RPC result** with `isError: true` and explanatory text. Successful calls use `isError: false`, with JSON encoded in `content[0].text`; decode that text to obtain the payload. Do not interpret transport success alone as a completed mutation. The CLI's MCP-backed verbs unwrap this payload and convert tool errors into command errors.

Catalog property types are strings except `scope_globs`, `anchor_paths`, `source_memory_ids` (arrays of strings). See the [MCP tool entries](https://usecns.dev/engram-topic-connect-mcp-and-harness-hooks/) for individual inputs and results. Required fields in the schema are not exhaustive semantic validation: outcome needs a target, distill needs at least two eligible sources, and completion needs qualifying evidence.

Handler-only fields, **not advertised by `engram tools`**: `seat_token` on the four checked mutating tools; `m0_attestation` on record (armored signature string, unlike CLI filename); `decision_id` and `provenance` on outcome. A schema-constrained client may need the CLI instead. Record can select a writable M0/M1 mount despite the catalog description's M4/M3/M2 wording; M0 additionally requires a verified human-namespace signature and anchor. A token alone never grants M0 authority. MCP record may mint a missing/blank key; CLI record requires `--key`. Record defaults M4/agent\_observation; distill defaults M2/verified\_gate\_failure. Both strip injected envelopes, validate vocabulary/ontology/access/summary, and can invoke configured remote embeddings.

* [engram\_recall](https://usecns.dev/engram-mcp-recall/)
* [engram\_record](https://usecns.dev/engram-mcp-record/)
* [engram\_distill](https://usecns.dev/engram-mcp-distill/)
* [engram\_complete](https://usecns.dev/engram-mcp-complete/)
* [engram\_outcome](https://usecns.dev/engram-mcp-outcome/)
* [engram\_status](https://usecns.dev/engram-mcp-status/)