Connect an agent

Point an MCP client at Treatyway. Search needs no key. A key is only for recording a request. The short guide is agents.md.

Claude Code

claude mcp add --transport http treatyway https://treatyway.com/mcp
claude mcp add --transport http treatyway https://treatyway.com/mcp --header "Authorization: Bearer YOUR_KEY"

Try this first

Call search_businesses with machine shop in San Jose. One published result is HD Machining LLC in San Jose, with an email on file that is not shown, website https://hdmachinings.com, page title CNC.

Tools

No key: search_businesses, get_business, create_workspace.

Need a key: upgrade_workspace, create_request, get_request, add_message, cancel_request. A request is recorded. A connected webhook is signed and delivered. Otherwise nothing is emailed. A listing with no email is not deliverable by email yet.

Add the key, then reconnect

Search needs no key. Recording a request does. Clients set Authorization: Bearer when they connect, not on each tool call.

  1. Call create_workspace with no arguments. Copy the key. It is shown once.
  2. Put the key in the client config. Claude Desktop, Claude Code, Cursor, and a generic config are below.
  3. Reconnect the client. The next session sends the header.

A key in the URL is not accepted. claude.ai custom connectors have no header field. Putting the key in that connector URL would copy it into logs and history, so Treatyway does not accept it. Those connectors can search and create a key. They cannot call tools that need the key. Use Claude Desktop, Claude Code, or Cursor for that.

Get a key

Call create_workspace with no arguments. That is Anonymous. organization (the company) and operator_name (the person) are optional and make the workspace Declared. agent_name is optional. Or:

curl -X POST https://treatyway.com/api/workspaces \
  -H 'Content-Type: application/json' \
  -H 'User-Agent: TreatywayDirectory/0.2' \
  -d '{}'

The key is shown once. Send it only as Authorization: Bearer. A key in the URL is not accepted. Delete that workspace with DELETE /api/workspace and the same key. upgrade_workspace raises the trust tier without a new key. Limits depend on the tier. They are in agents.md.

New keys are limited to 12 per hour for a client and 500 per hour overall. This is not OAuth.

curl

curl https://treatyway.com/mcp \
  --header 'Accept: application/json, text/event-stream' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: TreatywayDirectory/0.2' \
  --header 'Authorization: Bearer YOUR_KEY' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_businesses","arguments":{"query":"machine shop in San Jose"}}}'

Cursor

{
  "mcpServers": {
    "treatyway": {
      "url": "https://treatyway.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

VS Code

.vscode/mcp.json

{
  "servers": {
    "treatyway": {
      "type": "http",
      "url": "https://treatyway.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json. Replace YOUR_KEY, save, and reconnect.

{
  "mcpServers": {
    "treatyway": {
      "type": "http",
      "url": "https://treatyway.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

claude.ai

Custom connectors have no header field. URL https://treatyway.com/mcp can search. Tools that need a key need Claude Desktop, Claude Code, or Cursor, which can send Authorization: Bearer.

Other clients

Endpoint
https://treatyway.com/mcp
Client config
{
  "mcpServers": {
    "treatyway": {
      "type": "http",
      "url": "https://treatyway.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}