AnythingLLM MCP Server
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 Server search for documents about machine learning"
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 Server
A Model Context Protocol (MCP) server that lets MCP-compatible clients (VS Code, Claude Desktop, Cursor, and others) interact with AnythingLLM. Available tools:
Workspace management
Chat and thread operations
Document operations and embeddings
Vector search
System and model inspection
Requirements
Python 3.10+ — verify:
python --versionorpython3 --version. Download if not installed.uv (Python package manager) — verify:
uv --version. Install instructions.AnythingLLM running and reachable — open
http://localhost:3001in a browser to confirm. If it runs in Docker, make sure the port is published (e.g.,-p 3001:3001).AnythingLLM API key — create one in the AnythingLLM web interface (look for API Keys or Developer API in Settings). Copy the key and store it securely; it is shown only once.
Related MCP server: AnythingLLM Control Plane MCP Server
Installation
git clone https://github.com/andreperez/anythingllm-mcp.git
cd anythingllm-mcp
uv syncuv sync reads pyproject.toml and installs all required dependencies into a
local virtual environment. You do not need to create or activate the environment
manually — uv run handles that automatically.
Configuration
The server reads configuration from these environment variables at startup:
ANYTHINGLLM_BASE_URL: Base URL of your AnythingLLM instance. Defaults tohttp://localhost:3001if not set.ANYTHINGLLM_API_KEY: API key for authenticating with AnythingLLM. This value is required.
The server does not load .env files by itself. You must either:
Set the variables in the shell before starting the server.
Use a tool that loads
.envfiles for you.Pass the variables directly in your MCP client configuration.
Option 1: Set variables in your current shell
PowerShell:
$env:ANYTHINGLLM_BASE_URL = "http://localhost:3001"
$env:ANYTHINGLLM_API_KEY = "your_api_key_here"Bash:
export ANYTHINGLLM_BASE_URL="http://localhost:3001"
export ANYTHINGLLM_API_KEY="your_api_key_here"Command Prompt (cmd.exe):
set ANYTHINGLLM_BASE_URL=http://localhost:3001
set ANYTHINGLLM_API_KEY=your_api_key_hereUse the host-exposed URL for your deployment. For Docker port mappings like
3002:3001, set ANYTHINGLLM_BASE_URL to http://localhost:3002 because the
MCP server connects from the host, not from inside the container.
Option 2: Use a .env file with uv
Copy the example file:
PowerShell:
Copy-Item .env.example .envBash:
cp .env.example .envCommand Prompt (cmd.exe):
copy .env.example .envEdit .env so it contains your real values:
ANYTHINGLLM_BASE_URL=http://localhost:3001
ANYTHINGLLM_API_KEY=replace_with_your_real_api_keyThen start the server with:
uv run --env-file .env anythingllm-mcpThis tells uv to load variables from .env before starting the server.
Option 3: Pass variables in your MCP client configuration
Most MCP clients accept an env block in their configuration file (see the
Client setup examples below). When the env block contains
ANYTHINGLLM_API_KEY and ANYTHINGLLM_BASE_URL, you do not need to export
variables in the shell or use a .env file.
Client setup
Replace /path/to/anythingllm-mcp in the examples below with the absolute
path where you cloned the repository. Examples:
Linux / macOS:
/home/youruser/anythingllm-mcpWindows:
C:\\Users\\youruser\\anythingllm-mcp(use double backslashes\\inside JSON strings)
VS Code
Add to your user or workspace mcp.json. Open the Command Palette
(Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS) and run
MCP: Open User Configuration:
{
"servers": {
"anythingllm": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/anythingllm-mcp",
"anythingllm-mcp"
],
"env": {
"ANYTHINGLLM_API_KEY": "${input:anythingllm_api_key}",
"ANYTHINGLLM_BASE_URL": "http://localhost:3001"
}
}
}
}VS Code supports
${input:name}to prompt for the API key on each session.In a multi-root workspace, prefer an absolute path for
--directoryif the MCP server lives outside the current folder root.
If VS Code shows only a partial tool list after you update the server or switch from another AnythingLLM integration to this local one:
Run
MCP: List Serversand confirmanythingllmor your chosen server name starts successfully.Run
MCP: Reset Cached Toolsto clear stale tool metadata.Restart the MCP server from
MCP: List Servers.
Claude Desktop
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"anythingllm": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/anythingllm-mcp",
"anythingllm-mcp"
],
"env": {
"ANYTHINGLLM_API_KEY": "YOUR_API_KEY",
"ANYTHINGLLM_BASE_URL": "http://localhost:3001"
}
}
}
}Cursor
Add to .cursor/mcp.json in your project root, or to the global config at
~/.cursor/mcp.json (Linux/macOS) / %USERPROFILE%\.cursor\mcp.json (Windows):
{
"mcpServers": {
"anythingllm": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/anythingllm-mcp",
"anythingllm-mcp"
],
"env": {
"ANYTHINGLLM_API_KEY": "YOUR_API_KEY",
"ANYTHINGLLM_BASE_URL": "http://localhost:3001"
}
}
}
}Note:
ANYTHINGLLM_BASE_URLdefaults tohttp://localhost:3001, which is the application port inside the container. If you publish Docker as3002:3001, usehttp://localhost:3002in client configuration.
Run (standalone)
If you already exported the variables in your shell:
uv run anythingllm-mcpIf you want to load them from .env at launch time:
uv run --env-file .env anythingllm-mcpDevelopment
Install test dependencies and run the test suite:
uv sync --extra dev
uv run pytestTroubleshooting
"API key is missing" or 401 Unauthorized
The server could not authenticate with AnythingLLM. Check that:
ANYTHINGLLM_API_KEYis set in your environment or in theenvblock of your MCP client configuration.The key matches an active key in AnythingLLM (Settings → API Keys).
The key has no leading or trailing whitespace.
"Connection refused" or timeout
The server could not reach AnythingLLM. Check that:
AnythingLLM is running (open
http://localhost:3001in a browser).ANYTHINGLLM_BASE_URLpoints to the correct host and port.No firewall or VPN is blocking the connection.
Docker port mismatch
If AnythingLLM runs in Docker with a port mapping like 3002:3001:
Inside the container, the application listens on port
3001.On the host, you access it on port
3002.
Because the MCP server runs on the host (not inside the container), set:
ANYTHINGLLM_BASE_URL=http://localhost:3002Always use the host port (the left side of the -p or ports: mapping).
MCP server running inside a container (Dev Containers, Docker Compose)
If the MCP server itself runs inside a container (for example, a
VS Code Dev Container),
localhost refers to that container's own network — not to the host machine.
To reach AnythingLLM running on the host or in another container with a
published port, use host.docker.internal:
ANYTHINGLLM_BASE_URL=http://host.docker.internal:3001If both the MCP server and AnythingLLM are containers on the same Docker
network (for example, in the same docker-compose.yml), use the service
name as hostname instead:
# "anythingllm" is the service name defined in docker-compose.yml
ANYTHINGLLM_BASE_URL=http://anythingllm:3001In this case, use the container port (3001), not the host-published port.
host.docker.internalis supported on Docker Desktop (Windows and macOS) and on Docker Engine 20.10+ for Linux (requires--add-host=host.docker.internal:host-gatewayor the equivalentextra_hostsin Compose).
Security notes
Never commit real API keys.
Use environment variables for secrets.
Use least-privileged AnythingLLM API tokens when possible.
License
MIT
Available Tools
34 toolsanythingllm_chatA
Send a message to a workspace and get a response.
Mode 'chat' uses document context + conversation history. Mode 'query' uses only document context (no history).
Args: slug: Workspace slug message: Message to send mode: 'chat' (context + history) or 'query' (documents only)
Inputs: slug (required), message (required), mode. Returns: result
anythingllm_chat_in_threadB
Send a message within a specific workspace thread.
Args: slug: Workspace slug thread_slug: Thread slug message: Message to send mode: 'chat' or 'query'
Inputs: slug (required), message (required), thread_slug (required), mode. Returns: result
anythingllm_check_authARead-onlyIdempotent
Verify that the API key is valid and AnythingLLM is reachable.
Inputs: no named parameters. Returns: result
anythingllm_create_folderC
Create a new document folder in AnythingLLM.
Args: name: Name for the new folder.
Inputs: name (required). Returns: result
anythingllm_create_threadA
Create a new chat thread within a workspace.
Args: slug: Workspace slug name: Optional thread name
Inputs: slug (required), name. Returns: result
anythingllm_create_workspaceB
Create a new workspace.
Args: name: Name for the new workspace
Inputs: name (required). Returns: result
anythingllm_delete_threadADestructive
Delete a chat thread from a workspace.
Args: slug: Workspace slug thread_slug: Thread slug to delete
Inputs: slug (required), thread_slug (required). Returns: result
anythingllm_delete_workspaceADestructive
Permanently delete a workspace. This action cannot be undone.
Args: slug: Workspace slug to delete
Inputs: slug (required). Returns: result
anythingllm_export_chatsARead-onlyIdempotent
Export all chat logs from all workspaces.
Inputs: no named parameters. Returns: result
anythingllm_get_accepted_file_typesARead-onlyIdempotent
Get the list of file types that AnythingLLM accepts for upload.
Inputs: no named parameters. Returns: result
anythingllm_get_chat_historyARead-onlyIdempotent
Get the chat history for a workspace.
Args: slug: Workspace slug
Inputs: slug (required). Returns: result
anythingllm_get_documentARead-onlyIdempotent
Get metadata and details for a specific document by its stored name.
The doc_name is the internal document identifier returned by list_documents (e.g. 'custom-documents/myfile.pdf-abc123.json').
Args: doc_name: Document name/path as returned by the documents API.
Inputs: doc_name (required). Returns: result
anythingllm_get_document_metadata_schemaARead-onlyIdempotent
Get the metadata schema that AnythingLLM uses for documents.
Inputs: no named parameters. Returns: result
anythingllm_get_system_settingsARead-onlyIdempotent
Get AnythingLLM system settings (LLM provider, vector DB, embeddings, etc.).
Inputs: no named parameters. Returns: result
anythingllm_get_thread_chatsARead-onlyIdempotent
Get chat history for a specific thread in a workspace.
Args: slug: Workspace slug thread_slug: Thread slug
Inputs: slug (required), thread_slug (required). Returns: result
anythingllm_get_vector_countARead-onlyIdempotent
Get the total number of vectors stored in the system.
Inputs: no named parameters. Returns: result
anythingllm_get_workspaceARead-onlyIdempotent
Get detailed information about a specific workspace.
Args: slug: Workspace slug (e.g. 'papers', 'lands')
Inputs: slug (required). Returns: result
anythingllm_list_documentsARead-onlyIdempotent
List all uploaded documents across all folders.
Inputs: no named parameters. Returns: result
anythingllm_list_documents_in_folderARead-onlyIdempotent
List all documents inside a specific folder.
Args: folder_name: Folder name to list documents from.
Inputs: folder_name (required). Returns: result
anythingllm_list_embedsARead-onlyIdempotent
List all embed configurations (public chat widgets).
Inputs: no named parameters. Returns: result
anythingllm_list_modelsARead-onlyIdempotent
List available models via the OpenAI-compatible endpoint.
Inputs: no named parameters. Returns: result
anythingllm_list_workspacesARead-onlyIdempotent
List all workspaces in the AnythingLLM instance with their slugs, settings, and thread info.
Inputs: no named parameters. Returns: result
anythingllm_move_filesA
Move documents between folders.
Each entry in 'files' must have 'from' and 'to' keys with document paths as returned by list_documents (e.g. 'custom-documents/file.pdf-uuid.json').
Args: files: List of move operations, each with 'from' and 'to' path strings. Example: [{"from": "custom-documents/a.pdf-uuid.json", "to": "custom-documents/my-folder/a.pdf-uuid.json"}]
Inputs: files (required). Returns: result
anythingllm_remove_documentsADestructive
Permanently delete one or more documents from the system.
This removes the documents from AnythingLLM storage entirely. They will also be removed from any workspaces that had them embedded.
Args: names: List of document names/paths as returned by list_documents (e.g. ['custom-documents/myfile.pdf-abc123.json']).
Inputs: names (required). Returns: result
anythingllm_remove_folderADestructive
Permanently delete a document folder and all its contents.
Args: name: Folder name to delete.
Inputs: name (required). Returns: result
anythingllm_searchARead-onlyIdempotent
Search for relevant document chunks within a workspace using vector similarity.
Args: slug: Workspace slug to search in query: Search query top_n: Number of results (1-20, default 4) score_threshold: Similarity score threshold (0-1). Lower = more results.
Inputs: slug (required), query (required), top_n, score_threshold. Returns: result
anythingllm_update_embeddingsAIdempotent
Embed or un-embed documents in a workspace (equivalent to "Save and Embed" in the UI).
This is the final step after uploading documents to AnythingLLM storage. Typical workflow:
Upload a file -> upload_file / upload_file_to_folder / upload_link / upload_raw_text
List documents -> list_documents / list_documents_in_folder (get the doc paths)
Embed into workspace -> THIS TOOL with 'adds' containing the doc paths from step 2
Once embedded, the document's content is vectorized and available for RAG queries in the workspace. Removing (via 'deletes') un-embeds the document from the workspace but does NOT delete it from storage.
Args: slug: Workspace slug where documents will be embedded. adds: Document paths to embed, as returned by list_documents (e.g. ['custom-documents/Pine Script/file.pine-abc123.json']). deletes: Document paths to un-embed (remove from workspace only, the file remains in AnythingLLM storage).
Inputs: slug (required), adds, deletes. Returns: result
anythingllm_update_pinAIdempotent
Pin or unpin a document in a workspace.
Pinned documents are always included in the LLM context for every query, regardless of vector similarity results.
Args: slug: Workspace slug. doc_path: Document path as returned by list_documents (e.g. 'custom-documents/myfile.pdf-abc123.json'). pinned: True to pin, False to unpin.
Inputs: slug (required), pinned (required), doc_path (required). Returns: result
anythingllm_update_threadAIdempotent
Update the name of an existing chat thread.
Args: slug: Workspace slug. thread_slug: Thread slug to update. name: New name for the thread.
Inputs: name (required), slug (required), thread_slug (required). Returns: result
anythingllm_update_workspaceAIdempotent
Update workspace settings (name, temperature, prompt, similarity threshold, etc.).
Args: slug: Workspace slug to update name: New workspace name openAiTemp: LLM temperature (0.0-1.0) openAiHistory: Chat history length (0-100) openAiPrompt: System prompt override similarityThreshold: Similarity threshold (0.0-1.0) topN: Top N results for context (1-20) chatMode: Chat mode: 'chat' or 'query'
Inputs: slug (required), name, topN, chatMode, +4 more. Returns: result
anythingllm_upload_fileC
Upload a file from the local filesystem to AnythingLLM.
Args: file_path: Absolute path to the file on the local filesystem.
Inputs: file_path (required). Returns: result
anythingllm_upload_file_to_folderA
Upload a file from the local filesystem into a specific document folder in AnythingLLM.
Args: file_path: Absolute path to the file on the local filesystem. folder_name: Target folder name in AnythingLLM (must already exist).
Inputs: file_path (required), folder_name (required). Returns: result
anythingllm_upload_linkA
Scrape a web page and upload it as a document to AnythingLLM.
Args: link: URL to scrape (must start with http:// or https://)
Inputs: link (required). Returns: result
anythingllm_upload_raw_textA
Upload raw text content as a document to AnythingLLM.
Args: text_content: Raw text content to upload title: Document title
Inputs: title (required), text_content (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
Every tool targets a distinct resource and action. Upload variants differ by input source (file, link, raw text, folder), chat tools differ by thread versus workspace, and list_documents vs list_documents_in_folder are clearly scoped. No two tools appear to do the same thing.
All tool names follow a consistent 'anythingllm_verb_noun' pattern using lower_snake_case. Examples include list_workspaces, create_thread, upload_file, get_vector_count, and remove_documents. The prefix and verb ordering are uniform, making the toolset predictable.
34 tools is well above the rubric's 'too many' threshold of 25. While the server covers a wide range of application features, the sheer volume could overwhelm agents and suggests the surface is not tightly scoped. Many system/settings/export tools could potentially be consolidated.
The toolset provides comprehensive lifecycle coverage for workspaces, threads, documents, folders, embeddings, and chat. It includes auth validation, upload variants, pinning, search, vector counts, export, and embed listing—leaving no obvious gaps in the core AnythingLLM workflow.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Related MCP Servers
- AlicenseCqualityDmaintenanceMCP server for AnythingLLM that enables AI document chat platform interaction with tools for workspaces, chat, documents, threads, and system operations.17MIT
- AlicenseAqualityBmaintenanceEnables managing and controlling AnythingLLM instances through MCP, providing tools to list, create, and delete workspaces, retrieve system environment settings, and get vector counts.51MIT
- AlicenseNot gradedqualityCmaintenanceEnables AnythingLLM to be controlled by any MCP-compatible client via HTTP, SSE, or WebSocket, with automatic workspace selection and background operation.MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to search and ask questions about documents stored in AnythingLLM workspaces through MCP tools.4MIT