Architecture
MCP servers run as child processes of AnythingLLM and communicate via stdio transport. They auto-boot on AnythingLLM startup via a patchedserver/utils/boot/index.js → bootMCPServers() call.
Configuration: storage/plugins/anythingllm_mcp_servers.json
Directus MCP Server (17 tools)
Script:scripts/directus-mcp-server.mjs
Provides CRUD operations for Directus collections, user management, file handling, and flow triggering.
Collections
Items CRUD
Users
Files
Flows
Tier Gating
Thecreate-item tool includes built-in rate limiting for media_jobs creation:
- Checks feature access flags (
ai_clip_ops,watermark_ops, etc.) against subscription tier - Enforces usage quotas by counting
user_usage_countswithin billing cycle - Throws
tier_limit:prefixed errors visible to the agent - Fails open on unexpected errors to maintain availability
Ollama MCP Server (3 tools)
Script:scripts/ollama-mcp-server.mjs
Exposes Ollama’s local LLM inference API for text generation, chat, and model management.
Configuration
- Default URL:
http://127.0.0.1:11434 - Default model:
qwen-2.5:latest(configurable viaOLLAMA_MODELenv var) - Temperature range: 0-2 (default 0.7)
- Stream mode: Disabled (all responses are synchronous)
Stagehand MCP Server (9 tools)
Script:scripts/stagehand-mcp-server.mjs
Wraps the Stagehand browser automation server (port 3002) for web scraping, platform interactions, and HITL (human-in-the-loop) workflows.
Session Management
Navigation & Interaction
Data Extraction
Cookie Management
Configuration
- Stagehand URL:
http://127.0.0.1:3002 - Default model:
ollama/qwen-2.5(for vision/element detection) - Launch args: Stealth mode enabled (
--disable-blink-features=AutomationControlled) - Window size: 1920x1080
- Resource limits: ~300MB RAM per active session, ~33 concurrent sessions ceiling
Error Handling
All tools surface HTTP errors to the agent with status code and error message extraction from Stagehand responses.Related Collections
platform_sessions: Stores encrypted browser cookies captured via extension or HITLhitl_sessions: Human-in-the-loop login requests (triggers yellow dashboard alert)media_jobs: BullMQ job records for scrape, watermark, teaser, publish operationsaction_flows: Flow definitions consumed by Action Runner (slug → steps JSON)
See Also
- Action Runner — Flow-based execution system that uses MCP tools
- Ollama Models — Available LLM models and their roles
- Taxonomy System — 6-concept content classification
