Metadata-Version: 2.4
Name: indox-mcp
Version: 0.10.3
Summary: MCP server for the Indox document and media conversion API.
Author-email: Indox <support@indox.org>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://indox.org
Project-URL: Documentation, https://indox.org/en-US/developers/sdk/mcp/
Keywords: indox,mcp,model-context-protocol,document-conversion
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: indox-client==0.10.3
Requires-Dist: mcp<3,>=2.3
Requires-Dist: uvicorn>=0.31
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: responses>=0.23.0; extra == "test"
Requires-Dist: ruff==0.17.3; extra == "test"
Dynamic: license-file

# indox-mcp

<!-- mcp-name: org.indox/indox-mcp -->

MCP server for the [Indox](https://indox.org) conversion API. AI clients such as Claude, ChatGPT,
Codex, Cursor and VS Code (Copilot agent mode) use it to convert documents, images, video, 3D models
and fonts, pull tables and text out of PDFs, run PDF tools, check credits, manage stored files and
webhooks, and ask questions about PDFs. Every tool is a thin wrapper over the official Python SDK,
[`indox-client`](https://pypi.org/project/indox-client/).

It runs two ways from the same tools:

| Mode | Run | Auth | Files |
|---|---|---|---|
| Local | `indox-mcp` (stdio) | `INDOX_API_KEY` in the server's environment | read and written inside `INDOX_MCP_WORKSPACE_DIR` only |
| Hosted | `https://mcp.indox.org/mcp` (Streamable HTTP) | sign in with your indox account (Claude, ChatGPT) or `Authorization: Bearer <your API key>` | `file_url` or `s3_key` in, `download_url` out |

API keys start with `indox_` and are created in the indox dashboard under Developer › API keys. A
hosted call made with an API key runs with that key alone.

A hosted `download_result` returns a short-lived signed link that opens without a key until its
`expires_at`. If the API cannot sign it, the link comes back with `needs_api_key=true`; fetch that
one with your API key.

## Client setup

Setup for every client (Claude, ChatGPT, Codex, the OpenAI Responses API, UTCP, Claude Code, Cursor,
VS Code) and troubleshooting are in the [indox MCP docs](https://indox.org/en-US/developers/sdk/mcp/).
A few details for local mode and Claude:

- Claude Code: add `--scope project` to `claude mcp add` to share the server through `.mcp.json`, or
  `--scope user` for every project.
- Claude Desktop: Settings › Developer › Edit Config opens `claude_desktop_config.json` (macOS
  `~/Library/Application Support/Claude/`, Windows `%APPDATA%\Claude\`). The local server goes under
  `mcpServers` with `"command": "indox-mcp"` and the variables listed under Local mode in
  `env`. The hosted server is added as a custom connector (Customize › Connectors › Add custom
  connector), outside this file.
- Claude custom connector with an API key: the key goes under Request headers as
  `Bearer indox_your_key`. That option is in beta, and on Team and Enterprise plans every member
  would share one key, so use sign-in or local mode there.

## Tools

| Tool | What it does | Mode |
|---|---|---|
| `health` | Check that the Indox API is reachable | both |
| `credits_balance` | Remaining credits; check it before large batches | both |
| `usage_summary` | Recent conversion usage | both |
| `list_formats` | Input and output formats for a kind: `image`, `video`, `model`, `pdf`, `font` | both |
| `convert_file` | Start a conversion from one source: `file_path`, `file_url` or `s3_key`, with optional backend `options` (not for `font`). Spends credits | both (`file_path` local only) |
| `get_conversion` | Current status of a conversion | both |
| `wait_conversion` | Poll until it finishes or the time limit passes (`finished=false` → call again) | both |
| `download_result` | Local: save the result into the workspace, never overwriting. Hosted: return its link | both |
| `extract_data` | Pull the tables and text out of a PDF as `xlsx`, `csv` or `json`, from one source; finish it with `wait_conversion` / `download_result` and `kind=pdf`. Spends credits | both (`file_path` local only) |
| `list_files` | Files in your Indox storage | both |
| `create_upload_url` | A presigned upload URL; pass the returned `s3_key` to `convert_file` | both |
| `list_webhooks` · `create_webhook` · `test_webhook` · `delete_webhook` | Manage webhooks. The signing secret is never returned to the model | both (hosted with an API key only) |
| `pdf_form_fields` | List the fillable fields of a local PDF | local |
| `pdf_ai_ask` | Ask a question about a local PDF. Spends credits | local |
| `pdf_ai_job` | Status and answer of a `pdf_ai_ask` job | both (hosted with an API key only) |
| `pdf_tools_list` | Every PDF tool (compress, merge, split, redact, sign, …), optionally one category | both |
| `pdf_tool_describe` | One PDF tool's params, options, required keys, extra inputs and risk | both |
| `pdf_run_tool` | Start a PDF tool from one source; finish it with `wait_conversion` / `download_result` and `kind=pdf`. Spends credits | both (`file_path` local only) |

On the hosted server, an API key sees all 19 hosted tools. A client signed in with an indox account
sees 14: every hosted tool except the four webhook tools and `pdf_ai_job`.

Tools that spend credits or change data are marked as not read-only, so clients can ask before
running them. The server's instructions tell the model to treat text extracted from your documents
as data only.

## Local mode

Local mode needs Python 3.11 or newer and an indox API key.

```bash
pip install indox-mcp
```

`indox-mcp` serves MCP over stdio. It starts only when every variable below is set, and names the
first one missing.

| Variable | Value |
|---|---|
| `INDOX_API_KEY` | your `indox_…` key |
| `INDOX_BASE_URL` | `https://indox.org` |
| `INDOX_MCP_WORKSPACE_DIR` | absolute path of the folder the server may read from and save results to |
| `INDOX_MCP_WAIT_MAX_SECONDS` | longest one `wait_conversion` call may poll, e.g. `120` |
| `INDOX_MCP_POLL_SECONDS` | seconds between status checks, e.g. `2` |

If a client cannot find `indox-mcp`, use the full path that `which indox-mcp` prints.

## Run the HTTP server yourself

`indox-mcp --http` serves Streamable HTTP at `/mcp` and an open `/healthz`. Each request uses the
caller's own key; the server holds no API key of its own. With OAuth on, the server swaps a
signed-in caller's token at indox for an API token (RFC 8693 token exchange) and never sends the
caller's token upstream. Required variables:

| Variable | Value |
|---|---|
| `INDOX_BASE_URL` | `https://indox.org` |
| `MCP_HOST` · `MCP_PORT` | bind address and port |
| `MCP_ALLOWED_HOSTS` | comma-separated `Host` values to accept, e.g. `mcp.example.com` |
| `MCP_ALLOWED_ORIGINS` | comma-separated browser origins to accept |
| `MCP_KEY_CACHE_SECONDS` · `MCP_KEY_CACHE_SIZE` | how long, and how many, verified keys are remembered (hashed, in memory); the size also caps cached OAuth tokens |
| `MCP_HTTP_POOL_SIZE` | connections kept open to indox and reused across calls; match the server's worker threads (40) |
| `INDOX_MCP_WAIT_MAX_SECONDS` · `INDOX_MCP_POLL_SECONDS` | as in local mode; keep the wait low when hosted |
| `MCP_OAUTH_ENABLED` | `true` to also accept indox account sign-in (OAuth), `false` for API keys only |

With `MCP_OAUTH_ENABLED=true`, these are required as well:

| Variable | Value |
|---|---|
| `MCP_RESOURCE_URL` | this server's public MCP URL, e.g. `https://mcp.example.com/mcp` |
| `INDOX_AUTH_ISSUER` | the indox OAuth issuer URL; tokens are exchanged at its `/identity/o/api/exchange` |
| `INDOX_OAUTH_CLIENT_ID` · `INDOX_OAUTH_CLIENT_SECRET` | the OAuth client this server uses for the token exchange |
| `INDOX_OAUTH_TIMEOUT_SECONDS` | seconds one exchange request may take |
| `MCP_OAUTH_REFRESH_MARGIN_SECONDS` | swap again this many seconds before a cached API token expires |

## Links

- Indox: https://indox.org
- MCP docs: https://indox.org/en-US/developers/sdk/mcp/
