DocuMind

MCP Server

DocuMind as tools for AI clients: search, ask, ingest, and context management with guardrails baked in.

Setup & Run

MCP is how external assistants talk to DocuMind without custom glue code. Give the assistant tools, not guesses — it behaves way better.

If you want copy-paste prompts and the full DCLI SKILL.md template for agents, use Agent Integration.

1

Run backend API

cd documind/backend && uvicorn app.main:app --reload --port 8000

MCP service calls the API under the hood, so backend must be up.

2

Start MCP server

cd documind/backend && ./run_mcp_server.sh

This launches `mcp_server.server` with `DOCUMIND_API_URL` defaulting to localhost.

3

Verify via CLI

cd documind/backend && ./run_documind_cli.sh context-show --bot=true

Quick sanity check that context and API connectivity are healthy.

Available Tools

fn
search_docs

Fast factual lookup from indexed docs; uses active context when ids are omitted.

fn
ask_docs

Synthesize grounded answers with sources using retrieved chunks.

fn
ingest_text

Ingest plain text or markdown into the selected namespace.

fn
list_knowledge_bases

List available knowledge bases, optionally scoped to one instance.

fn
list_instances

List available instances for context selection.

fn
create_instance

Create a new instance for setup.

Requires confirm_create=true
fn
list_namespaces

List namespaces in an instance or current context.

fn
get_active_context

Return current default context (instance_id + namespace_id).

fn
set_active_context

Persist active context for later calls.

Unknown namespace requires allow flag

Guardrails

We intentionally added friction for risky operations. Yes, one extra confirmation is slower. Also yes, it prevents weird accidental state changes at 1:47AM.

create_instance confirmation

`create_instance` requires explicit `confirm_create=true`. The server refuses silent instance creation.

Unknown namespace protection

`set_active_context` checks known namespaces first. Unknown values require the explicit `allow_unknown_namespace=true` flag.

Integration Notes

Tool usage strategy

In prompt instructions, prefer `search_docs` for factual lookups and `ask_docs` for synthesis. That one small rule improves response quality more than people expect.

Server runtime helper
cd documind/backend && ./run_mcp_server.sh