Skip to main content
Glama

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

GET /api/v1/workspaces

readOnly, idempotent

List workspaces (filtered to ANYTHINGLLM_ALLOWED_WORKSPACES when configured)

get_workspace

GET /api/v1/workspace/:slug

readOnly, idempotent

Inspect workspace configuration, embedded documents, and threads

chat_workspace

POST /api/v1/workspace/:slug/chat

non-readOnly, non-idempotent

Query or chat with a workspace (mode: query, chat, or automatic, optional sessionId and reset)

vector_search_workspace

POST /api/v1/workspace/:slug/vector-search

readOnly, idempotent

Raw vector similarity search returning chunks, metadata, distance, and score without LLM generation

list_documents

GET /api/v1/documents

readOnly, idempotent

List locally stored documents (supports optional ?folder=, offset, and limit)

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 build

3. 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-mcp

Configuration

Environment Variable

Required

Default

Description

ANYTHINGLLM_API_KEY

Yes

—

Developer API key sent via Authorization: Bearer <key>

ANYTHINGLLM_BASE_URL

No

http://localhost:3001

Base URL of AnythingLLM (http:// or https://, credentials in URL rejected)

ANYTHINGLLM_ALLOWED_WORKSPACES

No

(unrestricted)

Comma-separated allowlist of workspace slugs. Enforced before any outbound HTTP call and filters list_workspaces. Setting it to "" fails closed (blocks all workspaces).

ANYTHINGLLM_TIMEOUT_MS

No

30000

Outbound HTTP request timeout in ms (1000–300000)

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 from list_workspaces output.

  • SSRF & Path-Traversal Guards: ANYTHINGLLM_BASE_URL only permits http: / https: with no embedded credentials, query strings, or .. segments. Workspace slugs and document folder names are validated against strict character sets before encodeURIComponent.

  • Bearer Token Redaction: Raw API keys, URL-encoded keys, Bearer ... strings, and Authorization: headers are stripped from all tool errors and stderr diagnostics.

Development

npm ci
npm run lint
npm run typecheck
npm run build
npm test

License

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-11 schema) and non-root container build.

Available Tools

5 tools
chat_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 WorkspaceA
Read-onlyIdempotent

Fetch metadata, embedded documents, and threads for a workspace by slug (GET /api/v1/workspace/:slug).

Inputs: slug (required).

list_documentsList AnythingLLM DocumentsA
Read-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 WorkspacesA
Read-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 WorkspaceA
Read-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

    A3.6/5.0

    Scored across 5 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness3/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      B
      maintenance
      Enables 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.
      14
      3
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      6
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      11
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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