Docs and help · Reference
Every setting.
Every call. One page.
The complete public surface of MatterSpace Duplex: how to reach it, how to configure it, what your AI can call and what every answer means.


The connection.
One address, one key, and the scope you work in.
https://api.duplex.matterspace.ai/mcp- The hosted MCP address, over streamable HTTP. A dedicated environment or your own cloud uses the address your console shows, ending in /mcp.
https://duplex.matterspace.ai- The console: sign in, choose your organization, copy the MCP address and make your first key. A key is shown once, when it is made.
Authorization: Bearer <key>- How a client that takes a key sends it.
x-duplex-key: <key>- Accepted in place of the Authorization header.
x-duplex-scope: <scope> · ?scope=<scope>- The scope you work in when a key is shared by a team: the team as your directory names it, such as eng:platform, or your own level in it, such as eng:platform/you, in any script. Left out, you work at the level your key is held to. A scope your key doesn’t reach is refused, naming the level.
?hooks=on | off- Tells the MCP server whether this client’s hooks are on, as the Claude Code package does for you.
OAuth sign-in- claude.ai, Claude Desktop and ChatGPT connectors take the address alone and sign you in: no key needed. The client registers itself, and you allow access on a page that names it and its host. You land in your own personal workspace; an organization’s workspace is reached with a key.
Environment variables.
Read by the hooks, the packages and the copy-ready settings files on your machine.
DUPLEX_URL- Your Duplex address, without /mcp, for the hooks and the Cursor and Copilot packages: https, or plain http to this machine only.
DUPLEX_API_KEY- Your key. The hooks and the settings files read it from here, so it never goes on a command line or into a file you commit.
DUPLEX_SCOPE- Your scope, carried by the MCP calls as ?scope= and by the hooks as x-duplex-scope.
DUPLEX_HOOKS=off- Skips every hook event, for you alone. The duplex tools keep working over MCP.
DUPLEX_FAIL_CLOSED=1- Requires Duplex’s checks. When Duplex can’t be reached, prompts and checked tool calls are denied instead of allowed. An organization that requires the checks sets it where it installs the hooks.
DUPLEX_HOOK_FAIL=open | closed- What a hook does when Duplex can’t be reached, overriding what Duplex last announced. It never reopens what DUPLEX_FAIL_CLOSED closes.
DUPLEX_HOOK_APPROVAL_WAIT- How many seconds a tool call waits for a person’s approval before it is sent again. 60 by default.
The hook client.
duplex-hook is a small script that needs nothing but curl: macOS and Linux as they come, Windows through Git Bash or PowerShell 5.1 and 7.
duplex-hook setup --url <address> [--scope <scope>]- Saves the address and your key, from DUPLEX_API_KEY or a hidden prompt, once for every hook on this machine. On Windows: duplex-hook.cmd setup -Url <address> -Scope <scope>.
duplex-hook status- Whether Duplex answers, the fail policy in force, and the events waiting to be sent.
duplex-hook mcp-headers- Prints your key as MCP headers, for Codex’s header helper.
duplex-hook <client> <event>- Sends one event. Your client runs it for you; client is claude_code, codex, cursor or copilot.
OS keychain- Where setup keeps your key first: the macOS keychain, Secret Service on Linux or Windows Credential Manager.
~/.config/duplex/key- Where setup keeps your key on a machine with no keychain, readable by you alone.
~/.config/duplex/spool- Events that couldn’t be sent wait here, up to 200 of 256 KiB each, and go with the next call that gets through.
2 s · 5 s- A memory event, such as a session start, a tool result or a stop, gives up after 2 seconds and never holds you up. A policy event, a prompt, a tool call or a permission request, waits up to 5 seconds for Duplex’s check.
Keys, tokens and passwords are removed on your machine before an event leaves it. Pictures and documents stay on your machine too: Duplex receives only their type, size and fingerprint.
Hook events, client by client.
The events each Duplex package hooks, and the ones that can stop a step before it runs.
Claude Code: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, PreCompact, Stop, SubagentStart, SubagentStop, SessionEnd- UserPromptSubmit, PreToolUse and PermissionRequest can stop a step.
Codex: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PreCompact, Stop, SubagentStart, SubagentStop, SessionEnd- UserPromptSubmit, PreToolUse and PermissionRequest can stop a step.
Cursor: sessionStart, beforeSubmitPrompt, preToolUse, beforeShellExecution, beforeMCPExecution, postToolUse, postToolUseFailure, afterFileEdit, subagentStart, subagentStop, preCompact, stop, afterAgentResponse, sessionEnd- beforeSubmitPrompt, preToolUse, beforeShellExecution, beforeMCPExecution and subagentStart can stop a step.
GitHub Copilot CLI: sessionStart, userPromptTransformed, preToolUse, permissionRequest, postToolUse, postToolUseFailure, subagentStart, subagentStop, preCompact, agentStop, sessionEnd- userPromptTransformed, preToolUse and permissionRequest can stop a step. A repository can register the same hooks in .github/hooks/duplex.json. Copilot CLI 1.0.101 or later.
Package settings and commands.
One install adds the connection, its hooks and its commands together, once you agree, and disconnecting puts your previous settings back exactly.
url · api_key · scope · hook_events- The Claude Code package’s settings: where your Duplex runs, your key, kept in the system’s secure credential store, your scope, optional, and hook events, on by default or off.
DUPLEX_URL · DUPLEX_API_KEY · DUPLEX_SCOPE- The Cursor package’s settings, under Plugins > Configure. The Cursor CLI also reads them from its environment.
/duplex:status- Whether Duplex is reachable from here, the guarantee of this connection, and what it decided last.
/duplex:report- Answers served, rules applied and what was learned lately.
/duplex:threads- Work carried from other sessions and tools.
/duplex:share- Share a carried thread with a teammate or a team, or stop sharing it.
/duplex:forget- Erase a carried thread and what was learned from it.
In Codex, Cursor and GitHub Copilot CLI the same commands are /status, /report, /threads, /share and /forget.
The twelve MCP tools.
Seven of them take a word, in op, what or show, and the fields that word takes. duplex_status show "capabilities" lists exactly what your key may call and what each word takes.
duplex_context { message, after?, include? }- Starts every turn with the user’s latest message, word for word. Answers with the decision for the turn: commit, reply with Duplex’s answer; refuse, decline and name the rule; or defer, answer yourself with the context it returns. include can ask for examples, generalize, prompt, sources, recall or tools.
duplex_observe { turn, answer, tools?, outcome?, remember? }- Records the turn before you reply. answer is a one-line summary, outcome is succeeded, failed or abandoned, and remember keeps something the user asked Duplex to keep. saved: true means it is recorded.
duplex_learn { what, … }- Teaches Duplex, when the user asks: what is label, correction, fact, document, transition, tools, credit, outcome, recipe, skill, environment or transfer, each with its own fields.
duplex_rules { op, rule?, rule_id?, confirm? }- Lists and changes the scope’s rules: op is list, add, approve or remove. A change takes two calls: the first returns a summary and a one-time confirm code, the second applies it once the user agrees. A rule takes name, action (deny, refuse, require_defer, require_tool or allow), keywords or pattern, message, tool, priority, examples and counterexamples.
duplex_task { op, task?, … }- Work that spans sessions: op is open, step, checkpoint, rollback, state, close, list or pack. Open it with an objective and subgoals, record each step with its state, action, next, outcome and verified, and close it with how it ended.
duplex_plan { op, … }- Predictions from what Duplex has learned: op is classify, agree, predict, simulate, plan, recommend or world. Every step says whether it was observed or predicted.
duplex_skill { op, … }- Methods Duplex builds and checks from worked examples: op is build, submit, status, cancel, run, show, list, recall, certificate, parts or budget. A problem is a goal with examples of inputs and output. Read a skill’s card with show, then run it on Duplex with run.
duplex_tool { tool, input, args? }- Runs a registered tool in one call. Offered to an operator’s key; ran: true means it ran.
duplex_share { op, … }- Carried work: op is threads, thread, open, share or unshare. Share a thread with a user, team, agent or platform for a set time, with read, append, share, manage, rollback or delete access.
duplex_forget { what, id?, restore? }- Forgets what was taught, by the id Duplex gave it, and puts back what can be restored, with a certificate where the removal is attested.
duplex_status { show, … }- What Duplex decided and how it is set: show is capabilities, entry, calling, policies, skills, audit, ledger, certificates, recipes, recipe, lessons, sources, job or operation. audit with verify: true walks the signed chain.
duplex_report_feedback { text, confirm? }- Sends the user’s own report to their organization in two calls: a preview that sends nothing, then the report once the user confirms. Offered to a member’s key.
operation- An optional id of your choosing, 1 to 64 letters, digits or . _ : -, on any write. The same id with the same arguments is applied once, and duplex_status show "operation" tells you whether it was applied.
Answers, receipts and errors.
Every answer says exactly what happened, so your AI never has to guess.
decision: commit | refuse | defer- commit: reply with Duplex’s answer. refuse: decline, naming the rule. defer: the turn is your AI’s to answer, with the context Duplex returned, a route to a tool or the terms of the call that was asked for.
guarantee: advisory | hooked- advisory: MCP alone, and Duplex sees what your AI sends it. hooked: your client’s hooks hand Duplex each turn and each tool call before it runs.
saved · applied · ran · computed · submitted · removed- The receipts that prove something was done. A listed tool or an HTTP 200 only proves the connection works. A write that was kept carries durable.
kind: invalid | not_permitted | not_found | conflict | busy | fault- Every error says what kind it is, whether anything was applied, and whether to retry.
retry: safe | after | no- safe: send it again. after: send it again after retry_after_s. no: change the call first.
-32602 · -32003 · -32001 · -32005 · -32006- JSON-RPC errors: -32602 a call the tool does not take (fix it, don’t resend it as it was), -32003 a key without the scope the tool needs, -32001 a credential that isn’t accepted, -32005 a rate limit and -32006 a store that didn’t answer, both with Retry-After.
Go deeper with our team.
Bring your setup and your questions. We’ll walk through every setting with the product open.















