# Connection

> MCP server connection, install instructions, and protocol reference.

Content type: documentation
Source URL: https://www.agentpmt.com/docs/mcp-reference/connection
Markdown URL: https://www.agentpmt.com/docs/mcp-reference/connection?format=agent-md
Category: MCP Reference

---

## Streamable HTTP Endpoint

Connect directly to the cloud MCP endpoint. No install needed -- all tools run remotely.

**Endpoint:**

```
https://api.agentpmt.com/mcp
```

**Transport:** Streamable HTTP (JSON-RPC over HTTPS)

**Authentication:** Bearer token from your AgentPMT dashboard.

1. **Get your Bearer token**
   Go to your [Dashboard](/dashboard?tab=control-panel&subtab=agent-guardrails) and click **Display Bearer Token** to copy it.

2. **Configure your MCP client**
   Point your MCP client at the endpoint with your token as the `Authorization: Bearer` header. Example for clients that support HTTP transport:

   ```json
   {
     "mcpServers": {
       "agentpmt": {
         "url": "https://api.agentpmt.com/mcp",
         "transport": "streamable-http",
         "headers": {
           "Authorization": "Bearer YOUR_TOKEN"
         }
       }
     }
   }
   ```

3. **Start using tools**
   Your AI agent now has access to all AgentPMT tools in your budget. No restarts needed when tools change -- the catalog refreshes automatically.

---

## Local Install (STDIO / SSE)

Install a lightweight local connector for platforms that use STDIO transport. The local binary forwards JSON-RPC calls to the cloud endpoint over HTTPS.

### Prerequisites

- **Node.js** (v18+) with npm. Check with `npm --version`. Download from [nodejs.org](https://nodejs.org) if needed.
- **Bearer token** from your [Dashboard](/dashboard?tab=control-panel&subtab=agent-guardrails) (click **Display Bearer Token**).

1. **Install the MCP Router**
   ```bash
   npm install -g @agentpmt/mcp-router
   ```

   This downloads the universal MCP server package and the platform-appropriate router binary.

2. **Run the Setup Wizard**
   ```bash
   agentpmt-setup
   ```

   The wizard will:
   1. Auto-detect all installed AI tools on your system
   2. Prompt for your Bearer token
   3. Automatically configure all detected platforms

3. **Restart Your AI Tools**
   Close and reopen your AI tools. AgentPMT tools will appear in the available tools list.

   Some platforms (like Claude Desktop) may require 2-3 restarts to load MCP servers.

### Manual Configuration

If the wizard didn't detect your platform, or you need custom configuration, add the config manually.

### Claude Desktop

**Config file:**
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Linux: `~/.config/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "agentpmt": {
      "command": "npx",
      "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
      "env": {
        "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}
```

### Claude Code CLI

**Config file:** `~/.claude.json` (all platforms)

```json
{
  "mcpServers": {
    "agentpmt": {
      "command": "npx",
      "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
      "env": {
        "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}
```

### Cursor

**Config file:** `~/.cursor/mcp.json` (all platforms)

```json
{
  "mcpServers": {
    "agentpmt": {
      "command": "npx",
      "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
      "env": {
        "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}
```

After adding: Open Cursor Settings > Features > MCP and click Refresh.

### VS Code

**Config file:**
- Windows: `%APPDATA%\Code\User\mcp.json`
- macOS: `~/Library/Application Support/Code/User/mcp.json`
- Linux: `~/.config/Code/User/mcp.json`

```json
{
  "mcpServers": {
    "agentpmt": {
      "command": "npx",
      "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
      "env": {
        "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}
```

### Windsurf

**Config file:** `~/.codeium/windsurf/mcp_config.json` (all platforms)

```json
{
  "mcpServers": {
    "agentpmt": {
      "command": "npx",
      "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
      "env": {
        "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}
```

### Zed

**Config file:**
- Windows: `%APPDATA%\Zed\settings.json`
- macOS/Linux: `~/.config/zed/settings.json`

```json
{
  "context_servers": {
    "agentpmt": {
      "settings": {},
      "command": {
        "path": "npx",
        "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
        "env": {
          "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
        }
      }
    }
  }
}
```

### Codex CLI

**Config file:** `~/.codex/config.toml` (all platforms)

```toml
[mcp_servers.agentpmt]
command = "npx"
args = ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"]

[mcp_servers.agentpmt.env]
AGENTPMT_BEARER_TOKEN = "YOUR_TOKEN"
```

### Gemini CLI

**Config file:** `~/.gemini/settings.json` (all platforms)

```json
{
  "mcpServers": {
    "agentpmt": {
      "command": "npx",
      "args": ["--package=@agentpmt/mcp-router@latest", "agentpmt-router"],
      "env": {
        "AGENTPMT_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}
```

---

## How It Works

The local router is a lightweight STDIO connector. It does not execute tools locally.

1. Your AI tool sends JSON-RPC messages via STDIO to the local binary.
2. The binary forwards them over HTTPS to `https://api.agentpmt.com/mcp` using your Bearer token.
3. All tool execution happens on AgentPMT's cloud infrastructure.
4. The tool catalog auto-refreshes every 30 minutes -- new tools appear without restarts.
5. Every tool call is logged with a full audit trail visible in your dashboard.

---

## Discovery and Protocol Reference

## Autonomous Agents

If you are building an autonomous agent that needs to access tools programmatically without MCP, see the [Autonomous Agents API Reference](/docs/api-reference/autonomous-agents?section=api-mcp-reference) for wallet-authenticated endpoints covering identity, purchasing, tool calls, and jobs.