> ## Documentation Index
> Fetch the complete documentation index at: https://agents-docs.hockeystack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Use the Revenue Agents API from Claude Desktop, Cursor, Claude Code, and other Model Context Protocol clients.

The `hockeystack-revenue-agents-mcp` package exposes the full Revenue Agents
v1 API surface — agents, conversations, tasks, and credits — as Model Context
Protocol tools. Drop it into any MCP-compatible client to let an LLM drive the
API directly.

## Prerequisites

* Node.js 18 or newer.
* A Revenue Agents API token. Generate one in the HockeyStack workspace
  settings. Tokens look like `hsr_live_<hex>`.

## Run

Run directly with `npx` — no install step:

```bash theme={null}
HOCKEYSTACK_API_TOKEN=hsr_live_... npx hockeystack-revenue-agents-mcp
```

Or install globally:

```bash theme={null}
npm install -g hockeystack-revenue-agents-mcp
HOCKEYSTACK_API_TOKEN=hsr_live_... hockeystack-revenue-agents-mcp
```

## Configure

The server reads configuration from environment variables.

| Variable                | Required | Default                                             |
| ----------------------- | -------- | --------------------------------------------------- |
| `HOCKEYSTACK_API_TOKEN` | Yes      | —                                                   |
| `HOCKEYSTACK_BASE_URL`  | No       | `https://app.hockeystack.com/api/revenue-agents/v1` |

## Add to your MCP client

The configuration is the same across MCP clients — only the config file
location differs.

<CodeGroup>
  ```json Claude Desktop theme={null}
  {
    "mcpServers": {
      "hockeystack": {
        "command": "npx",
        "args": ["-y", "hockeystack-revenue-agents-mcp"],
        "env": {
          "HOCKEYSTACK_API_TOKEN": "hsr_live_..."
        }
      }
    }
  }
  ```

  ```json Cursor theme={null}
  {
    "mcpServers": {
      "hockeystack": {
        "command": "npx",
        "args": ["-y", "hockeystack-revenue-agents-mcp"],
        "env": {
          "HOCKEYSTACK_API_TOKEN": "hsr_live_..."
        }
      }
    }
  }
  ```

  ```json Claude Code theme={null}
  {
    "mcpServers": {
      "hockeystack": {
        "command": "npx",
        "args": ["-y", "hockeystack-revenue-agents-mcp"],
        "env": {
          "HOCKEYSTACK_API_TOKEN": "hsr_live_..."
        }
      }
    }
  }
  ```
</CodeGroup>

Config file locations:

* **Claude Desktop (macOS):** `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Claude Desktop (Windows):** `%APPDATA%\Claude\claude_desktop_config.json`
* **Cursor:** Settings → MCP, or `~/.cursor/mcp.json`
* **Claude Code:** `~/.claude.json` under `mcpServers`

Restart the client after editing the config.

## Tools exposed

Each tool maps one-to-one to a Revenue Agents API endpoint. Tool names are
prefixed with `hs_`.

**Service**

* `hs_health` — Liveness probe (unauthenticated).
* `hs_me` — Token introspection.

**Agents**

* `hs_list_company_agents`, `hs_init_company_agent`, `hs_get_company_agent`, `hs_delete_company_agent`
* `hs_list_deal_agents`, `hs_init_deal_agent`, `hs_get_deal_agent`, `hs_delete_deal_agent`

**Conversations — deal**

* `hs_create_deal_conversation`, `hs_list_deal_conversations`, `hs_delete_deal_conversation`
* `hs_list_deal_conversation_messages`, `hs_send_deal_message`

**Conversations — company**

* `hs_create_company_conversation`, `hs_list_company_conversations`, `hs_delete_company_conversation`
* `hs_list_company_conversation_messages`, `hs_send_company_message`

**Tasks**

* `hs_list_tasks`, `hs_get_task`, `hs_create_task`, `hs_update_task`, `hs_delete_task`

**Credits**

* `hs_credits_balance`, `hs_credits_usage`, `hs_credits_operations`

## Verify the connection

After restarting your client, ask it something that exercises the server:

> "Use the hockeystack tools to check my credit balance."

The client should call `hs_credits_balance` and return the current usage
against your monthly bundle.

## Troubleshooting

* **Tools don't appear:** confirm the client picked up the new config — most
  clients require a full restart, not a window reload. Check the client's MCP
  logs for spawn errors.
* **Every call returns 401:** the token is missing, malformed, or revoked.
  Verify the value of `HOCKEYSTACK_API_TOKEN` and that it starts with
  `hsr_live_`.
* **503 on message sends:** the workspace has hit its monthly credit cap. See
  [Credits](#tools-exposed) (`hs_credits_balance`) to confirm.

## Source

* Package: [`hockeystack-revenue-agents-mcp` on npm](https://www.npmjs.com/package/hockeystack-revenue-agents-mcp)
* Repo: [github.com/bgrgndzz/hockeystack-revenue-agents-mcp](https://github.com/bgrgndzz/hockeystack-revenue-agents-mcp)
