Skip to main content
Genie Helper uses three MCP (Model Context Protocol) servers to provide the AI agent with 29 specialized tools for data management, LLM inference, and browser automation.

Architecture

MCP servers run as child processes of AnythingLLM and communicate via stdio transport. They auto-boot on AnythingLLM startup via a patched server/utils/boot/index.jsbootMCPServers() 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

The create-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_counts within 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 via OLLAMA_MODEL env 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

Data Extraction

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.
  • platform_sessions: Stores encrypted browser cookies captured via extension or HITL
  • hitl_sessions: Human-in-the-loop login requests (triggers yellow dashboard alert)
  • media_jobs: BullMQ job records for scrape, watermark, teaser, publish operations
  • action_flows: Flow definitions consumed by Action Runner (slug → steps JSON)

See Also