# MCP server

> Let AI assistants and agents send email and manage Pidgely through the Model Context Protocol. Configuration for Claude Desktop, Claude Code and Cursor (preview).

Source: https://docs.pidgely.com/mcp/

> [!PREVIEW]
> The Pidgely MCP server (`@pidgely/mcp`) is being built in the open at [pidgely/mcp](https://github.com/pidgely/mcp) and is not published yet. The configuration below is the **planned** setup; tool names and options may change before the first release.

The [Model Context Protocol](https://modelcontextprotocol.io) lets AI assistants call external tools. With the Pidgely MCP server, an assistant can send emails and work with your Pidgely resources (emails, domains, contacts, broadcasts) using your API key. It runs locally over stdio with `npx` and reads the key from `PIDGELY_API_KEY`.

## Claude Desktop

Add the server to `claude_desktop_config.json` (Settings → Developer → Edit config) and restart Claude Desktop:

```json title="claude_desktop_config.json"
{
  "mcpServers": {
    "pidgely": {
      "command": "npx",
      "args": ["-y", "@pidgely/mcp"],
      "env": { "PIDGELY_API_KEY": "pdg_your_key_here" }
    }
  }
}
```

## Claude Code

```bash
claude mcp add --transport stdio pidgely --env PIDGELY_API_KEY=pdg_your_key_here -- npx -y @pidgely/mcp
```

## Cursor

Add it to `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for every project):

```json title=".cursor/mcp.json"
{
  "mcpServers": {
    "pidgely": {
      "command": "npx",
      "args": ["-y", "@pidgely/mcp"],
      "env": { "PIDGELY_API_KEY": "pdg_your_key_here" }
    }
  }
}
```

## Choosing a key for an agent

An agent acts with the permissions of its key. Start narrow:

- For agents that only send, use a [`sending_access` key restricted to one domain](https://docs.pidgely.com/authentication/#domain-restricted-keys): it can't read contacts, change domains or create keys.
- Use a `full_access` key only for agents you trust to manage the account, and revoke it when you're done.
- Ask the assistant to confirm before sending to real recipients.

## Docs for assistants

Assistants can also read these docs directly: [`/llms.txt`](https://docs.pidgely.com/llms.txt) lists every page, [`/llms-full.txt`](https://docs.pidgely.com/llms-full.txt) has all of them in one file, and every page is available as Markdown at `<url>.md`.
