Architecture & security
The local tool (Outil Local)
The downloadable local MCP server — its modes, where it keeps the key and mandates, how an AI client is wired to it without ever seeing the token, and the open question on how many agent keys to use.
Built from 8 source documents
- Outil Local spec (init / runtime / setup) POC
- Outil Local — README POC
- POC cross-module contracts (frozen wire) POC
- Platform spec (stub + SPA) POC
- POC architecture (entry point) POC
- Spécification v1 — acteurs, composants, flux Reference
- Synthèse — état des lieux (living summary) Current
- Revue critique n°1 (+ rounds 2–3) Historical
The local tool is the least-mocked component of the POC: real MCP stdio transport, a real key pair on disk,
real per-request signing. What is described here is built (TypeScript, @modelcontextprotocol/sdk 1.30.0, jose)
and matches the intended product, except where marked.
Modes
| Command | When | Does |
|---|---|---|
mcp-server init | Once per machine (POC) | Ed25519 key pair → private key PKCS#8 PEM at ${NP_HOME:-~/.veritia}/agent.key (file 0600, dir 0700); prints the public key as a JWK one-liner {"kty":"OKP","crv":"Ed25519","x":"…"} (byte-identical to cnf.jwk) + its RFC 7638 thumbprint. Refuses to overwrite. |
init --force | Rarely | Regenerates the key — first lists every mandate on the machine and its expiry and warns that all will break (pop_key_mismatch); needs an interactive y unless --yes. |
init --show (2026-10-12) | Minting another mandate later | Re-prints the existing public key without touching agent.key. |
mcp-server setup <redeem-url> | Once per mandate | Redeems the one-time setup code; writes ${NP_HOME}/<agent_label>/config.json (0600). Refuses without agent.key. |
mcp-server (runtime) | Launched by the AI client | stdio MCP server toward the AI client + Streamable-HTTP MCP client toward the provider (below). |
The published command will be npx @veritia/mcp-server …. Today the package is private: true and not on npm
(the @veritia scope is not yet reserved) — the POC runs node dist/index.js … from a local build.
Runtime behaviour
- Discovery at start-up:
initialize+tools/listagainst the provider, kept verbatim, re-exposed to the AI client unchanged — no hard-coded list, no filtering. If discovery fails it exits with a clear message rather than serving a stale or empty list. - Every call: builds the JSON-RPC body once, signs a fresh DPoP proof (
jti,htm,htu,iat,bsha) with the agent key, sendsAuthorization: DPoP <mandate>+DPoP: <proof>— on POSTs and the GET event stream. - A tool name the provider never listed is rejected locally (never forwarded). A provider
401/403becomes a readable MCP tool error naming the reason (token_expired,revoked_or_unknown,pop_key_mismatch…), without crashing. - One process = one mandate = one provider. It never holds several mandates or chooses between them.
Hygiene: only JSON-RPC on stdout (logs to stderr); the private key never goes to env vars, stdout, logs, the LLM or telemetry; refuses to start if the key is readable by others (POSIX only — skipped on Windows/NTFS, found live 2026-10-09).
On disk
~/.veritia/ NP_HOME — one per machine (POC)
├── agent.key one key pair, written once by `init`
├── banque-test-sofie/
│ └── config.json one mandate = one AI client = one named folder
└── gemini-cli-sofie/
└── config.jsonNP_MANDATE picks the folder: unset + one folder → use it; unset + zero → "run setup first"; unset + several →
refuse and list them; set → that folder or refuse. (Both AGENT_DELEGATION_TOKEN and PROVIDER_API_ENDPOINT set as
env vars still win, for manual testing.)
Onboarding an AI client
There is no common MCP configuration format across AI clients (checked against each vendor's docs, 2026-09-18):
| Client | Config | Root key | CLI helper | Note |
|---|---|---|---|---|
| Claude Desktop | In-app Settings → Developer → Edit Config (recommended); manual: macOS ~/Library/Application Support/Claude/claude_desktop_config.json, Windows %APPDATA%\Claude\… | mcpServers | none | On Windows the documented %APPDATA% path is not reliable (confirmed live 2026-10-12) — use the in-app button |
| Claude Code | ~/.claude.json (user) or .mcp.json (project) | mcpServers | claude mcp add | — |
| GitHub Copilot CLI | ~/.copilot/mcp-config.json | mcpServers | copilot mcp add | — |
| VS Code Copilot Chat (not in V1) | .vscode/mcp.json or profile | servers | — | Don't confuse with the CLI |
Each recipe only needs the launch command and NP_MANDATE=<agent_label> — never the token. Example:
{ "mcpServers": { "banque-test": {
"command": "node",
"args": ["C:\\Users\\<you>\\outil-local\\dist\\index.js"],
"env": { "NP_MANDATE": "banque-test-sofie" }
}}}Replace, not accumulate
How many agent keys?
Known limits
- Same machine as the AI client: the "AI brain" cannot reach the key only because no file/shell tool is configured alongside it (true for Claude Desktop with only this server). Claude Code, with built-in shell tools, is the case that needs care. Absence of a capability, not a sandbox. No HSM / TPM / OS keychain in the design — an industry-standard improvement to consider.
- Supply chain (a compromised npm package) is not addressed: package signing, reproducible builds, open source are recommended.
- No hot reload: replacing a
config.jsonneeds an AI-client restart. - POC runs natively on Windows (separate checkout, Windows Node) — the WSL2 launch via
wsl.exeis a fallback.