AI & LLM Tools

AnythingLLM MCP Servers: Setup & Best Practices

J
James Eriksson
··12 min read
Add MCP servers to AnythingLLM agents for web scraping, Git, file operations, and more. Complete setup guide for Desktop, Docker, and managed hosting.
TL;DR
  • MCP servers extend AnythingLLM agents with tools like web scraping, Git commits, file operations, and persistent memory
  • MCP requires self-hosted AnythingLLM (Desktop or Docker); it is not available in AnythingLLM Cloud
  • Configuration is simple: add a server entry to anythingllm_mcp_servers.json, reload, and test in Agent Skills
  • Start with Fetch or Git; the ecosystem has 20,405+ community-built servers for specialized use cases
  • Common issues (LLM not calling server) usually stem from model size, missing reload, or unclear prompts

MCP servers give AnythingLLM agents the ability to act on external data: web scraping, Git commits, file operations, knowledge graphs. But MCP requires self-hosting -- it's unavailable in AnythingLLM Cloud. This guide shows you how to add MCP servers to AnythingLLM Desktop or Docker, which servers solve which problems, and how to debug when your agent isn't calling your tools.

What Is an MCP Server? Why You'd Want One in AnythingLLM

MCP (Model Context Protocol) is a standard for connecting AI agents to external tools and data sources. Without MCP, your AnythingLLM agent can only use built-in skills like web search, memory, or file read. MCP lets you add hundreds of specialized tools: fetch web pages, query databases, write to Git repos, manage files, build knowledge graphs.

Think of it this way. Your agent gets a prompt: "Research company X and commit findings to my GitHub." Without MCP, it's stuck -- no native GitHub tool. With MCP, you've added a Git server. The agent sees it, requests it, and deploys your automation. That's the power of MCP in AnythingLLM.

The AnythingLLM MCP ecosystem now has 20,405 community-built servers. You'll use maybe 5 to 10 regularly. This guide covers the five most valuable: Fetch (web scraping), Git (code context), Filesystem (safe file ops), Memory (persistent knowledge), and Sequential Thinking (better reasoning). AnythingLLM version 1.19.0 ships with full MCP compatibility, added back in v1.8.0. The protocol itself is open-source, maintained by Anthropic and the Linux Foundation.

Built-in skills cover common tasks. MCP servers cover everything else. If your agent needs to integrate with an external system -- a spreadsheet, a database, an API, a Git repo -- MCP is how you do it.

Desktop vs. Docker vs. Cloud: Where MCP Works

MCP requires self-hosted AnythingLLM. It is NOT available in AnythingLLM Cloud. This is the first decision you need to make.

Why? AnythingLLM Cloud is multi-tenant SaaS. Sandboxing arbitrary MCP servers from other users' workspaces is complex and risky. Self-hosted deployments (Desktop or Docker) give you full control: you decide what servers run, how they're configured, what data they access.

Here's the breakdown:

DeploymentMCP SupportUse CaseSetup Time
AnythingLLM Desktop (Windows, Mac, Linux)YesLocal dev, testing agents5 min
AnythingLLM Docker (self-hosted)YesProduction, custom servers, team deployments20 min
AnythingLLM Cloud (managed SaaS)NoMulti-user, no ops, no MCPN/A

If you need MCP and want to avoid Docker ops, managed AnythingLLM hosting offers a middle ground. You get the full self-hosted stack, pre-configured on EU infrastructure with automatic backups and GDPR compliance. You configure and run MCP servers yourself, just without the overhead of managing Docker containers, databases, or reverse proxies.

How MCP Servers Connect: Transport Types Explained

MCP servers can connect via three protocols. You need to know which one you're configuring.

StdIO (local commands). The default. Your MCP server is a command-line tool: npx, uv, node, or bash. AnythingLLM spawns a subprocess, feeds it requests via stdin, reads responses via stdout. StdIO is fast, simple, and runs anywhere you can execute commands. Example: npx @modelcontextprotocol/server-fetch. No network calls, no authentication setup.

SSE (Server-Sent Events). For remote HTTP servers. Your MCP server runs on a URL. AnythingLLM sends requests over HTTP, gets streamed responses. Best for: cloud-hosted MCP servers, multi-workspace setups, servers owned by third parties. Requires authentication headers (API key, OAuth token).

Streamable. A variant of SSE for long-lived connections. Used when you need persistent subscriptions to remote data. Rarer than StdIO or SSE.

For 90% of use cases, you'll use StdIO. If you're using a cloud MCP server (e.g., ClickHouse's MCP server hosted on their platform), you'll use SSE. Desktop and Docker both support all three.

Setting Up Your First MCP Server: Step-by-Step

Step 1: Locate the config file.

On Desktop, find anythingllm_mcp_servers.json:

  • Windows: C:\Users\<username>\AppData\Local\anythingllm\app.asar.unpacked\resources\anythingllm_mcp_servers.json
  • Mac: ~/Library/Application Support/anythingllm/anythingllm_mcp_servers.json
  • Linux: ~/.anythingllm/anythingllm_mcp_servers.json

On Docker, mount the config file in your docker-compose.yml or bind mount, then exec into the container to edit it: docker exec anythingllm vi /root/.anythingllm/anythingllm_mcp_servers.json

Step 2: Add an MCP server entry.

Open the config file. It's a JSON array. Add an entry. Example: Fetch server for web scraping.

{
  "mcp_servers": [
    {
      "name": "fetch",
      "command": "npx",
      "arguments": ["@modelcontextprotocol/server-fetch"]
    }
  ]
}

Save the file. That's it. You've declared an MCP server.

Step 3: Reload in the UI.

Open AnythingLLM. Go to Settings > Agent Skills. You should see "fetch" listed as an available skill with a green status. If it shows red or missing, check the logs (Desktop: Help > Logs; Docker: docker logs anythingllm).

Step 4: Test in an agent.

Create or open an agent. In the prompt, reference the tool: "Fetch https://example.com and summarize it." The agent will call the Fetch MCP server, get the HTML, and return a summary.

That's the full cycle. Once this works, you can add more servers. Most people start with Fetch or Git, test them, then expand.

Top 5 MCP Servers to Start With: Real Use Cases

1. Fetch -- Web scraping and content retrieval.

Installs via: npx @modelcontextprotocol/server-fetch

Why: Agents often need to pull live data from the web. Fetch gives them a safe, read-only tool. Use cases: competitive research, news monitoring, API documentation scraping, contract discovery.

Example: "Research our top 3 competitors' pricing pages and email me a comparison." Your agent uses Fetch to pull each page, extracts prices, summarizes differences.

2. Git -- Repository context and commits.

Installs via: npx @modelcontextprotocol/server-git

Why: Agents working on code need Git context. This server lets them read repo history, search commits, even make commits. Use cases: automated code documentation, AI-assisted code review, bug triage via commit history.

Example: "Check the Git log for any changes to auth.ts in the last week." Your agent queries the repo, finds relevant commits, explains what changed and why.

3. Filesystem -- Safe file read/write.

Installs via: npx @modelcontextprotocol/server-filesystem

Why: Agents need to save reports, read config files, organize outputs. Filesystem MCP sandboxes file access to a directory you specify. Use cases: document generation, log analysis, data export.

Example: "Read all.log files in /var/log, summarize errors, write a report to ~/reports/." Your agent reads, processes, writes.

4. Memory -- Persistent knowledge graph.

Installs via: npm @modelcontextprotocol/server-memory

Why: Agents forget between sessions. Memory MCP gives them a persistent note-taking tool. They can store facts, relationships, context. Use cases: personal AI assistants, chatbots with long-term memory, knowledge management.

Example: "Remember that my CFO is Jane Smith and the budget cap is 500k." Your agent stores it. Later: "What's the budget cap?" Agent retrieves and answers from memory.

5. Sequential Thinking -- Better reasoning.

Installs via: npm @modelcontextprotocol/server-sequential-thinking

Why: For complex problems, agents benefit from breaking steps down. This server gives agents a "think aloud" tool. They reason through problems step-by-step, reducing hallucinations. Use cases: math problems, multi-step analysis, debugging.

Example: "Debug this JavaScript error." Agent thinks through the error stack, checks the code, narrates the problem, suggests fixes.

Start with one server. Test it. Add another. Don't load all 20,405 servers at once -- each adds overhead on startup.

Configuring Advanced MCP Features

Environment Variables.

Some MCP servers need API keys or credentials. Pass them via the config:

{
  "name": "my_server",
  "command": "npx",
  "arguments": ["@company/server-custom"],
  "env": {
    "API_KEY": "sk-...",
    "DATABASE_URL": "postgresql://..."
  }
}

AnythingLLM will inject these into the MCP server subprocess. The server reads them from the environment. Do not hardcode secrets in the config file.

Autostart Prevention.

By default, all configured MCP servers start when AnythingLLM boots. If you have 10 servers, that's 10 extra processes. To disable autostart for a server and load it on-demand:

{
  "name": "my_server",
  "command": "npx",
  "arguments": ["@company/server-custom"],
  "autostart": false
}

Then, in the Agent Skills UI, manually enable it for specific agents. Saves startup time and memory.

Forwarding User Identity (Multi-Tenant).

If you're running AnythingLLM for multiple teams, you can scope MCP tool access by workspace or user. The server receives the workspace ID or username via headers:

{
  "name": "analytics",
  "command": "npx",
  "arguments": ["@company/server-analytics"],
  "forwardIdentity": true
}

Your analytics server sees X-Workspace-ID and X-User-ID headers. It returns only data that user should see. Useful for role-based access: finance team uses one database MCP, marketing team uses another.

Debugging: Why Your LLM Isn't Calling Your MCP Server

This is the most common complaint. You configured a server. Your agent never uses it. Follow this checklist.

Checklist:

  1. Is the server running? Go to Settings > Agent Skills. Do you see your server listed with a green status? If red or missing, the server failed to start. Check logs immediately.

  2. Is your LLM powerful enough? MCP servers take up context window space. If you're using a 3B parameter model, it might not have room for MCP tool definitions and reasoning. Switch to at least 7B, or a larger commercial model (GPT-4, Claude 3.5 Sonnet).

  3. Did you reload the config? After editing anythingllm_mcp_servers.json, you may need to reload. Desktop: close and reopen AnythingLLM. Docker: restart the container, then refresh the Agent Skills page in the UI.

  4. Check the logs.

    • Desktop: Help > Logs. Look for errors mentioning your server name.
    • Docker: docker logs anythingllm or docker exec anythingllm tail -f /root/.anythingllm/app.log
  5. Common errors and fixes:

    • "command not found: npx" Install Node.js. On Docker, npx and node are pre-installed; this error means your PATH is wrong.
    • "Transport type mismatch" You configured SSE but the server only supports StdIO (or vice versa). Check the server's documentation.
    • "Tool never invoked by model" The agent sees the tool, but the model doesn't think it's relevant. Rephrase your prompt to be explicit: instead of "Research this," say "Use the Fetch tool to fetch https://example.com and summarize."
    • "Permission denied" The user running AnythingLLM doesn't have permission to execute the command. Check file ownership and chmod.

If you're still stuck, check the AnythingLLM GitHub Discussions or Reddit community. Post your config, your prompt, and your logs.

MCP + Managed Hosting: Why You'd Self-Host

You now know MCP requires self-hosted AnythingLLM. So you have a choice:

Option 1: Run Desktop or Docker yourself.

  • Full control. Full responsibility.
  • No SaaS bill (besides cloud infra if on AWS/GCP).
  • You manage updates, backups, security patches, uptime.
  • Best for solo founders and small teams testing MCP.

Option 2: Use managed AnythingLLM hosting.

  • Skip Docker ops. A managed hosting provider runs your containers on their infrastructure with automatic backups, security updates, and GDPR compliance.
  • You configure your MCP servers normally. You get the self-hosted stack, just without operations overhead.
  • Costs more than DIY Docker, but saves engineering time.
  • Best for teams without DevOps staff or those prioritizing reliability.

Compare the true cost of self-hosted AnythingLLM: your time, your infrastructure spend, your on-call rotation. If you're a 50+ person org with DevOps staff, self-hosting is cheaper. If you're a 10-person startup, managed hosting is worth evaluating.

If you decide to self-host, start with Desktop, test your MCP servers, then move to Docker for production. If you decide to use managed hosting, you'll still configure MCP servers in the same way -- the difference is someone else manages the container and the underlying infrastructure.

Frequently Asked Questions

What is MCP in AnythingLLM?

MCP (Model Context Protocol) is a standard for connecting AI agents to external tools and data. AnythingLLM agents use MCP servers to access web scrapers, Git repos, databases, file systems, and more -- capabilities not available as built-in skills.

How do I add an MCP server to AnythingLLM?

Edit anythingllm_mcp_servers.json, add a server entry with the command and arguments (e.g., npx @modelcontextprotocol/server-fetch), save the file, then reload AnythingLLM. The server will appear in Settings > Agent Skills with a green status if it starts successfully.

Can I use MCP servers with AnythingLLM Cloud?

No. MCP is a self-hosted only feature. AnythingLLM Cloud does not support MCP servers for security and multi-tenant isolation reasons. You must use AnythingLLM Desktop or self-hosted Docker.

Which MCP servers work best with AnythingLLM?

The most useful are Fetch (web scraping), Git (code context), Filesystem (file ops), Memory (persistence), and Sequential Thinking (reasoning). Start with one of these; you can add more as use cases demand. The ecosystem has 20,405+ servers; check MCP.so for trending options.

Do I need to restart AnythingLLM after adding an MCP server?

Yes. Desktop: close and reopen the app. Docker: restart the container. Then refresh the Agent Skills page in the UI to see your new server with a green status.

Why isn't my LLM using my MCP server?

Check: Is the server listed in Agent Skills with a green status? Is your LLM model large enough (7B+ parameters)? Did you reload the config? Check logs for errors. If still stuck, rephrase your prompt to explicitly request the tool: "Use the Fetch tool to get https://example.com"

What transport types does AnythingLLM support?

StdIO (local commands, default), SSE (remote HTTP servers), and Streamable (persistent remote connections). For local MCP servers, use StdIO. For hosted or third-party servers, use SSE.

The Bottom Line

MCP servers transform AnythingLLM agents from simple search and memory tools into powerful automation machines. But they require self-hosting: AnythingLLM Desktop or Docker. If you need MCP and want to skip Docker ops, managed AnythingLLM hosting gives you the full self-hosted stack without the overhead.

Start with Fetch or Git. Test one server in an agent. Once it works, add more. The ecosystem has 20,405+ servers; you'll find one for any tool or API you want your agent to reach.

Ready to run MCP with AnythingLLM? Start with our AnythingLLM hosting guide to compare your options and get your first agent running.

Run MCP without Docker ops
Opsily's managed AnythingLLM handles containers, backups, and infrastructure. You configure MCP servers.
Get Started Free

Ready to self-host your own apps?

One server. Multiple apps. No per-app fees.

Get started →