BrainAPI MCP
BrainAPI turns text into a knowledge graph on your server and serves agents over MCP, REST and a console with fact-path answers
- 551 ★ on the repository
- Last commit
Broad access
Why this level
- Takes documents and website page content into a database and sends the text to the AI models you pick, cloud or local
- The MCP server gives the agent read and write access to memory, and the BRAINPAT_TOKEN opens both the console and the API
- The installer clones the repository, installs dependencies and starts Docker services on your machine
Install
- Works in
Manual install
npm install -g brainapi-tuiThen brainapi init and brainapi start clone the project into ~/.brainapi, set up the environment and launch the services.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Takes documents and website page content into a database and sends the text to the AI models you pick, cloud or local
- The MCP server gives the agent read and write access to memory, and the BRAINPAT_TOKEN opens both the console and the API
- The installer clones the repository, installs dependencies and starts Docker services on your machine
This is third-party code. Review the repository files before installing.
What it does
BrainAPI is a self-hosted memory layer for AI agents. You send it documents, notes and events over REST, and a group of agents reads the text and builds a graph. Scout extracts entities, Observations writes notes about facts, Architect links entities into events of the form who did what to whom and in what context, and Janitor checks the links and looks for duplicates. The graph is append-only, nothing is deleted, so the full history stays intact. Queries return fact triples, text passages and historical context along with the path that produced the answer. The /retrieve/context endpoint returns relevant context for a phrase, and /retrieve/search, enabled with SEARCH_ENABLED=true, returns ranked passages. The MCP server listens on port 8001 at /mcp, so any MCP-capable agent can read from and write to the memory. Plugins can add their own MCP tools. For Claude Desktop the repository includes a stdio-to-Streamable-HTTP bridge written in Rust. Installation goes through the brainapi-tui npm package: brainapi init and brainapi start clone the project, set up the environment and launch the API, MCP server, Celery worker and web console.
Who it is for. Agent builders who need long-term memory with a traceable source for every fact, deployed on their own infrastructure.
Good fit when
- An agent has to answer multi-step questions over accumulated documents and show the fact chain
- Agent memory has to live on your own server, with Docker, Ollama or cloud models of your choice
- Data arrives as a stream of events and the change history must be kept without overwriting
- You want to load website pages into memory: BrainAPI crawls the address through Lumen Crawler and stores the facts
Not a fit when
- You want simple note-style memory without a server: the full stack with databases and a worker is heavy
- The Business Source License 1.1 does not suit you: the code is not open source in the OSI sense
- You need a single call with no deployment: the project has a cloud version, but this repository is meant to be run yourself
Example request
Connect to the BrainAPI MCP server and find in memory who organized AI meetups in London in the first quarter, with the fact chainMCP
- Transport
- http
- Authentication
- API key
Environment variables
BRAINPAT_TOKENrequired, secret- Access token created during setup that opens the console and the MCP server
LUMEN_CRAWLER_KEYsecret- Lumen Crawler key for loading website pages into memory
Limitations
- The license is Business Source License 1.1 from Lumen Platforms: the source is available but it is not an open license in the OSI sense.
- It needs Docker or separate databases, models either local through Ollama or cloud provider keys, and a Celery worker.
- Passage search is off by default, and BM25 requires PostgreSQL as the data store.
- The MCP server is protected by the BRAINPAT_TOKEN created during setup. Claude Desktop needs the separate bridge built in Rust.
How to disable. Stop the stack with Ctrl-C in the window running brainapi start, or with make stop-all in dev mode. Data and the installation live in ~/.brainapi, which you delete by hand. Remove the MCP server entry from the agent's configuration.
FAQ
How do I connect BrainAPI to Claude Code as an MCP server?
After brainapi start the MCP server is at http://localhost:8001/mcp. Add it to the agent's configuration as an HTTP server and pass the BRAINPAT_TOKEN in the authorization header. For Claude Desktop build the mcp-stdio-http-bridge.
How is BrainAPI different from plain vector search?
It builds an event graph and returns fact triples with the path that produced the answer. Vector search returns only similar passages. BrainAPI has passage search too, but it is switched on separately with SEARCH_ENABLED=true.
What does append-only mean in BrainAPI?
Nothing is ever deleted from the graph. A new action is added as its own event node and old data stays in place, so you can reconstruct how facts changed.
What are the accurate and lightweight modes?
The default accurate mode runs the whole agent set with Janitor validation. Lightweight extracts only the most important entities and skips the heavy validation. Switch with --pipeline lightweight or PIPELINE_MODE.
What license does BrainAPI use?
Business Source License 1.1 from Lumen Platforms. The source is readable, but the license text defines the limits on commercial use and should be read before adoption.
Discussion
No questions or reviews yet.
Related
MCP serversAn MCP server and API of shared memory for several agents: facts, decisions and events live in one database with semantic search.
Self-hosted long-term memory for agents: semantic search, a knowledge graph and autonomous consolidation over MCP and a REST API
Local memory for agents: decisions from browser chats reach Claude Code, Cursor and Windsurf through MCP
Shared memory for fleets of AI agents with access scopes, an audit trail and a knowledge graph: an MCP server, Docker and a cloud
Memory for agents over MCP: five tools, one local SQLite file and layers modeled on human memory, no account
Membase keeps one shared memory for AI agents that Claude Code, Cursor and Codex read through MCP, an SDK or the membase command
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| BrainAPI (this card) | yes | API key | 551 | |
| MCP Memory Service | no | not required | 2,117 | a store of notes and vectors, while BrainAPI builds an event graph with the path to an answer |
| agent-memory | no | 4,315 | memory without an event graph or a separate agent verifying facts |
README in short
The README explains the event-graph idea with one sentence, then gives a quick start through brainapi-tui and a dev mode through make. It goes on to describe the web console, the four-agent pipeline, the accurate and lightweight modes, retrieval endpoints and a plugin system with a public registry.