Powerbrain MCP Server
OfficialProvides a pre-provisioned Grafana dashboard for accuracy, drift, empty-result, and reranker-quality metrics, enabling observability of the context engine.
Supports Ollama as a self-hosted LLM and embedding provider for context summarization and vector embeddings.
Supports OpenAI-compatible LLM APIs for summarization and the optional AI provider proxy, including tool-call orchestration and pseudonymized chat routing.
Uses PostgreSQL as the primary data and vault store, backing enterprise data queries, audit logs, pending reviews, and pseudonym mappings.
Exposes Prometheus metrics and alerts for accuracy, drift, empty-result rate, and reranker score drift.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
š§ Powerbrain
Open source. Closed data. š
"AI eats context. We decide what's on the menu."
Open-source context engine that feeds AI agents with policy-compliant enterprise knowledge ā self-hosted, GDPR-native, provider-agnostic.
The Problem
Every AI agent needs context. But feeding enterprise data to LLMs means losing control ā over who sees what, how long it's retained, and whether it complies with GDPR. Most solutions either block AI entirely or hand everything over. Neither works.
Related MCP server: MetaGraph-MCP
The Solution
Powerbrain sits between your data and your AI agents. It delivers context through the Model Context Protocol (MCP), with every request checked by a policy engine. Your data stays on your infrastructure. Your policies decide what gets through.
Agent / Skill
ā MCP
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Powerbrain MCP Server ā
ā āā OPA Policy Check (every request) ā
ā āā Circuit Breaker + Approval Queue (Art. 14) ā
ā āā Qdrant Vector Search (oversampled) ā
ā āā Cross-Encoder Reranking (top-k) ā
ā āā Context Summarization (policy-controlled) ā
ā āā Sealed Vault (PII pseudonymization) ā
ā āā Tamper-Evident Audit Log (Art. 12) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā
ā¼ ā¼ ā¼ ā¼
Qdrant PostgreSQL OPA Ollama/vLLM/TEI
(vectors) (data+vault) (policies) (embeddings+LLM)
ā
ā¼
āāāāāāāāāāāāāāāā
ā pb-worker ā Accuracy metrics, drift
ā (APScheduler)ā detection, audit retention
āāāāāāāāāāāāāāāā⨠Core Features
š Policy-Aware Context Delivery ā Every search request is checked against OPA policies. Classification levels (public, internal, confidential, restricted) control what each agent role can access. Compliance is executable code, not documentation.
š”ļø Sealed Vault & Pseudonymization ā PII is detected at ingestion (Microsoft Presidio), pseudonymized with per-project salts, and stored in a dual-layer vault. Originals require HMAC-signed, time-limited tokens with purpose binding. Art. 17 deletion: remove the vault mapping and pseudonyms become irreversible.
šÆ Relevance Pipeline ā 3-stage search: Qdrant oversampling (5x candidates) ā OPA policy filtering ā Cross-Encoder reranking. Graceful degradation: if the reranker is down, results fall back to vector ordering.
š Context Summarization ā Agents can request summaries instead of raw chunks. OPA policies can enforce summarization for sensitive data (confidential = summary only, no raw text), control detail levels, or deny summarization entirely. Powered by any OpenAI-compatible LLM (Ollama, vLLM, or external).
š MCP-Native Interface ā 23 tools accessible through the Model Context Protocol. Works with any MCP-compatible agent (Claude, OpenCode, custom). One endpoint, one protocol.
š Self-Hosted & GDPR-Native ā Everything runs on your infrastructure. No external API calls for embeddings, search, or summarization. Docker Compose up and you're running.
š AI Provider Proxy ā Optional gateway between your AI consumers and their LLM providers. Transparently injects Powerbrain tools into every LLM request and executes tool calls automatically. Pseudonymises the chat content on the wire (PII scan via the ingestion pipeline) before it reaches the LLM. Your teams use any LLM they prefer (100+ providers via LiteLLM); Powerbrain ensures they always query policy-checked enterprise context. Without the proxy, direct chat from subscription clients (Claude Desktop / Claude Code Pro/Max) bypasses the chat-path PII scan ā see the edition boundary. Activate with docker compose --profile proxy up.
āļø EU AI Act Compliance Toolkit
Powerbrain is not itself a high-risk AI system, but Deployers who operate one in regulated sectors (finance, healthcare, HR) need infrastructure that delivers the Art. 9ā15 capabilities. Powerbrain ships them as executable building blocks, not PDFs:
Article | Feature | How |
Art. 9 ā Risk management | Concrete risk register + live indicators |
|
Art. 10 ā Data quality | Blocking ingestion quality gate | Composite score (length, language confidence, PII density, encoding, metadata) with per-source_type thresholds via OPA |
Art. 11 / Annex IV ā Technical docs | Admin-triggered Annex IV generator |
|
Art. 12 ā Logging | Tamper-evident audit hash chain | SHA-256 hash chain on |
Art. 13 ā Transparency | Auth-required transparency endpoint |
|
Art. 14 ā Human oversight | Global kill-switch + approval queue |
|
Art. 15 ā Accuracy & drift | Windowed feedback metrics + embedding drift detection | Per-collection baseline centroids in |
The pb-worker maintenance container runs four APScheduler jobs: accuracy metrics refresh (5 min), pending-review timeouts (hourly), GDPR retention cleanup (daily 02:00), audit retention cleanup (daily 03:00).
š§© Editions
Powerbrain ships as two tiers, both Apache-2.0, both self-hosted.
Community is the MCP context engine (search, vault, OPA, audit).
Enterprise adds pb-proxy ā an OpenAI-compatible chat gateway that
orchestrates tool-call loops, pseudonymises the wire, and resolves
vault pseudonyms for chat responses per OPA policy. Full capability
matrix and migration notes in docs/editions.md.
Edition detection is on every service's /health and /transparency
endpoint: "edition": "community" on mcp-server:8080, "edition": "enterprise" on pb-proxy:8090.
š¬ Run a Sales Demo in 5 Minutes
Need to show a decision-maker what Powerbrain does? Spin up the full demo stack (role-aware search, live PII vault, knowledge-graph explorer) with a single command:
./scripts/quickstart.sh --demoThe script seeds 21 base documents, 6 customer records with German PII, and an 8-person org-chart graph. When healthchecks finish, open http://localhost:8095 ā a five-tab Streamlit app with inline presenter notes: role-contrast search, live PII vault, knowledge graph, a MCP vs Proxy side-by-side that shows the community/enterprise contrast, and a Pipeline Inspector that dry-runs any document through the ingestion pipeline. The full 15-minute narrative lives in docs/playbook-sales-demo.md.
š Quick Start
git clone https://github.com/nuetzliches/powerbrain.git && cd powerbrain
# Automated setup (recommended):
./scripts/quickstart.sh # base stack, no seed
./scripts/quickstart.sh --seed # + 21 sample documents
./scripts/quickstart.sh --demo # + PII vault fixtures + graph + demo UI on :8095
# Or manually:
cp .env.example .env # PG_PASSWORD comes from secrets/pg_password.txt (auto-generated)
docker compose --profile local-llm --profile local-reranker up -d
docker exec pb-ollama ollama pull nomic-embed-text
for col in pb_general pb_code pb_rules; do
curl -s -X PUT "http://localhost:6333/collections/$col" \
-H 'Content-Type: application/json' \
-d '{"vectors":{"size":768,"distance":"Cosine"}}' && echo " ā $col ā"
doneVerify everything is running:
curl -s http://localhost:8080/health # MCP Server
curl -s http://localhost:6333/healthz # Qdrant
curl -s http://localhost:8181/health # OPAConnect your agent (a default dev key is pre-seeded for local use):
{
"mcpServers": {
"powerbrain": {
"type": "http",
"url": "http://localhost:8080/mcp",
"headers": {
"Authorization": "Bearer pb_dev_localonly_do_not_use_in_production"
}
}
}
}That's it. Your agent now has access to search_knowledge, query_data, graph_query, generate_compliance_doc, and 19 more tools ā see MCP Tool Reference. For production keys, see the Getting Started guide.
Optional: AI Provider Proxy
# 1. Uncomment/add your LLM provider in pb-proxy/litellm_config.yaml
# 2. Set API keys in .env (e.g. OPENAI_API_KEY=sk-...)
docker compose --profile proxy up -d
# List available models:
curl http://localhost:8090/v1/models
# Use the proxy ā Powerbrain tools are injected automatically:
curl http://localhost:8090/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"What are our GDPR deletion policies?"}]}'š How It Works
1. Agent calls search_knowledge("GDPR deletion policy", summarize=true)
2. Powerbrain embeds the query (nomic-embed-text via configurable provider)
3. Qdrant returns 50 candidates (10 Ć 5 oversampling)
4. OPA filters by agent role + data classification ā 30 remain
5. Cross-Encoder reranks by query-document relevance ā top 10
6. OPA summarization policy: allowed? required? detail level?
7. LLM summarizes the chunks (if applicable)
8. Response: results + summary + policy transparencyš§ Principles
Sovereignty by design ā Data sovereignty is not a feature, it's the architecture. No external API calls. No cloud dependencies. Your data, your rules.
Enable, don't restrict ā The goal is not to prevent AI adoption, but to make it safely usable. Powerbrain says "yes, but with guardrails" instead of "no."
Policy as code ā Compliance rules are OPA/Rego policies, version-controlled and testable. Not Word documents. Not checkbox audits.
š Documentation
Document | Description |
Step-by-step tutorial: ingest data, search, understand policies | |
Capability matrix, edition boundary, which tier governs which data path | |
Honest answer on Pro/Max bypass, three-tier mitigation, DPA vs AI Act | |
All 23 MCP tools with parameters and access roles | |
Detailed overview and positioning | |
Technical deep-dive | |
Dev, production, TLS, Docker Secrets | |
Sync GitHub repositories into the knowledge base | |
Sync SharePoint, OneDrive, Outlook, Teams, OneNote | |
ADRs and trade-offs | |
EU AI Act Art. 9 risk register (R-01..R-08) | |
How dependencies are audited, and advisories accepted with a review date | |
Implementation plan for B-40..B-46 | |
Agent-facing reference (tools, schemas, conventions) |
š¤ Contributing
Powerbrain is open source (Apache 2.0). Contributions welcome ā whether it's a new OPA policy, a better reranker model, or documentation improvements.
Open source. Closed data. š
š License
Apache License 2.0. Dependencies under their respective licenses.
AI Usage
Parts of this codebase were developed with the assistance of AI coding tools (e.g. Claude, GitHub Copilot).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Compliance frameworks (SOC 2, ISO 27001, CMMC, NIST, more) delivered to AI agents as MCP tools.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides a unified context layer for AI agents, enabling ranked search, file management, context bundles, database queries, and connected source access through MCP, all scoped to organizational permissions with citations.-
- AlicenseNot gradedqualityDmaintenanceEnables enterprise AI agents to query governed data lineage, PII-aware schema documentation, and semantic metadata from SQL logs via MCP, with role-based access and vector search.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to securely search and ingest corporate documents via MCP, offering hybrid retrieval, PII sanitization, role-based access control, and citation validation.MIT
- FlicenseAqualityCmaintenanceEnables AI agents to discover and query enterprise knowledge documents and business metrics through standardized MCP tools, supporting retrieval, structured sales/order analysis, anomaly scanning, and data lineage lookups.12-