Skip to main content
NDI speaks Model Context Protocol, 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

Paste this into the agent’s MCP config. Mint the key on the API keys page; do not commit it.
For another NDI deployment, use its API host: <NDI_BASE_URL>/v1/mcp, with no trailing slash. The server also accepts the key as Authorization: Bearer ndi_sk_.... The hosted server runs remotely, so it cannot see your filesystem. upload_document and upload_file refuse a local path there. Use one of the source options below or run the local server.

Local

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:
opencode — add to opencode.json:
$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: Call get_documentation with the required topic argument, for example {"topic": "extract"}. Supported topics are quickstart, auth, parse, extract, split, classify, ground, upload, workspaces, jobs, and systemone. To decide between automatic_search, qa, je_testing, qa_file, and query_tables for a question, follow Choose the right tool. deep_search and fact_search are deprecated: use qa or automatic_search instead of deep_search, and automatic_search with mode="fact" instead of fact_search. Both keep working until they are retired. start_ledger_understanding measures the ingested journal package; get_ledger_understanding reads the latest report. list_ledger_sources, select_ledger_sources, and get_ledger_selection confirm a source selection; pass the returned selection_id to start and get. Without force, an unchanged package republishes the stored report. A run already in flight returns 409 ledger_understanding_in_progress. A failed tool call returns an error result (isError: true) whose text is Error executing tool <tool>: <code>: <message>, such as Error executing tool list_workspaces: unauthorized: …. A refused request (invalid_request) adds one line per refused field, indented two spaces as - <field>: <message>, up to five, without repeating the values you sent. Some arguments are checked before any call; for example, evaluate_systemone refuses an unknown question type with the validation library’s message. After automatic_search or je_testing succeeds, poll every grounding job id with wait_for_job. For automatic_search, those ids are on result.output when fact search answered (or a stored deep route); for je_testing and the deprecated search tools, on result.grounding_job_ids. When the list is empty or absent, call ground_items explicitly if you need quote locations; deployments may turn off automatic grounding for API searches. An agent answer comes back without Ground jobs: result.output.answer.grounding_job_ids for an automatic_search the agent answered, and result.answer.grounding_job_ids for qa, are null. To locate its quotes, call ground_items on the answer’s evidences, once per cited file: pass workspace_id and the evidence’s source_file_id as file_id, and the file’s quotes as targets ({"id": "<n>", "text": quote}, with "sheet": component for a spreadsheet, where n is the evidence’s 1-based position, up to 30 per call).

Document tool calls

Put source fields directly in the MCP tool’s arguments object. Choose one source per call:
  • upload_id from a staged upload
  • url and file_name for a public document
  • workspace_id and file_id for a workspace file
  • parse_job_id from a successful parse job, supported by parse_document, split_document, extract_data, and ground_items
classify_document accepts the first three sources. The REST API puts these fields in a nested source object. A staged upload uses {"source": {"type": "upload", "upload_id": "…"}} in REST. Each example shows the params of a tools/call request. Use IDs from your own calls.
Pass an inline JSON Schema as json_schema to extract_data, or pass schema_id for a saved schema.
Use ground_items to locate text from the document. Replace the sample targets[].text with an actual quote from your source.

MCP tools and REST routes

Some MCP tool names differ from the REST operation names, and they do not all follow one pattern. The five REST document operations are parse, split, classify, extract, and ground. Three of their MCP tools end in _document: parse_document, split_document, and classify_document. The other two do not. The extract tool is extract_data and the ground tool is ground_items. This catalog has no extract_document and no ground_document. wait_for_job has no route of its own. It reads GET /v1/jobs/{job_id} until the job finishes or its timeout runs out (60 seconds by default). If the job has not finished yet, it returns the job as it stands and you call it again. Every tool and the SDK method it calls is listed in the table under Tools.

Next steps