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

# MCP Server

> Connect AI coding tools like Cursor and Claude Code to your Magnet workspace using the Model Context Protocol (MCP).

## Overview

Magnet provides an MCP (Model Context Protocol) server that lets AI coding tools interact with your workspace. This enables tools like Cursor, VS Code, and Claude Code to:

* **Search** issues and pages in your Magnet workspace
* **Create and update** issues and pages
* **Upload chat sessions** from your editor to Magnet
* **Read** issue and page content as context

## Setting up the MCP server

<Steps>
  <Step title="Get your API key">
    Go to **Settings** > **API Keys** in the Magnet dashboard and create an API key for your workspace.
  </Step>

  <Step title="Copy the MCP configuration">
    In your workspace settings, find the **MCP Server** section. Copy the configuration snippet for your tool.
  </Step>

  <Step title="Add to your tool">
    Paste the configuration into your tool's MCP settings.
  </Step>
</Steps>

### Cursor configuration

Add to your Cursor MCP settings (`.cursor/mcp.json`):

```json theme={null}
{
  "mcpServers": {
    "magnet": {
      "url": "https://magnet.run/api/mcp",
      "headers": {
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}
```

### Claude Code configuration

Add to your Claude Code MCP settings:

```json theme={null}
{
  "mcpServers": {
    "magnet": {
      "url": "https://magnet.run/api/mcp",
      "headers": {
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}
```

## Available tools

Once connected, the MCP server exposes these tools to your AI coding assistant:

| Tool              | Description                            |
| ----------------- | -------------------------------------- |
| `search`          | Search across issues and pages         |
| `list_issues`     | List issues with optional filters      |
| `get_issue_by_id` | Get a specific issue with full content |
| `create_issue`    | Create a new issue                     |
| `update_issue`    | Update an existing issue               |
| `list_pages`      | List pages with optional filters       |
| `get_page_by_id`  | Get a specific page with full content  |
| `create_page`     | Create a new page                      |
| `update_page`     | Update an existing page                |
| `upload_chat`     | Upload a chat session from your editor |

## Chat uploads

The MCP server can upload chat sessions from Cursor and Claude Code to your Magnet workspace. This lets you capture important conversations and share them with your team.

When you upload a chat, it's stored in Magnet and accessible from the dashboard — preserving the full conversation including thinking, tool calls, and results.

### Supported editors

* **Cursor** — exports conversation history including tool calls and results
* **Claude Code** — exports conversations with full content blocks
