open-brain-mcp
Click on "Install 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., "@open-brain-mcpadd a thought: I need to refactor the database module."
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.
open-brain-mcp
Ein MCP-Server und CLI-Anwendung zum Speichern von Informationen mit semantischer Vektorsuche. Gedanken, Notizen und Ideen werden gespeichert und auf Anfrage als Kontext zur Verfügung gestellt.
Der MCP-Server ist im Produktionsbetrieb per HTTP erreichbar und kann mit Claude Desktop oder anderen MCP-Clients genutzt werden.
Features
Semantische Suche: Finde Gedanken nach Bedeutung, nicht nur nach Keywords
Automatische Metadaten: Extrahiert Typ, Topics, Personen und Action Items via GPT-4o-mini
MCP-Server: Integration mit Claude Desktop und anderen MCP-Clients
CLI: Komfortables Kommandozeilen-Interface
Export/Import: Backup und Restore aller Daten
Related MCP server: mcp-server-claude
Tech-Stack
Komponente | Technologie |
Sprache | Python 3.11+ |
MCP-Framework | FastMCP |
Datenbank | SQLite + sqlite-vec |
LLM/Embeddings | OpenRouter (GPT-4o-mini, text-embedding-3-small) |
Voraussetzungen
Python 3.11+
Ein OpenRouter-API-Key
Installation
Mit pip
# Repository klonen
git clone https://github.com/user/open-brain-mcp.git
cd open-brain-mcp
# Virtuelle Umgebung erstellen
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# oder: .venv\Scripts\activate # Windows
# Installieren
pip install -e .
# Mit Entwicklungs-Dependencies (Tests, Linting)
pip install -e ".[dev]"sqlite-vec Installation
sqlite-vec wird automatisch als Python-Package installiert und bringt die native Extension mit. Keine manuelle Installation nötig!
Falls dennoch Probleme auftreten:
macOS:
pip install sqlite-vecLinux:
pip install sqlite-vecHinweis: Die native Bibliothek wird automatisch heruntergeladen. Bei Architektur-Problemen kann die Umgebungsvariable SQLITE_VEC_PATH gesetzt werden, um einen alternativen Pfad zur Bibliothek anzugeben.
Konfiguration
Kopiere .env.example zu .env und fülle die Werte aus:
# Pflicht
OPENROUTER_API_KEY=sk-or-your-key-here
# Optional
OPENBRAIN_DB_PATH=./brain.db
OPENROUTER_RATE_LIMIT=2.0
OPENBRAIN_EMBEDDING_DIM=1536
OPENBRAIN_LOG_LEVEL=INFODie Datenbank wird beim ersten Start automatisch erstellt.
Schnellstart
Server starten
open-brain --port 4567
# oder: python server.pyGedanken speichern (CLI)
open-brain add "Ich sollte das Deployment mit GitHub Actions automatisieren."Suchen (CLI)
open-brain search "Deployment"Mit Claude Desktop nutzen
Füge zu ~/Library/Application Support/Claude/claude_desktop_config.json hinzu:
{
"mcpServers": {
"open-brain": {
"url": "http://localhost:4567/mcp"
}
}
}Funktionsweise
add(thought)
Speichert einen neuen Gedanken mit automatisch extrahierten Metadaten:
Metadaten-Extraktion: Via
openai/gpt-4o-miniwerden extrahiert:people: Erwähnte Personenaction_items: Implizite To-Dosdates_mentioned: Erwähnte Daten (YYYY-MM-DD)topics: 1-3 kurze Topic-Tagstype:observation,task,idea,referenceoderperson_note
Embedding-Erzeugung: Via
openai/text-embedding-3-smallwird ein 1536-dimensionaler Vektor erzeugt.Speicherung: Gedanke, Embedding und Metadaten werden in SQLite gespeichert.
search(text)
Semantische Suche nach Bedeutung. Nutzt Vektorähnlichkeit, um relevante Gedanken zu finden.
list_thoughts()
Listet gespeicherte Gedanken mit optionalen Filtern:
type: Nach Typ filterntopic: Nach Topic filternperson: Nach Person filterndays: Nach Zeitraum filtern
stats()
Zeigt Statistiken: Gesamtanzahl, Typen, Top-Topics und Personen.
health()
Health-Check mit Datenbank-Connectivity-Test für Monitoring.
CLI-Referenz
Gedanken speichern
# Direkt
open-brain add "Mein Gedanke..."
# Aus Datei
open-brain add --file notes.txt
# JSON-Ausgabe
open-brain add "Test" --jsonSuchen
# Semantische Suche
open-brain search "Suchbegriff"
# Mit Optionen
open-brain search "python" --limit 20 --threshold 0.5
open-brain search "meeting" --jsonAuflisten
# Alle Gedanken
open-brain list
# Mit Filtern
open-brain list --type task --days 7
open-brain list --topic python --person "Max"
open-brain list --limit 20 --jsonStatistiken
open-brain stats
open-brain stats --jsonExport/Import
# Export
open-brain export backup.json
open-brain export backup_full.json --full # inkl. Embeddings
# Import
open-brain import backup.json
open-brain import backup.json --on-conflict replaceMCP-Server
Startoptionen
Option | Default | Beschreibung |
| 4567 | HTTP-Port |
| 0.0.0.0 | Bind-Adresse |
| - | API-Key für Authentifizierung |
Mit Authentifizierung
open-brain --key mein-geheimes-passwortClients müssen dann x-brain-key Header oder ?key= Parameter senden.
Verfügbare Tools
Tool | Beschreibung |
| Gedanke speichern mit automatischen Metadaten |
| Semantische Suche |
| Auflisten mit Filtern |
| Statistiken |
| Health-Check mit DB-Connectivity |
Datenbankstruktur
-- Haupttabelle
CREATE TABLE thoughts (
id TEXT PRIMARY KEY,
content TEXT NOT NULL,
metadata TEXT DEFAULT '{}',
created_at TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
updated_at TEXT DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
);
-- Vektor-Tabelle (virtuell)
CREATE VIRTUAL TABLE thoughts_vec USING vec0(
rowid INTEGER PRIMARY KEY,
embedding float[1536]
);Verknüpfung über rowid. Vektorsuche via sqlite-vec (Cosine KNN).
Konfiguration
Umgebungsvariablen
Variable | Default | Beschreibung |
| - | Pflicht: OpenRouter API-Key |
|
| Pfad zur SQLite-Datenbank |
| 2.0 | API-Calls pro Sekunde |
| 1536 | Embedding-Dimension |
| INFO | Log-Level (DEBUG, INFO, WARNING, ERROR) |
Embedding-Modelle
Modell | Dimension | Empfehlung |
| 1536 | Default, guter Kompromiss |
| 3072 | Höhere Qualität, mehr Kosten |
| 1536 | Älteres Modell |
Wichtig: Bei Wechsel der Dimension müssen bestehende Embeddings neu generiert werden!
Entwicklung
Tests ausführen
# Alle Tests
pytest tests/ -v
# Mit Coverage
pytest tests/ -v --cov=. --cov-report=term-missingCode-Qualität
# Type-Check
mypy *.py
# Linting
ruff check *.py
# Formatierung
ruff format *.pyProjektstruktur
open-brain-mcp/
├── config.py # Konfiguration & Logging
├── db.py # Datenbankschicht
├── ai.py # OpenRouter Integration
├── server.py # MCP-Server
├── cli.py # CLI-Anwendung
├── pyproject.toml # Projekt-Konfiguration
├── tests/ # Test-Suite
│ ├── test_ai.py
│ ├── test_cli.py
│ ├── test_config.py
│ ├── test_db.py
│ └── test_server.py
└── README.mdTechnologie-Stack
FastMCP: MCP-Server Framework
sqlite-vec: Vektorsuche in SQLite
OpenRouter: API für Embeddings und LLM
tenacity: Retry-Logik
Lizenz
MIT
Beitragen
Issues und Pull Requests sind willkommen!
Fork erstellen
Feature-Branch:
git checkout -b feature/mein-featureCommit:
git commit -m 'Add feature'Push:
git push origin feature/mein-featurePull Request öffnen
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/uwek/open-brain-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server