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

# MCP server

> Let Claude Code, Codex, Cursor and other AI agents turn PDFs, Office files and scans into clean Markdown.

Coding agents read Markdown well and PDFs, scans and slide decks badly. The AnythingMD MCP server gives your agent one tool for that: it sends a local file or a link, and gets back clean Markdown with headings, tables and OCR'd text.

## What you can ask for

Once it is connected, ask in plain language. The agent picks the tool, uploads local files itself, and reads the result.

* "Convert `~/Downloads/lease.pdf` to Markdown and list every date and amount in a table."
* "Read [https://arxiv.org/pdf/2005.14165](https://arxiv.org/pdf/2005.14165) and summarize the method section."
* "Pull the tables out of `invoices/march.pdf` and save them as CSV."
* "Convert the Word files in `docs/specs` to Markdown and save each one next to the original."
* "This scanned contract is in Chinese. Convert it and translate the termination clause."

It handles PDFs (including scans), Word, PowerPoint, Excel, images and HTML, up to 1,000 pages per document.

## Set it up

**1. Get an API key**

Sign in at [anythingmd.com](https://anythingmd.com) and create a key under **Settings → API Keys**. New accounts include 20 free pages.

**2. Save the key as an environment variable**

The configs below read the key from `ANYTHINGMD_API_KEY`, so it never sits in a file you might commit.

```bash macOS / Linux theme={null}
echo 'export ANYTHINGMD_API_KEY="paste-your-key-here"' >> ~/.zshrc
```

```powershell Windows theme={null}
setx ANYTHINGMD_API_KEY "paste-your-key-here"
```

Open a new terminal and restart your editor or agent so it picks up the variable.

**3. Add the server to your agent**

Pick your client. Every config points at `https://mcp.anythingmd.com/mcp`.

**Claude Code**

Run in a terminal. `-s user` makes it available in every project; the single quotes keep the key out of Claude Code's config, which reads it from the variable when it connects.

```bash theme={null}
claude mcp add -s user --transport http anythingmd https://mcp.anythingmd.com/mcp --header 'Authorization: Bearer ${ANYTHINGMD_API_KEY}'
```

Start a new session and run `/mcp` to check that `anythingmd` is connected.

**Codex**

Run in a terminal. Codex reads the key from the variable each time it connects; the config stores only the variable's name. The Codex CLI, IDE extension and desktop app share this setting.

```bash theme={null}
codex mcp add anythingmd --url https://mcp.anythingmd.com/mcp --bearer-token-env-var ANYTHINGMD_API_KEY
```

**Cursor**

[Install in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=anythingmd\&config=eyJ1cmwiOiJodHRwczovL21jcC5hbnl0aGluZ21kLmNvbS9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIgJHtlbnY6QU5ZVEhJTkdNRF9BUElfS0VZfSJ9fQ%3D%3D), or add this to `~/.cursor/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "anythingmd": {
      "url": "https://mcp.anythingmd.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:ANYTHINGMD_API_KEY}"
      }
    }
  }
}
```

Then enable `anythingmd` under **Cursor Settings → MCP**.

**VS Code**

Add this to `.vscode/mcp.json`. VS Code asks for the key the first time the server starts and stores it outside the file.

```json theme={null}
{
  "inputs": [
    {
      "type": "promptString",
      "id": "anythingmd-key",
      "description": "AnythingMD API key",
      "password": true
    }
  ],
  "servers": {
    "anythingmd": {
      "type": "http",
      "url": "https://mcp.anythingmd.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:anythingmd-key}"
      }
    }
  }
}
```

**Windsurf**

Add this to `~/.codeium/windsurf/mcp_config.json`:

```json theme={null}
{
  "mcpServers": {
    "anythingmd": {
      "serverUrl": "https://mcp.anythingmd.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:ANYTHINGMD_API_KEY}"
      }
    }
  }
}
```

**Kilo**

Add this to your global Kilo config, `~/.config/kilo/kilo.json` (or `kilo.jsonc`). Don't put it in a project's `kilo.json`: Kilo skips MCP servers whose headers read environment variables from project config, so a cloned repository can't read your key.

```json theme={null}
{
  "mcp": {
    "anythingmd": {
      "type": "remote",
      "url": "https://mcp.anythingmd.com/mcp",
      "headers": {
        "Authorization": "Bearer {env:ANYTHINGMD_API_KEY}"
      }
    }
  }
}
```

**Other clients**

Any client that supports remote MCP servers over Streamable HTTP. Send the key as a bearer token, using your client's own way to read an environment variable:

```json theme={null}
{
  "mcpServers": {
    "anythingmd": {
      "type": "streamable-http",
      "url": "https://mcp.anythingmd.com/mcp",
      "headers": {
        "Authorization": "Bearer <your ANYTHINGMD_API_KEY>"
      }
    }
  }
}
```

The same snippets are under **Settings → API Keys** with a copy button.

## Try it

Ask your agent:

> Convert [https://www.irs.gov/pub/irs-pdf/fw9.pdf](https://www.irs.gov/pub/irs-pdf/fw9.pdf) to Markdown.

Within about 20 seconds you should see the form as Markdown, plus how many credits it used. If the agent says it has no such tool, or the call fails with an authentication error, see [Troubleshooting](/mcp/troubleshooting.md).

## Not supported yet

Claude.ai, ChatGPT and the Claude desktop app add servers as connectors that sign in through a browser (OAuth). The AnythingMD MCP server uses API keys only, so those apps can't connect yet. Use one of the clients above.

## What it costs

MCP uses the same credits as the website: 15 credits a page, OCR included, with packs from \$5 for 200 pages. Failed and canceled conversions are free. Your agent reports the credits each conversion used. See [Pricing and limits](/pricing-and-limits.md).

## How it works

* **Local files** go straight to storage through a short-lived upload link. The file never passes through the chat. Agents with a terminal upload it themselves; others hand you a browser link to upload it.
* **Long documents** come back a page at a time (about 20,000 tokens each), so one PDF doesn't fill the agent's context. The agent also gets a download link for the whole Markdown file.
* **Five tools** do the work: `convert_to_markdown`, `create_upload`, `get_conversion`, `get_pricing` and `cancel_job`. You don't call them yourself; see the [Tools reference](/mcp/tools.md) if you're building on them.

> **[Troubleshooting](/mcp/troubleshooting.md)**
>
> Key not picked up, uploads, large files, errors.

> **[Tools reference](/mcp/tools.md)**
>
> Arguments and replies, for building on the server.

Pointing an agent at these docs? Give it [docs.anythingmd.com/llms.txt](https://docs.anythingmd.com/llms.txt).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.