Skip to content

Agents & clients ​

Workstate is not an agent, and it does not run agents. The agents you already use connect to it over MCP, the Model Context Protocol: an open standard for connecting AI tools to data. Through Workstate's tools, an agent searches what your team knows and records what it decides.

How an agent connects ​

Workstate has two MCP servers. Both use the Streamable HTTP transport.

Server nameAddressTools
rag-corpushttps://mcp-uat.workstate.io/corpussearch_corpus, reindex_corpus
rag-ledgerhttps://mcp-uat.workstate.io/ledgerledger_search, ledger_get, ledger_create, ledger_append, ledger_move, ledger_archive

Requests carry these headers:

HeaderRequiredWhat it does
Authorization: Bearer <key>YesYour API key. The agent acts as the person who owns the key.
X-RAG-Namespace: <namespace id>NoThe namespace to use, such as ws-…. It must be one you have access to. Without it, the agent uses your oldest namespace.
X-RAG-Agent: <label>NoA name for the agent, such as codex. Ledger entries carry it when the agent does not name itself in the tool call.

Everything an agent records is attributed to the person whose key it used, together with the agent's name. See Keys & attribution. MCP tools describes every tool.

Get your configuration ​

  1. In the console, choose a namespace in the switcher at the top of the sidebar.
  2. Open API keys. Under Create a key, describe where you will use the key, and select Create key. Copy the key and store it safely. See API keys.
  3. In Connect your agent, select Copy.

The configuration connects an agent to the selected namespace. It reads the key from the RAG_API_KEY environment variable, so it holds no secret. For your oldest namespace, it looks like this:

json
{
  "mcpServers": {
    "rag-corpus": {
      "type": "http",
      "url": "https://mcp-uat.workstate.io/corpus",
      "headers": {
        "Authorization": "Bearer ${RAG_API_KEY}",
        "X-RAG-Namespace": "ws-…"
      }
    },
    "rag-ledger": {
      "type": "http",
      "url": "https://mcp-uat.workstate.io/ledger",
      "headers": {
        "Authorization": "Bearer ${RAG_API_KEY}",
        "X-RAG-Namespace": "ws-…"
      }
    }
  }
}

For any other namespace, the server names end with its id, such as rag-corpus-ws-…. That keeps each namespace's servers apart, so you can switch namespace, copy again, and add the new pair to the same file. See Managing namespaces.

Claude Code reads this configuration as it is. Other clients use a different file or a slightly different syntax, shown on each client's page.

Server names ​

Clients name each tool after its server: in Claude Code, for example, the search tool is mcp__rag-corpus__search_corpus. Agent instructions refer to the tools by the server names rag-corpus and rag-ledger, and some clients load a tool only when it is asked for by its exact name. If the server names and the instructions disagree, the agent doesn't find the tools, and nothing tells you so.

  • An agent that uses one namespace: name its servers rag-corpus and rag-ledger. The console already does this for your oldest namespace. For any other, it adds the namespace id to the names, so rename them. The X-RAG-Namespace header, not the server name, decides the namespace.
  • An agent that uses several namespaces at once: give each namespace's servers their own names, such as the ones the console gives, and say in the agent's instructions which names cover which namespace. See Connect an agent to several namespaces.

Choose your client ​

ClientWhere the configuration goesHow it gets the key
Claude Code.mcp.json in your project, or your user configuration${RAG_API_KEY}, or a script that reads the key from the macOS Keychain
Claude desktop.mcp.json in your project, for the Code tab. Chat cannot connect yet.On macOS, a script that reads the key from the Keychain. On Windows, ${RAG_API_KEY}.
Cursor.cursor/mcp.json in your project, or ~/.cursor/mcp.json${env:RAG_API_KEY}
Codex~/.codex/config.tomlbearer_token_env_var = "RAG_API_KEY"
Other MCP clientsThe client's MCP settings. VS Code is shown as an example.Depends on the client
Your own agentYour code, through an MCP client library or the REST APIThe Authorization header

Teach the agent to use Workstate ​

Connecting gives an agent the tools. Instructions make it use them well: search before it acts, cite what it found, and record what it decided. Agent instructions has text you can paste.

Keep your key safe ​

  • Never put the key in a file that might be committed. The configurations in these guides hold only a reference to the key, such as ${RAG_API_KEY}.
  • Make one key for each machine or agent, so that you can revoke one without stopping the others.
  • Do not share a key. Everything done with it is recorded as its owner's.

Workstate is built by Nerdstorm Pty Ltd, Sydney.