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.
Run backend API
cd documind/backend && uvicorn app.main:app --reload --port 8000MCP service calls the API under the hood, so backend must be up.
Start MCP server
cd documind/backend && ./run_mcp_server.shThis launches `mcp_server.server` with `DOCUMIND_API_URL` defaulting to localhost.
Verify via CLI
cd documind/backend && ./run_documind_cli.sh context-show --bot=trueQuick sanity check that context and API connectivity are healthy.
Available Tools
search_docsFast factual lookup from indexed docs; uses active context when ids are omitted.
ask_docsSynthesize grounded answers with sources using retrieved chunks.
ingest_textIngest plain text or markdown into the selected namespace.
list_knowledge_basesList available knowledge bases, optionally scoped to one instance.
list_instancesList available instances for context selection.
create_instanceCreate a new instance for setup.
list_namespacesList namespaces in an instance or current context.
get_active_contextReturn current default context (instance_id + namespace_id).
set_active_contextPersist active context for later calls.
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.
cd documind/backend && ./run_mcp_server.sh