Skip to main content
Glama
TheNovaNodes

AnythingLLM Control Plane MCP Server

by TheNovaNodes
README.md
---
module_type: mcp-server
status: active
protocol: mcp
primary_capability: AnythingLLM administration, workspace lifecycle, and automated ETL vector sync
requires: AnythingLLM instance
works_with: AnythingLLM, Antigravity Agent Ecosystem, MCP Clients
last_verified: 2026-09-05
---

# AnythingLLM Control Plane & ETL Sync MCP Server ๐Ÿง 

[![Go Version](https://img.shields.io/badge/go-1.25+-00ADD8.svg)](https://golang.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![MCP Server](https://img.shields.io/badge/MCP--Server-available-green)](https://modelcontextprotocol.io/)
[![Status: Active](https://img.shields.io/badge/Status-Active-brightgreen.svg)]()

High-performance Go-based Model Context Protocol (MCP) server and automated ETL sync daemon for AnythingLLM instances (`TheNovaNodes/anythingllm-mcp-control`). Provides autonomous AI agents with administrative workspace management and keeps semantic vector stores in continuous synchronization with filesystem Markdown documentation.

---

## ๐Ÿ“ฆ Core Binaries & Capabilities

The project builds two specialized Go binaries:

- **`anythingllm-control`** โ€” Stdio-based MCP server exposing an administrative interface for managing AnythingLLM workspaces, vector indices, and system diagnostics.
- **`anythingllm-sync`** โ€” Autonomous ETL synchronization CLI and daemon that monitors local project directories, deduplicates content via SHA-256, and handles tombstone lifecycle tracking in pure Go SQLite.

---

## ๐Ÿ› ๏ธ Exposed MCP Tools

The `anythingllm-control` MCP server exposes 5 administrative tools:

- **`list_workspaces`**  
  Lists all active workspaces in AnythingLLM with their slugs, IDs, and vector counts.  
  *Arguments:* None.  
  *Side Effects:* None (read-only).

- **`create_workspace`**  
  Creates a new isolated workspace with custom settings and vector indexing.  
  *Arguments:* `name` (string, required).  
  *Side Effects:* Creates a new workspace in the AnythingLLM database.

- **`delete_workspace`**  
  Permanently removes a workspace and purges its associated vector storage.  
  *Arguments:* `slug` (string, required).  
  *Side Effects:* Destructive permanent deletion of the workspace.

- **`get_system_env`**  
  Retrieves system environment settings, vector DB provider, and storage diagnostics dump.  
  *Arguments:* None.  
  *Side Effects:* None (read-only).

- **`get_vector_count`**  
  Retrieves total vector counts system-wide or for a designated workspace slug.  
  *Arguments:* `slug` (string, optional).  
  *Side Effects:* None (read-only).

---

## ๐Ÿš€ Quick Start & Building

### Prerequisites
- Go 1.25 or higher
- GCC or Clang (optional, pure Go SQLite is used)

### Build Binaries
```bash
git clone https://github.com/TheNovaNodes/anythingllm-mcp-control.git
cd anythingllm-mcp-control
make build
```
Compiled binaries will be created in `./bin/`:
- `bin/anythingllm-control`
- `bin/anythingllm-sync`

### Install System-wide
```bash
sudo cp bin/anythingllm-control /usr/local/bin/
sudo cp bin/anythingllm-sync /usr/local/bin/
```

### Health Check (stdio smoke test)
```bash
anythingllm-control < /dev/null
```
The server will log its initialization status and exit cleanly upon receiving EOF.

---

## โš™๏ธ Configuration & Environment Variables

The server and sync daemon read configuration from environment variables or command-line flags:

- **`ANYTHINGLLM_BASE_URL`** (or `ALM_BASE`)  
  Base URL of the AnythingLLM REST API.  
  *Default:* `http://127.0.0.1:3002/api/v1`
- **`ANYTHINGLLM_API_KEY`** (or `MG_API_KEY`)  
  Bearer API key for AnythingLLM authentication.

---

## ๐Ÿ”„ Automated ETL Sync Daemon (`anythingllm-sync`)

`anythingllm-sync` scans repositories for Markdown documentation, calculates SHA-256 checksums, and uploads new or modified documents into matching AnythingLLM workspaces. When a tracked file is deleted locally, it records a tombstone and removes the document from the vector index.

### CLI Flags
- **`-projects`** (string)  
  Root directory containing projects or agent offices to scan.  
  *Default:* `/root/projects`
- **`-state-dir`** (string)  
  Directory storing the local SQLite state ledger (`sync_state.db`).  
  *Default:* `/root/projects/TheNovaNodes/ops/shared/anythingllm-sync`
- **`-alm-base`** (string)  
  AnythingLLM API base URL.  
  *Default:* `http://127.0.0.1:3002/api/v1`
- **`-api-key`** (string)  
  AnythingLLM Bearer API key.
- **`-once`** (bool)  
  Execute a single synchronization pass and exit immediately.
- **`-interval`** (duration)  
  Continuous daemon run interval (e.g. `15m`, `1h`). Default `0` runs once.
- **`-timeout`** (duration)  
  HTTP request timeout per operation.  
  *Default:* `30s`

### Example Usage
```bash
# One-shot scan and index
anythingllm-sync -projects /root/projects -api-key "$ANYTHINGLLM_API_KEY" -once

# Continuous daemon running every 30 minutes
anythingllm-sync -projects /root/projects -api-key "$ANYTHINGLLM_API_KEY" -interval 30m
```

---

## ๐Ÿ”Œ MCP Client Configuration

Add to your MCP client configuration (e.g., Claude Desktop, Antigravity, or `mcp-router`):

```json
{
  "mcpServers": {
    "anythingllm-control": {
      "command": "/usr/local/bin/anythingllm-control",
      "args": [],
      "env": {
        "ANYTHINGLLM_BASE_URL": "http://127.0.0.1:3002/api/v1",
        "ANYTHINGLLM_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}
```

---

## ๐Ÿงช Testing & Code Quality

Run tests with data race detection and coverage:
```bash
# Run unit tests
make test

# Run tests with HTML/func coverage report
make coverage

# Run Go static analysis
make lint
```

---

## ๐Ÿ”’ Security Boundaries

- **Strict Access Control:** `anythingllm-control` contains destructive capabilities (`delete_workspace`). In production setups, it must only be exposed to trusted administrative agents or partitioned via `mcp-router` ACLs.
- **Prompt Injection Defense:** Input strings for workspace names and slugs are sanitized to prevent path traversal and API injection.
- **Zero-Secret Leakage:** API keys are injected via environment variables and never logged or serialized in error outputs.

---

## ๐Ÿ“„ License

MIT License โ€” see [LICENSE](LICENSE) for full details.

TDQS

A3.8/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct resource and action: workspace CRUD operations (list/create/delete) are clearly separated from system environment and vector count queries. No two tools have overlapping purposes, making selection unambiguous.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case: list_workspaces, create_workspace, delete_workspace, get_system_env, get_vector_count. The verbs and nouns are predictable and match the action/resource pair.

Tool Count5/5

Five tools is well-scoped for a control plane server, covering core workspace management and system information without unnecessary bloat. The count feels appropriate for the apparent domain.

Completeness3/5

The workspace lifecycle is incomplete: create, list, and delete exist, but update is missing. System environment is read-only, and there is no way to modify configuration. These gaps are notable for a control plane server, though the core viewing/deleting operations are present.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive