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

# Setup

> Configure the MCP server and register it with Claude Code, Cursor, or any MCP client.

The MCP server runs as a stdio process spawned by your AI tool. Two steps: configure your credentials once, then register the spawn command with each tool.

<Steps>
  <Step title="Generate a Personal Access Token">
    In the web app: **Settings → Personal Access Tokens → Create**. Copy the `mr_pat_…` value — it is shown once. Treat it like a password: it grants read/write access to all your resumes.
  </Step>

  <Step title="Configure the MCP server">
    ```bash theme={null}
    npx -y @magic-resume/mcp config set \
      --api-url "https://api.magic-resume.cn/api" \
      --pat "mr_pat_xxx"
    ```

    This writes `~/.magic-resume/mcp.json`. If you're running the Core gateway locally, point `--api-url` at `http://localhost:3110/api`.
  </Step>

  <Step title="Register with your AI tool">
    <Tabs>
      <Tab title="Claude Code">
        ```bash theme={null}
        claude mcp add magic-resume -- npx -y @magic-resume/mcp mcp
        ```

        This adds Magic Resume to the user-scoped MCP list. Restart Claude Code so it picks up the new server.
      </Tab>

      <Tab title="Cursor">
        Open `~/.cursor/mcp.json` (create if missing) and add:

        ```json theme={null}
        {
          "mcpServers": {
            "magic-resume": {
              "command": "npx",
              "args": ["-y", "@magic-resume/mcp", "mcp"]
            }
          }
        }
        ```
      </Tab>

      <Tab title="Manual / Windsurf">
        Any MCP client that supports stdio servers can spawn it:

        ```bash theme={null}
        npx -y @magic-resume/mcp mcp
        ```

        The server speaks the standard MCP protocol over stdin/stdout — no flags needed.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Verify">
    In your AI tool, ask: *"List my Magic Resume resumes."* The model should call `list_resumes` and return your list. If it errors, run `npx -y @magic-resume/mcp config print` and confirm the API URL and PAT are correct.
  </Step>
</Steps>

<Info>
  The MCP server communicates over **stdio** — it does not open a network port, listen on a socket, or use SSE. Your AI tool spawns it as a child process and shuts it down when the session ends.
</Info>

## Updating

Because the spawn command is `npx -y @magic-resume/mcp mcp`, your AI tool pulls the latest version every time it starts. To pin a version explicitly:

```bash theme={null}
claude mcp add magic-resume -- npx -y @magic-resume/mcp@0.1.0 mcp
```

## Resetting credentials

```bash theme={null}
npx -y @magic-resume/mcp config clear
```

This removes `~/.magic-resume/mcp.json`. Revoke the PAT in the web app too if it leaked.
