Package Exports
- anythingllm-mcp-server
- anythingllm-mcp-server/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (anythingllm-mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
- 🚀 Full AnythingLLM API Integration: Access all major AnythingLLM features through MCP
- 💬 Workspace Management: Create, update, delete, and list workspaces
- 🤖 Chat Integration: Send messages to workspaces and receive AI responses
- 📄 Document Management: List and delete documents in workspaces
- ⚙️ System Settings: View and update AnythingLLM system configuration
- 🔐 Secure Authentication: API key-based authentication
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
In TypingMind, go to Settings → MCP Servers
Click "Add Server"
Configure using one of these options:
Using npx (no installation required):
{ "name": "AnythingLLM", "command": "npx", "args": ["-y", "anythingllm-mcp-server"] }
Using global installation:
{ "name": "AnythingLLM", "command": "anythingllm-mcp-server", "args": [] }
Using local installation:
{ "name": "AnythingLLM", "command": "node", "args": ["/path/to/anythingllm-mcp-server/src/index.js"] }
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": ["anythingllm-mcp-server"]
}
}
}
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 keyANYTHINGLLM_BASE_URL
: Your instance URL
Available Tools
Initialization
Tool | Description | Parameters |
---|---|---|
initialize_anythingllm |
Initialize the AnythingLLM client with API credentials | apiKey (string), baseUrl (optional string) |
Workspace Management
Tool | Description | Parameters |
---|---|---|
list_workspaces |
Get all workspaces | None |
get_workspace |
Get details of a specific workspace | slug (string) |
create_workspace |
Create a new workspace | name (string) |
update_workspace |
Update workspace settings | slug (string), updates (object) |
delete_workspace |
Remove a workspace | slug (string) |
Chat Operations
Tool | Description | Parameters |
---|---|---|
chat_with_workspace |
Send messages to a workspace | slug (string), message (string), mode (optional: "chat" or "query") |
Document Management
Tool | Description | Parameters |
---|---|---|
list_documents |
View all documents in a workspace | slug (string) |
delete_document |
Remove a document from a workspace | slug (string), documentId (string) |
System Administration
Tool | Description | Parameters |
---|---|---|
get_system_settings |
View system configuration | None |
update_system_settings |
Modify system settings | settings (object) |
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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 🐛 Issues: GitHub Issues
- 📖 AnythingLLM Docs: docs.useanything.com
- 💬 AnythingLLM Community: Discord
Acknowledgments
- AnythingLLM by Mintplex Labs
- Model Context Protocol by Anthropic
- TypingMind for MCP support
Made with ❤️ for the AnythingLLM community