anythingllm-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@anythingllm-mcp ask the runbooks workspace how to roll back a deployment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
anythingllm-mcp
Standalone, MIT-licensed Model Context Protocol (MCP) server that exposes an AnythingLLM instance as an MCP server for coding assistants such as Claude Code, Claude Desktop, and Cursor (Mintplex-Labs/anything-llm#5048).
Every tool maps directly to AnythingLLM's verified /api/v1/ developer endpoints (Authorization: Bearer <api_key>) and adds fail-closed workspace ACL scoping (ANYTHINGLLM_ALLOWED_WORKSPACES), slug path-traversal guards, and strict Bearer token redaction.
Tools
Tool | AnythingLLM Endpoint | Annotations | Purpose |
|
|
| List workspaces (filtered to |
|
|
| Inspect workspace configuration, embedded documents, and threads |
|
|
| Query or chat with a workspace ( |
|
|
| Raw vector similarity search returning chunks, metadata, distance, and score without LLM generation |
|
|
| List locally stored documents (supports optional |
Related MCP server: MCPort
Quickstart
1. Create an AnythingLLM Developer API Key
In your AnythingLLM instance, go to Settings -> Tools -> Developer API and generate an API key.
2. Build locally
git clone https://github.com/khoap1220-hue/anythingllm-mcp.git
cd anythingllm-mcp
npm ci
npm run build3. Configure Claude Desktop / Cursor / Claude Code
{
"mcpServers": {
"anythingllm": {
"command": "node",
"args": ["/absolute/path/to/anythingllm-mcp/dist/cli.js"],
"env": {
"ANYTHINGLLM_BASE_URL": "http://localhost:3001",
"ANYTHINGLLM_API_KEY": "your-developer-api-key",
"ANYTHINGLLM_ALLOWED_WORKSPACES": "architecture,runbooks"
}
}
}
}Or run with Docker (non-root node user):
docker build -t anythingllm-mcp .
docker run --rm -i \
-e ANYTHINGLLM_BASE_URL="http://host.docker.internal:3001" \
-e ANYTHINGLLM_API_KEY="your-developer-api-key" \
-e ANYTHINGLLM_ALLOWED_WORKSPACES="architecture,runbooks" \
anythingllm-mcpConfiguration
Environment Variable | Required | Default | Description |
| Yes | — | Developer API key sent via |
| No |
| Base URL of AnythingLLM ( |
| No | (unrestricted) | Comma-separated allowlist of workspace slugs. Enforced before any outbound HTTP call and filters |
| No |
| Outbound HTTP request timeout in ms ( |
Security Hardening
Fail-Closed Workspace ACL (
ANYTHINGLLM_ALLOWED_WORKSPACES): Inspired by multi-tenant workspace scoping (#7164), unauthorized workspace slugs are rejected locally before any network request is made and omitted fromlist_workspacesoutput.SSRF & Path-Traversal Guards:
ANYTHINGLLM_BASE_URLonly permitshttp:/https:with no embedded credentials, query strings, or..segments. Workspace slugs and document folder names are validated against strict character sets beforeencodeURIComponent.Bearer Token Redaction: Raw API keys, URL-encoded keys,
Bearer ...strings, andAuthorization:headers are stripped from all tool errors and stderr diagnostics.
Development
npm ci
npm run lint
npm run typecheck
npm run build
npm testLicense
MIT © 2026 Khoa Phan
Enterprise Support & Custom MCP Integrations
Need a native Streamable HTTP /mcp endpoint, OAuth 2.1 authorization (#6396), or multi-tenant workspace RBAC embedded directly in your AnythingLLM deployment?
Async Engineering & MCP Integration Services: khoaphan.dev/services
Deliverables: Written technical spec, deterministic test suite, clean GitHub PR, and CI verification.
Engagement Style: 100% async written handoff with transparent fixed-scope milestones.
Registry Ready: Includes
server.json(2025-12-11schema) and non-root container build.
Available Tools
5 toolschat_workspaceChat with AnythingLLM WorkspaceB
Execute a workspace RAG chat or strict vector-grounded query (POST /api/v1/workspace/:slug/chat). Supports chat, query, and automatic modes plus optional sessionId partitioning.
Inputs: slug (required), message (required), mode, reset, +1 more.
get_workspaceGet AnythingLLM WorkspaceARead-onlyIdempotent
Fetch metadata, embedded documents, and threads for a workspace by slug (GET /api/v1/workspace/:slug).
Inputs: slug (required).
list_documentsList AnythingLLM DocumentsARead-onlyIdempotent
List locally-stored documents in the AnythingLLM instance (GET /api/v1/documents). Pass optional folder (+ offset/limit) to fetch a single folder with server-side pagination.
Inputs: limit, folder, offset.
list_workspacesList AnythingLLM WorkspacesARead-onlyIdempotent
List workspaces available on the AnythingLLM instance (GET /api/v1/workspaces). When ANYTHINGLLM_ALLOWED_WORKSPACES is set, results are filtered strictly to the configured allowlist.
Inputs: no named parameters.
vector_search_workspaceVector Search AnythingLLM WorkspaceARead-onlyIdempotent
Run raw vector similarity search against embedded chunks in a workspace without LLM generation (POST /api/v1/workspace/:slug/vector-search).
Inputs: slug (required), query (required), topN, scoreThreshold.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
list_workspaces/get_workspace/list_documents are clearly distinct by resource and verb. chat_workspace and vector_search_workspace both target workspace content and could be momentarily confused, but the descriptions explicitly separate LLM-generated RAG chat from raw vector retrieval without generation.
All names are snake_case with a verb-first pattern (list_workspaces, get_workspace, chat_workspace, list_documents). vector_search_workspace deviates slightly by embedding a noun phrase (vector_search) rather than a single verb, but it remains readable and predictable.
Five tools is a tight, focused set covering the core workspace/chat/document interactions without redundancy. It sits at the thin end of the range but each tool earns its place for a RAG querying server.
The surface is read/query-heavy: agents can list, inspect, chat, and vector-search, but there is no way to create/update/delete workspaces, upload or remove documents, or manage threads despite get_workspace exposing thread data. These are notable gaps for a full lifecycle, though the core querying workflow is covered.
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Read-only security guides, sandbox limits, and ownership-gated SPF/DMARC checks for AI-built apps.
Permission checks, human approval cards, and signed audit trails for AI agent tool calls.
Security reviews for coding agents: diffs checked against your org policy and live infrastructure.
Related MCP Servers
- FlicenseAqualityBmaintenanceEnables coding agents to perform workspace-confined file operations, read-only Git inspection, and structured shell commands, while requiring out-of-band human approval for mutations and external executions and maintaining an audit trail.143-
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to safely read, search, understand, and edit local project code and files, with Git inspection, code indexing, and controlled command execution within permissioned workspaces.6MIT
- AlicenseAqualityBmaintenanceEnables coding agents to safely inspect and modify project files within explicitly allowed workspace roots, with controls for file operations, git status/diff, and optionally allowlisted command execution.11Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI coding assistants to inspect local and remote repositories through sandboxed tools that surface project overviews, structure, dependency audits, Git churn hotspots, and a heuristic health score. It also supports safe GitHub issue searching and creation with built-in duplicate preflight checks, while blocking sensitive files, binary content, and path traversal attacks.MIT