This is a fixed fork of raqueljezweb/anythingllm-mcp-server Original package has broken API endpoints. This fork fixes them.
An MCP (Model Context Protocol) server that enables seamless integration between AnythingLLM and MCP-compatible clients like Claude Code, Claude Desktop, and more.
Add this to ~/.claude.json (or %USERPROFILE%\.claude.json on Windows):
{
"mcpServers": {
"anythingllm": {
"type": "stdio",
"command": "node",
"args": ["C:/path/to/anythingllm-mcp-server-fork/src/index.js"],
"env": {
"ANYTHINGLLM_API_KEY": "YOUR-API-KEY-HERE",
"ANYTHINGLLM_BASE_URL": "http://localhost:3001"
}
}
}
}- Open AnythingLLM → Settings → API Keys
- Create a new API key
- Copy it to the config above
The MCP server will auto-initialize with the env variables.
IMPORTANT: This section is for AI assistants using this MCP server.
Before any operation, you MUST initialize the client:
mcp__anythingllm__initialize_anythingllm
apiKey: "YOUR-API-KEY"
baseUrl: "http://localhost:3001"
If env variables are set, initialization happens automatically.
mcp__anythingllm__create_workspace
name: "my-knowledge-base"
mcp__anythingllm__embed_text
slug: "my-knowledge-base"
texts: ["Document content here...", "Another document..."]
mcp__anythingllm__chat_with_workspace
slug: "my-knowledge-base"
message: "What does the documentation say about X?"
mode: "query" # Use "query" for RAG, "chat" for conversation
| Tool | Purpose | Key Parameters |
|---|---|---|
initialize_anythingllm |
REQUIRED FIRST | apiKey, baseUrl |
list_workspaces |
List all workspaces | - |
get_workspace |
Get workspace details + documents | slug |
create_workspace |
Create new workspace | name |
update_workspace |
Update workspace settings | slug, updates |
delete_workspace |
Delete workspace | slug |
embed_text |
Add text to RAG | slug, texts[] |
embed_webpage |
Scrape & add webpage | slug, url |
list_documents |
List docs in workspace | slug |
delete_document |
Remove document | slug, documentId |
chat_with_workspace |
Query RAG / Chat | slug, message, mode |
search_workspace |
Vector similarity search | slug, query |
get_chat_history |
Get conversation history | slug |
# 1. Create workspace
create_workspace(name="docs")
# 2. For each page, scrape with Crawl4AI then embed
# (Use mcp__crawl4ai__md to get markdown, then embed_text)
embed_text(slug="docs", texts=[markdown_content])
# 3. Query
chat_with_workspace(slug="docs", message="How do I...", mode="query")# 1. List documents to get docId
list_documents(slug="my-workspace")
# Returns: documents[].docId like "79d25253-a860-4c30-95ab-48d13dd4fd04"
# 2. Delete using docId
delete_document(slug="my-workspace", documentId="79d25253-a860-4c30-95ab-48d13dd4fd04")# AnythingLLM doesn't have "clear all docs" - delete and recreate
delete_workspace(slug="old-workspace")
create_workspace(name="old-workspace") # Fresh start- Always initialize first - Every new session needs
initialize_anythingllm - Use
mode: "query"for RAG - This retrieves relevant documents.mode: "chat"doesn't use RAG. list_documentsreturns docId - Use this UUID fordelete_document- No clear chat history API - Workaround: delete and recreate workspace
- Slugs are auto-generated - When you create "My Workspace", slug becomes "my-workspace"
| Bug | Original Behavior | Fixed Behavior |
|---|---|---|
list_documents |
Returns empty array [] |
Returns actual documents |
delete_document |
Doesn't delete (wrong API) | Works with docId/filename/docpath |
delete_workspace |
JSON parse error on "OK" | Returns {success: true} |
workspace.workspace |
Assumed object | Handles both array and object |
| Multiple endpoints | Wrong paths | Correct AnythingLLM v1 API paths |
See Issue #1 on original repo.
git clone https://github.com/Tapiocapioca/anythingllm-mcp-server.git
cd anythingllm-mcp-server
npm install# NOT RECOMMENDED - original package has broken endpoints
npm install -g anythingllm-mcp-server{
"mcpServers": {
"anythingllm": {
"type": "stdio",
"command": "node",
"args": ["C:/AI/TestVari/anythingllm-mcp-server-fork/src/index.js"],
"env": {
"ANYTHINGLLM_API_KEY": "XXXXX-XXXXXX-XXXXXX-XXXXXXX",
"ANYTHINGLLM_BASE_URL": "http://localhost:3001"
}
}
}
}macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"anythingllm": {
"command": "node",
"args": ["/path/to/anythingllm-mcp-server-fork/src/index.js"],
"env": {
"ANYTHINGLLM_API_KEY": "your-key",
"ANYTHINGLLM_BASE_URL": "http://localhost:3001"
}
}
}
}→ Call initialize_anythingllm with your API key first
→ Use list_workspaces to see available slugs
→ Use get_workspace instead of list_documents (more reliable)
→ Ensure AnythingLLM is running on port 3001
- Never commit API keys to version control
- Use environment variables for credentials
- API keys can be regenerated in AnythingLLM settings
- Original: raqueljezweb/anythingllm-mcp-server
- Fixes: Tapiocapioca/anythingllm-mcp-server
- AnythingLLM by Mintplex Labs
- Model Context Protocol by Anthropic