anythingllm-rag
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@anythingllm-rag Pull any existing project context for this repo from our RAG."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
rag-workflow
A thin MCP server plus an agent workflow that gives every coding session memory: project context is retrieved from an AnythingLLM RAG at task start and written back, human-approved, when a task establishes durable facts.
The server wraps the AnythingLLM Developer REST API with five workflow-shaped
tools instead of a generic chat proxy. The kit (workflow/) is the read/write
procedure as two agent skills, plus a session-start trigger.
Requirements
Node >= 24 (target the latest locally installed nvm version).
A running AnythingLLM instance (self-hosted or desktop) with a Developer API key (Settings -> Developer API).
Related MCP server: shelfmark
Tools
Tool | Endpoint | Purpose |
|
| Match a repo ( |
|
| Scored semantic chunks, no LLM generation |
|
| Onboard a repo |
|
| Embed a curated markdown doc; upserts by title |
|
| Delete the doc under a title |
Identity is the workspace name, never the slug: AnythingLLM strips / and
rewrites . to -dot- in slugs, so slugs collide. Doc titles are compared
extension-stripped because stored titles lose their extension (.md -> .txt).
Both rules are proven in docs/resolver-spec.md and
docs/context-schema.md.
Install
pnpm install
pnpm buildRegister with any MCP client (example for a global MCP config file):
{
"mcpServers": {
"anythingllm-rag": {
"command": "node",
"args": ["/absolute/path/to/rag-workflow/dist/index.js"],
"env": {
"ANYTHINGLLM_BASE_URL": "http://your-anythingllm-host",
"ANYTHINGLLM_API_KEY": "your-developer-api-key"
}
}
}
}Keep the API key out of version control.
Workflow kit
workflow/ holds the procedure that turns the five tools into session memory,
written for the pi coding agent but
portable to any agent with skills plus a prompt-injection hook:
skills/find-context/SKILL.md— read path: identify repo (git origin, cache fallback), find workspace, search per concern, adopt or propose onboarding.skills/write-back/SKILL.md— write path: draft curated docs perdocs/context-schema.md, get per-doc human approval, upsert.extensions/rag-trigger.ts— injects the context-check instruction on the first prompt of each session in a git repo.AGENTS.md— standing instructions, fallback when no hook is available.
Install by copying the skills and extension into your agent's discovery paths
(pi: ~/.agents/skills/, ~/.pi/agent/extensions/).
Verify
Against a live instance, exercising all five tools and the upsert/no-stale rule:
ANYTHINGLLM_BASE_URL=... ANYTHINGLLM_API_KEY=your-key pnpm smokeLicense
MIT
Available Tools
5 toolsrag_create_workspaceCreate RAG workspaceA
Create an AnythingLLM workspace named after the repo (e.g. 'owner/repo'). Returns {name, slug}.
Inputs: name (required).
rag_findFind RAG workspace for a repoA
Check whether an AnythingLLM workspace exists for a repo. Matches on exact display name (e.g. 'owner/repo'). Returns {exists, workspace|null, all}.
Inputs: name (required).
rag_forgetDelete a doc from a workspaceA
Remove the embedded doc whose canonical title matches (extension-insensitive). Used when a doc is split or retired so the stale title leaves no retrievable embedding. Returns {forgotten, title|locations}.
Inputs: slug (required), title (required).
rag_searchVector search a workspaceA
Semantic search over a workspace's embedded docs. No LLM generation. Default scoreThreshold 0.2 (the native embedder scores low). Returns matching chunks with scores.
Inputs: slug (required), query (required), topN, scoreThreshold.
rag_writeWrite curated context to a workspaceA
Embed a curated markdown doc into a workspace (raw-text + auto-embed). If overwrite=true (default), removes any existing embedding with the same title first to avoid stale duplicates.
Inputs: slug (required), title (required), content (required), overwrite.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct operation: lookup, creation, semantic search, document injection, and document removal. The only minor overlap is that rag_write can remove stale embeddings via overwrite, but the intent (write vs. forget) is clearly separated in the descriptions.
All tools share a consistent rag_ prefix and use lowercase snake_case verbs. However, create_workspace includes an object while find, search, write, and forget are bare verbs, so the pattern is not perfectly uniform.
Five tools is a well-scoped set for a focused RAG/workspace utility. Each tool covers a distinct part of the workflow without redundancy or bloat.
The core RAG lifecycle is covered: find/create workspaces, write docs, semantic search, and forget docs. The main gap is the lack of a workspace deletion tool, which prevents full lifecycle cleanup.
Maintenance
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Project memory, documentation and controlled secret access for AI coding agents.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables per-project, traceable access to a RAG knowledge base, with tools for searching and adding knowledge chunks.4MIT
- AlicenseAqualityBmaintenanceEnables coding agents to query local notes, decisions, docs, and code with hybrid retrieval (BM25 + embeddings + reranking) and get path:line citations. It provides tools like rag_query for full-corpus search and search_knowledge for project-scoped knowledge recall.21MIT
- AlicenseAqualityBmaintenanceEnables AI agents to maintain a persistent knowledge graph of a project, providing dependency context, impact analysis, side-effect discovery, and session recording for more informed coding decisions.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to persist and retrieve project knowledge using three MCP tools with local vector and full-text search.MIT