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

# MCP

> Use NDI from Claude Code, Cursor, Codex, or opencode

NDI speaks [Model Context Protocol](https://modelcontextprotocol.io), so an agent can call parse, extract, search, and the rest as tools. Hosted and local servers expose the same catalog.

Prefer `uvx ndi-mcp` (or `pip install ndi-mcp`). The older `ndi-sdk[mcp]` extra still resolves to that package.

|                       | Hosted (`https://ndi-api.nace.ai/v1/mcp`)     | Local (`uvx ndi-mcp`)                |
| --------------------- | --------------------------------------------- | ------------------------------------ |
| Install               | none                                          | Python 3.11+, `uvx`                  |
| Auth                  | `X-API-Key` or `Authorization: Bearer` header | `ndi-mcp login`, or `$NDI_API_KEY`   |
| Files on your machine | public URLs only                              | uploaded straight from disk          |
| Best for              | quick setup, shared and CI agents             | coding agents working on local files |

***

## Hosted

Paste this into the agent's MCP config. Mint the key on the API keys page; do not commit it.

```json theme={"dark"}
{
  "mcpServers": {
    "ndi": {
      "type": "http",
      "url": "https://ndi-api.nace.ai/v1/mcp",
      "headers": { "X-API-Key": "ndi_sk_..." }
    }
  }
}
```

The hosted server runs in our cloud, so it cannot see your filesystem. `upload_document` and `upload_file` refuse a local path there. Pass a public URL, or run the local server.

***

## Local

```bash theme={"dark"}
uvx ndi-mcp login
claude mcp add ndi -- uvx ndi-mcp
```

`ndi-mcp login` opens the NDI console in your browser. Approve there; the CLI stores the minted key in `~/.ndi/config.toml`. Pass `--api-key` (or set `$NDI_API_KEY`) to skip the browser.

Cursor — add to `.cursor/mcp.json`:

```json theme={"dark"}
{
  "mcpServers": {
    "ndi": {
      "command": "uvx",
      "args": ["ndi-mcp"]
    }
  }
}
```

opencode — add to `opencode.json`:

```json theme={"dark"}
{
  "mcp": {
    "ndi": {
      "type": "local",
      "command": ["uvx", "ndi-mcp"]
    }
  }
}
```

`$NDI_API_KEY` is read first; otherwise the key saved by `ndi-mcp login`. Local files go through `upload_document`, then `parse_document` / `extract_data` with the returned `upload_id`.

***

## Tools

Same catalog on hosted and local. Names map to the Python SDK:

| MCP tool                                 | SDK                                                |
| ---------------------------------------- | -------------------------------------------------- |
| `upload_document`                        | `client.documents.create_upload`                   |
| `parse_document`                         | `client.documents.parse`                           |
| `split_document`                         | `client.documents.split`                           |
| `classify_document`                      | `client.documents.classify`                        |
| `extract_data`                           | `client.documents.extract`                         |
| `ground_items`                           | `client.documents.ground`                          |
| `create_workspace`                       | `client.workspaces.create`                         |
| `upload_file` / `upload_and_ingest_file` | `client.files.upload` / `client.upload_and_ingest` |
| `ingest_workspace`                       | `client.ingestion.ingest`                          |
| `hybrid_search`                          | `client.tools.hybrid_search`                       |
| `qa_file`                                | `client.tools.qa_file`                             |
| `query_tables`                           | `client.tools.query_tables`                        |

Ask `get_documentation` with a topic (`parse`, `extract`, `auth`, `workspaces`, …) before writing integration code.

***

## Next steps

* [Authentication](/authentication)
* [Python SDK](/sdks/python)
* [TypeScript SDK](/sdks/typescript)
