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

# MCP Server

> Governance and observability for Claude Desktop, VS Code, JetBrains, Cursor, Windsurf, Zed, Warp, and 10+ more tools

# MeshAI MCP Server

The MeshAI MCP Server brings governance and observability to **any MCP-compatible AI tool**, even tools that don't support custom API base URLs.

## When to Use

| Integration Path      | Best For                                                                              |
| --------------------- | ------------------------------------------------------------------------------------- |
| **MeshAI Proxy**      | Tools with custom base URL support (Claude Code, Cursor, Cline, Codex)                |
| **MeshAI MCP Server** | Tools without proxy support (Claude Desktop, VS Code, JetBrains, Windsurf, Zed, Warp) |
| **Both**              | Maximum coverage: proxy for traffic monitoring, MCP for governance tools              |

## Setup

No global install needed. Each tool config uses `npx` to download `@meshailabs/mcp-server` from the npm registry and run the prebuilt package.

## Environment Variables

| Variable            | Required | Default                  | Description                         |
| ------------------- | -------- | ------------------------ | ----------------------------------- |
| `MESHAI_API_KEY`    | Yes      | -                        | Your MeshAI API key (`msh_...`)     |
| `MESHAI_API_URL`    | No       | `https://api.meshai.dev` | API endpoint                        |
| `MESHAI_AGENT_NAME` | No       | `mcp-agent`              | Name for this agent in the registry |

## Configuration by Tool

### Claude Desktop

Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json theme={null}
{
  "mcpServers": {
    "meshai": {
      "command": "npx",
      "args": ["-y", "@meshailabs/mcp-server"],
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "claude-desktop"
      }
    }
  }
}
```

### Cursor

Add to `.cursor/mcp.json` or Settings > MCP Servers:

```json theme={null}
{
  "meshai": {
    "command": "npx",
    "args": ["-y", "@meshailabs/mcp-server"],
    "env": {
      "MESHAI_API_KEY": "msh_your_key_here",
      "MESHAI_AGENT_NAME": "cursor"
    }
  }
}
```

### Windsurf

Edit `~/.codeium/windsurf/mcp_config.json`:

```json theme={null}
{
  "mcpServers": {
    "meshai": {
      "command": "npx",
      "args": ["-y", "@meshailabs/mcp-server"],
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "windsurf"
      }
    }
  }
}
```

### VS Code (GitHub Copilot)

Add to `.vscode/mcp.json`:

```json theme={null}
{
  "servers": {
    "meshai": {
      "command": "npx",
      "args": ["-y", "@meshailabs/mcp-server"],
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "vscode"
      }
    }
  }
}
```

### JetBrains IDEs

**Settings > Tools > AI Assistant > Model Context Protocol (MCP) > Add Server:**

* Command: `npx`
* Args: `-y @meshailabs/mcp-server`
* Environment: `MESHAI_API_KEY=msh_your_key_here`, `MESHAI_AGENT_NAME=jetbrains`

Works with IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, and all other JetBrains IDEs.

### Zed

Add to `~/.config/zed/settings.json`:

```json theme={null}
{
  "context_servers": {
    "meshai": {
      "source": "custom",
      "command": {
        "path": "npx",
        "args": ["-y", "@meshailabs/mcp-server"]
      },
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "zed"
      }
    }
  }
}
```

### Warp

**Settings > Agent > MCP > Add Server:**

* Command: `npx`
* Args: `-y @meshailabs/mcp-server`
* Environment: `MESHAI_API_KEY=msh_your_key_here`, `MESHAI_AGENT_NAME=warp`

### AWS Kiro

Add to `.kiro/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "meshai": {
      "command": "npx",
      "args": ["-y", "@meshailabs/mcp-server"],
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "kiro"
      }
    }
  }
}
```

### Cline / Roo Code / Kilo Code

**Settings > MCP Servers > Add Server:**

* Command: `npx`
* Args: `-y @meshailabs/mcp-server`
* Environment: `MESHAI_API_KEY=msh_your_key_here`, `MESHAI_AGENT_NAME=cline`

### Continue.dev

Add to `~/.continue/config.yaml`:

```yaml theme={null}
mcpServers:
  - name: meshai
    command: npx
    args:
      - "-y"
      - "@meshailabs/mcp-server"
    env:
      MESHAI_API_KEY: msh_your_key_here
      MESHAI_AGENT_NAME: continue
```

### Amazon Q Developer

Add to `~/.aws/amazonq/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "meshai": {
      "command": "npx",
      "args": ["-y", "@meshailabs/mcp-server"],
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "amazon-q"
      }
    }
  }
}
```

### Gemini CLI

Add to `~/.gemini/settings.json`:

```json theme={null}
{
  "mcpServers": {
    "meshai": {
      "command": "npx",
      "args": ["-y", "@meshailabs/mcp-server"],
      "env": {
        "MESHAI_API_KEY": "msh_your_key_here",
        "MESHAI_AGENT_NAME": "gemini-cli"
      }
    }
  }
}
```

### Sourcegraph Cody / Tabnine / Goose

These tools follow similar MCP configuration patterns. Set:

* Command: `npx`
* Args: `-y @meshailabs/mcp-server`
* Environment: `MESHAI_API_KEY=msh_your_key_here`, `MESHAI_AGENT_NAME=<tool-name>`

Refer to each tool's MCP documentation for the exact config file location.

## Available Tools

Once configured, the MCP server exposes 8 tools to the AI assistant:

| Tool                     | Description                                      |
| ------------------------ | ------------------------------------------------ |
| `meshai_register`        | Register this tool as a governed agent in MeshAI |
| `meshai_heartbeat`       | Send health heartbeat for uptime monitoring      |
| `meshai_track_usage`     | Report token usage for cost tracking             |
| `meshai_check_policy`    | Check if a model/provider is allowed before use  |
| `meshai_get_risk`        | Get EU AI Act risk classification                |
| `meshai_get_compliance`  | Get compliance readiness score (0-120)           |
| `meshai_report_incident` | Report a security incident (Article 73)          |
| `meshai_audit_log`       | Query the governance audit trail                 |

## Available Resources

| URI                            | Description                       |
| ------------------------------ | --------------------------------- |
| `meshai://agent/status`        | Current agent status and metadata |
| `meshai://governance/policies` | Active governance policies        |
| `meshai://compliance/score`    | EU AI Act readiness score         |

## How It Works

1. Your AI tool (e.g., Claude Desktop) starts the MeshAI MCP server via `npx`
2. `npx` downloads the prebuilt package from the npm registry and runs it as a subprocess
3. The server connects to the MeshAI API using your API key
4. The AI tool can call MeshAI governance tools alongside its normal capabilities
5. The MeshAI dashboard shows this tool alongside all other agents
6. Governance policies, audit trails, and compliance features apply universally

## Supported Tools

| Tool               | MCP Support | Proxy Support | MCP Server Fills Gap? |
| ------------------ | ----------- | ------------- | --------------------- |
| Claude Desktop     | Yes         | No            | **Yes**               |
| Claude Code        | Yes         | Yes           | Optional              |
| Cursor             | Yes         | Yes           | Optional              |
| Windsurf           | Yes         | Partial       | **Yes**               |
| Cline              | Yes         | Yes           | Optional              |
| Roo Code           | Yes         | Yes           | Optional              |
| Kilo Code          | Yes         | Yes           | Optional              |
| AWS Kiro           | Yes         | TBD           | **Yes**               |
| VS Code Copilot    | Yes         | No            | **Yes**               |
| JetBrains IDEs     | Yes         | No            | **Yes**               |
| Zed                | Yes         | No            | **Yes**               |
| Warp               | Yes         | No            | **Yes**               |
| Continue.dev       | Yes         | Yes           | Optional              |
| Sourcegraph Cody   | Yes         | Yes           | Optional              |
| Tabnine            | Yes         | No            | **Yes**               |
| Amazon Q Developer | Yes         | No            | **Yes**               |
| Gemini CLI         | Yes         | No            | **Yes**               |
| Goose              | Yes         | No            | **Yes**               |
| Codex              | Yes         | Yes           | Optional              |

> **"MCP Server Fills Gap?"**: **Yes** means the tool has no custom base URL support, so the MCP server is the only way to get MeshAI governance. **Optional** means the tool already supports the proxy; the MCP server adds governance tools but isn't required.
