anythingllm-mcp-server

raqueljezweb/anythingllm-mcp-server

3.2

If you are the rightful owner of anythingllm-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The AnythingLLM MCP Server facilitates integration between AnythingLLM and MCP-compatible clients, enabling seamless communication and management of workspaces, documents, and system settings.

Tools
11
Resources
0
Prompts
0

AnythingLLM MCP Server

An MCP (Model Context Protocol) server that enables seamless integration between AnythingLLM and MCP-compatible clients like TypingMind, Claude Desktop, and more.

Features

  • 🚀 Complete AnythingLLM API Integration: Access all AnythingLLM features through MCP
  • 💬 Workspace Management: Create, update, delete, list workspaces and manage their settings
  • 🤖 Chat Integration: Send messages, manage chat history, and stream responses
  • 📄 Document Management: Upload, list, delete documents, process URLs, and manage vectors
  • 🔍 Embedding & Search: Embed text/webpages and search within workspaces
  • 👥 User Management: Create, update, delete users and manage permissions
  • 🔑 API Key Management: Programmatically manage API keys
  • ⚙️ System Administration: Configure LLM providers, vector databases, and system settings
  • 🤖 Agent Support: Create and manage AI agents with custom prompts and tools
  • 📊 System Monitoring: Access system information and statistics
  • 🔐 Secure Authentication: API key-based authentication with environment variable support

Prerequisites

  • Node.js 18+ installed
  • AnythingLLM instance running with API access enabled
  • AnythingLLM API key (obtain from your AnythingLLM instance at /settings/api-keys)

Installation

Option 1: Using npx (Recommended)

No installation needed! You can run the server directly with npx when configuring your MCP client.

Option 2: Global Installation

npm install -g anythingllm-mcp-server

Option 3: Local Installation

git clone https://github.com/yourusername/anythingllm-mcp-server.git
cd anythingllm-mcp-server
npm install

Configuration

For TypingMind.com

Setup Instructions
  1. Go to TypingMind.com

  2. Click on SettingsMCP Servers

  3. In the MCP configuration editor, add the AnythingLLM server:

    {
     "mcpServers": {
       "anythingllm": {
         "command": "npx",
         "args": ["-y", "anythingllm-mcp-server@2.0.0"]
        }
      }
    }
    
  4. Click Save - TypingMind will restart the MCP servers

  5. Look for the "Connected" status

First Time Usage

After the server connects, initialize it with your AnythingLLM credentials:

  1. In the chat, type:

    Use the initialize_anythingllm tool with apiKey: "your-api-key" and baseUrl: "http://localhost:3001"
    
  2. Replace:

    • "your-api-key" with your AnythingLLM API key (get it from AnythingLLM → Settings → API Keys)
    • "http://localhost:3001" with your AnythingLLM instance URL
  3. You'll see: "AnythingLLM client initialized successfully"

Example Commands

After initialization, use natural language to interact with AnythingLLM:

  • "List all my workspaces"
  • "Create a new workspace called 'Project Documentation'"
  • "Chat with the 'research' workspace about the latest findings"
  • "Show me all documents in the 'knowledge-base' workspace"

TypingMind will automatically use the appropriate AnythingLLM tools.

For Claude Desktop

Add to your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "anythingllm": {
      "command": "npx",
      "args": ["-y", "anythingllm-mcp-server@1.0.3"]
    }
  }
}

Initialization

When first using the server in your MCP client, you'll need to initialize it with your AnythingLLM credentials by calling the initialize_anythingllm tool:

Use the initialize_anythingllm tool with apiKey: "your-api-key" and baseUrl: "http://localhost:3001"
  • apiKey: Get this from your AnythingLLM instance at /settings/api-keys
  • baseUrl: Your AnythingLLM instance URL (default: http://localhost:3001)

You can also set these as environment variables:

  • ANYTHINGLLM_API_KEY: Your API key
  • ANYTHINGLLM_BASE_URL: Your instance URL

Available Tools

Initialization

ToolDescriptionParameters
initialize_anythingllmInitialize the AnythingLLM client with API credentialsapiKey (string), baseUrl (optional string)

Workspace Management

ToolDescriptionParameters
list_workspacesGet all workspacesNone
get_workspaceGet details of a specific workspaceslug (string)
create_workspaceCreate a new workspacename (string)
update_workspaceUpdate workspace settingsslug (string), updates (object)
delete_workspaceRemove a workspaceslug (string)
get_workspace_settingsGet settings for a specific workspaceslug (string)
update_workspace_settingsUpdate workspace-specific settingsslug (string), settings (object)

Chat Operations

ToolDescriptionParameters
chat_with_workspaceSend messages to a workspaceslug (string), message (string), mode (optional: "chat" or "query")
get_chat_historyGet chat history for a workspaceslug (string), limit (optional number)
clear_chat_historyClear all chat history for a workspaceslug (string)

Document Management

ToolDescriptionParameters
list_documentsView all documents in a workspaceslug (string)
delete_documentRemove a document from a workspaceslug (string), documentId (string)
process_document_urlProcess a document from a URLslug (string), url (string)
get_document_vectorsGet vector embeddings for a documentslug (string), documentId (string)

Embedding & Search

ToolDescriptionParameters
embed_textEmbed text directly into a workspaceslug (string), texts (array of strings)
embed_webpageEmbed a webpage into a workspaceslug (string), url (string)
search_workspaceSearch within a workspaceslug (string), query (string), limit (optional number)

User Management

ToolDescriptionParameters
list_usersList all users in the systemNone
create_userCreate a new userusername (string), password (string), role (optional string)
update_userUpdate an existing useruserId (string), updates (object)
delete_userDelete a useruserId (string)

API Key Management

ToolDescriptionParameters
list_api_keysList all API keysNone
create_api_keyCreate a new API keyname (string)
delete_api_keyDelete an API keykeyId (string)

System Administration

ToolDescriptionParameters
get_system_settingsView system configurationNone
update_system_settingsModify system settingssettings (object)
get_system_infoGet general system informationNone
get_system_statsGet system statisticsNone

LLM Provider Management

ToolDescriptionParameters
list_llm_providersList available LLM providersNone
update_llm_providerUpdate LLM provider configurationprovider (string), apiKey (optional string), model (optional string)

Vector Database Management

ToolDescriptionParameters
get_vector_database_infoGet vector database configurationNone
update_vector_databaseUpdate vector database configurationprovider (string), config (object)

Agent Management

ToolDescriptionParameters
list_agentsList all available agentsNone
create_agentCreate a new agentname (string), systemPrompt (optional string), tools (optional array)
update_agentUpdate an existing agentagentId (string), updates (object)
delete_agentDelete an agentagentId (string)
invoke_agentInvoke an agent with inputagentId (string), input (string)

Usage Examples

Once configured, you can interact with AnythingLLM through your MCP client:

List all workspaces

"Use the list_workspaces tool to show me all available workspaces"

Create a new workspace

"Create a new workspace called 'Project Documentation' using the create_workspace tool"

Chat with a workspace

"Use chat_with_workspace to ask the 'research' workspace: What are the key findings from the latest report?"

Manage documents

"List all documents in the 'knowledge-base' workspace"
"Delete document with ID 'doc123' from the 'archive' workspace"

API Reference

This MCP server connects to the following AnythingLLM API endpoints:

  • /api/v1/workspaces - Workspace operations
  • /api/v1/workspace/{slug}/chat - Chat functionality
  • /api/v1/workspace/{slug}/documents - Document management
  • /api/v1/system/settings - System configuration

For complete API documentation, visit /api/docs on your AnythingLLM instance.

Troubleshooting

Connection Issues

  • ✅ Ensure your AnythingLLM instance is running and accessible
  • ✅ Verify the API key has proper permissions
  • ✅ Check that the base URL is correct (include http/https)
  • ✅ Make sure the AnythingLLM API is enabled in your instance

API Errors

  • Most errors will include descriptive messages
  • Check AnythingLLM logs for detailed error information
  • Ensure your API key hasn't expired
  • Verify workspace slugs are correct when accessing specific workspaces

Common Issues

"Client not initialized" error:

  • Make sure you've initialized the server with your API key and base URL

"Workspace not found" error:

  • Check that the workspace slug is correct
  • Use list_workspaces to see available workspaces

Connection refused:

  • Verify AnythingLLM is running on the specified port
  • Check firewall settings

Security Notes

  • 🔐 Keep your API key secure and never commit it to version control
  • 🔒 Use environment variables for sensitive configuration in production
  • 🛡️ Restrict API key permissions to only what's needed
  • ⚠️ Never share your API key publicly

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the file for details.

Support

Acknowledgments


Made with ❤️ for the AnythingLLM community