Aller au contenu
Menu

Bien démarrer

Connect a client

.md

This page gives the exact set-up for each AI client: Claude Code, Codex, Cursor, GitHub Copilot in VS Code, Hermes Agent, and any other client that speaks MCP.

Every client reaches your workspace at one address, https://api.duplex.matterspace.ai/mcp. Most clients hold a key from the console, and the console's Get started screen shows every line below with your own key already in it. A client that supports MCP's own sign-in needs no key: the last section of this page says how it connects.

Two ways to connect

MCP onlyThe client's package (MCP and hooks)
What you installNothing: one line in the client's settingsThe package for your client
How the agent gets its contextIt calls duplex_context at the start of a turn and duplex_observe at its end, as the server tells itThe hooks give each prompt its context and record each turn, whatever the model does
Your rules on tool callsThe agent is told the rules and follows themA hook checks a tool call before it runs and can stop it
Where it worksAny client that speaks MCPClaude Code, Codex, Cursor, GitHub Copilot; Hermes Agent's package has skills and MCP, no hooks

Start with MCP only: it takes a minute. Use the package where a rule must hold whatever the model decides: The client packages says where to download it and how to install it. Both ways use the same workspace, the same key and the same data, and you can move from one to the other at any time.

A key

API keys in the console makes one, and Get started makes your first. A key is shown once. Keep it in an environment variable or in the client's own secret store, never in a file of a repository. Your sign-in to the console is not a key.

Claude Code

In a terminal:

bash
claude mcp add --transport http duplex https://api.duplex.matterspace.ai/mcp --header "X-API-Key: <your Duplex key>"

Codex

The key stays in your environment; Codex reads it from there:

bash
export DUPLEX_API_KEY="<your Duplex key>"
codex mcp add duplex --url https://api.duplex.matterspace.ai/mcp --bearer-token-env-var DUPLEX_API_KEY

Cursor

In ~/.cursor/mcp.json for yourself, or .cursor/mcp.json in a project:

json
{
  "mcpServers": {
    "duplex": {
      "url": "https://api.duplex.matterspace.ai/mcp",
      "headers": {
        "Authorization": "Bearer <your Duplex key>"
      }
    }
  }
}

GitHub Copilot in VS Code

In .vscode/mcp.json; VS Code asks for the key once and keeps it:

json
{
  "servers": {
    "duplex": {
      "type": "http",
      "url": "https://api.duplex.matterspace.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${input:duplex-api-key}"
      }
    }
  },
  "inputs": [
    {
      "id": "duplex-api-key",
      "type": "promptString",
      "password": true,
      "description": "Your Duplex key"
    }
  ]
}

Hermes Agent

Merge into ~/.hermes/config.yaml, and put DUPLEX_API_KEY=<your Duplex key> in ~/.hermes/.env:

yaml
mcp_servers:
  duplex:
    url: "https://api.duplex.matterspace.ai/mcp"
    headers:
      Authorization: "Bearer ${DUPLEX_API_KEY}"

Any other client that reads an mcpServers file

json
{
  "mcpServers": {
    "duplex": {
      "url": "https://api.duplex.matterspace.ai/mcp",
      "headers": {
        "X-API-Key": "<your Duplex key>"
      }
    }
  }
}

Clients that sign in instead of holding a key

A client that supports MCP's own sign-in needs no key. Add a connector at https://api.duplex.matterspace.ai/mcp: the client opens the service's sign-in page, you sign in with your MS Duplex account and approve the client, and it receives a short-lived token for you alone. Signing out everywhere, leaving the organization or closing it ends the token.

What the server is

  • The server is https://api.duplex.matterspace.ai/mcp, Streamable HTTP: requests are POSTed as JSON-RPC.
  • The key may go in X-API-Key, x-duplex-key or Authorization: Bearer.
  • It offers eleven tools: duplex_context, duplex_observe, duplex_learn, duplex_rules, duplex_task, duplex_plan, duplex_skill, duplex_share, duplex_forget, duplex_status and duplex_report_feedback. Which of them a key is offered depends on what the key may do. API says what each is for.
  • A tool's result can be shortened (about 48,000 characters); the console and the API give complete data.

When a call is refused

Every refusal says what happened in a sentence and whether trying again helps (retry: safe, after with a wait, or no).

The answerWhat it meansWhat to do
401The key is not one the service knows, or it was revokedMake a key on API keys
402The month's queries of your plan are usedWait for the next month, or change plan on Billing. Your agent keeps working without Duplex, and nothing it learned is lost; see Plans and limits
403 with a rule's wordsOne of your organization's rules refused the callThe rule's text says why; your admins change rules on Rules
429 naming a limitYour plan's calls a minute, or calls at once, are usedWait the seconds the answer names, or change plan on Billing; see Plans and limits
503, try againThe service could not take the call for a moment; with over_capacity, nothing was doneSend the call again after the seconds the answer names