ensemble-mcp
Provides intelligence infrastructure for GitHub Copilot in VS Code via MCP configuration.
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., "@ensemble-mcpsearch for similar patterns in my project memory"
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.
ensemble-mcp
A harness infrastructure layer delivered as a Python MCP server — providing vector memory, drift detection, model routing, skills discovery, session management, codebase indexing, and context compression for AI agent pipelines.
All intelligence is local — zero LLM/API calls. Uses ONNX Runtime embeddings (~5ms), numpy cosine similarity, and SQLite storage.
What is an Agent Harness?
Agent = Model + Harness. A harness is every piece of code, configuration, and execution logic that wraps a model to turn it into a useful agent. Without a harness, a model can only take in text and output text — it can't maintain state, execute code, access tools, or learn from past work.
A complete agent harness typically includes:
System prompts & configuration — instructions that shape agent behavior
Tools, Skills & MCPs — capabilities the agent can invoke
Execution environment — filesystem, bash, sandbox, browser
Orchestration logic — subagent spawning, handoffs, model routing
Memory & context management — compaction, skills, session persistence
Hooks & middleware — deterministic checks like linting, formatting, drift detection
For a deeper dive, see The Anatomy of an Agent Harness by LangChain.
Related MCP server: knitbrain
Where ensemble-mcp Fits
Agent harnesses like Claude Code, Codex, and Cursor provide the execution layer — filesystem, bash, sandbox. ensemble-mcp provides the intelligence infrastructure layer that plugs into any harness via MCP:
┌─────────────────────────────────────────────────────────┐
│ AGENT HARNESS │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Execution Layer │ │
│ │ (provided by Claude Code / Codex / Cursor) │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │
│ │ │Filesystem│ │ Bash / │ │ Sandbox / │ │ │
│ │ │ & Git │ │ Code │ │ Browser │ │ │
│ │ └──────────┘ └──────────┘ └──────────────────┘ │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Intelligence Infrastructure Layer │ │
│ │ (provided by ensemble-mcp via MCP) │ │
│ │ │ │
│ │ ┌────────┐ ┌────────┐ ┌───────┐ ┌───────────┐ │ │
│ │ │ Memory │ │ Skills │ │ Drift │ │ Context │ │ │
│ │ │& Search│ │ │ │Detect │ │Compression│ │ │
│ │ └────────┘ └────────┘ └───────┘ └───────────┘ │ │
│ │ ┌────────┐ ┌────────┐ ┌───────┐ ┌───────────┐ │ │
│ │ │ Model │ │Session │ │Code │ │ Project │ │ │
│ │ │Routing │ │Persist.│ │Index │ │ Snapshot │ │ │
│ │ └────────┘ └────────┘ └───────┘ └───────────┘ │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Orchestration Layer │ │
│ │ (agent pipeline, subagent spawning, handoffs) │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ ┌───────────┐ │
│ │ MODEL │ │
│ └───────────┘ │
└─────────────────────────────────────────────────────────┘Features
ensemble-mcp provides these harness primitives:
Harness Primitive | Feature | What It Does |
Memory & Search | Pattern Memory | Semantic vector search over stored pipeline patterns (MiniLM-L6-v2, 384-dim) |
Drift Detection | Drift Check | Cosine similarity between task description and code changes |
Model Routing | Model Recommend | Recommend model tier (best/mid/cheapest) per agent and task complexity |
Skills (Progressive Disclosure) | Skills Discovery | Scan |
Skills (Progressive Disclosure) | Skill Intelligence | Auto-detect recurring patterns and suggest converting them to reusable skills |
Long Horizon Execution | Session Management | Pipeline checkpoint save/load with optimistic versioning |
Codebase Awareness | Codebase Indexing | File-level index with exports, imports, roles — incremental via mtime |
Context Rot Prevention | Context Compression | Compress verbose text into token-efficient form, rule-based |
Context Rot Prevention | Prompt Caching | Order and prepare prompt sections for optimal LLM cache hit rates |
Codebase Awareness | Codebase Snapshots | Generate compact project baseline summaries from the codebase index |
Harness Setup | Auto-Installer | Detect AI tools and register the MCP server in their configs |
Observability | Web Dashboard | Local browser UI at |
Quick Start
Install from source
git clone https://github.com/LynkByte/ensemble.git
cd ensemble
pip install -e ".[dev]"Install via uvx (after PyPI publish)
uvx ensemble-mcpRun the server
# Start the MCP server (stdio protocol)
ensemble-mcp
# Or explicitly
ensemble-mcp serveOther CLI commands
# Auto-detect AI tools and register the MCP server
ensemble-mcp install
# Remove MCP server registration from AI tool configs
ensemble-mcp uninstall
# Copy agent files to a project (no MCP registration needed)
ensemble-mcp add-agents --tools opencode
# Copy skill files to a project (no MCP registration needed)
ensemble-mcp add-skills --tools opencodeWeb Dashboard
A local-only browser dashboard for visualizing patterns, skills, projects, drift history, and sessions.
# Start the dashboard (opens browser to http://localhost:8787)
ensemble-mcp web
# Custom port
ensemble-mcp web --port 9000
# Start without auto-opening the browser
ensemble-mcp web --no-open
# Specify a reports directory (auto-detected from ./reports or git root otherwise)
ensemble-mcp web --reports-dir /path/to/reportsThe dashboard reads directly from the same SQLite database the MCP server writes to (WAL mode, no contention). It binds to 127.0.0.1 only — never exposed to the network, no authentication needed.
Dashboard Pages
Page | What It Shows |
Overview | Summary cards (patterns, skills, projects, drift checks), drift score trend chart, recent activity |
Patterns | All stored patterns with match counts, project filtering, search |
Skills | Pending skill suggestions with confidence scores, stale skill detection |
Projects | Indexed projects with language breakdown pie charts, file role bar charts, export counts |
Drift | Drift check history with scores, verdicts, flagged files, project filtering |
Sessions | Session list with lifecycle status, click-through to step-by-step detail |
API Endpoints
All endpoints return the standard ok/data/error/meta envelope:
Endpoint | Description |
| Aggregate counts and recent activity |
| Paginated pattern list (filter by |
| Single pattern detail with embedding metadata |
| Skill suggestions (filter by |
| Skills not matched within threshold days |
| Indexed projects with file/export counts |
| Project detail with language and role breakdown |
| Drift history (filter by |
| Paginated session list (filter by |
| Session detail with steps |
| Server health, version, DB size |
MCP Client Configuration
OpenCode
Add to ~/.config/opencode/config.json or project config.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ensemble": {
"type": "local",
"command": ["uvx", "ensemble-mcp"]
}
}
}Or for a local development install:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ensemble": {
"type": "local",
"command": ["/path/to/venv/bin/ensemble-mcp"]
}
}
}Claude Code
Add to ~/.claude.json:
{
"mcpServers": {
"ensemble": {
"command": "uvx",
"args": ["ensemble-mcp"]
}
}
}GitHub Copilot (VS Code)
Add to .vscode/mcp.json:
{
"servers": {
"ensemble": {
"command": "uvx",
"args": ["ensemble-mcp"]
}
}
}Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"ensemble": {
"command": "uvx",
"args": ["ensemble-mcp"]
}
}
}Windsurf
Add to ~/.windsurf/mcp.json:
{
"mcpServers": {
"ensemble": {
"command": "uvx",
"args": ["ensemble-mcp"]
}
}
}Auto-Install
Instead of manual configuration, run the installer to auto-detect installed AI tools and register the server:
# Detect tools and register (interactive)
ensemble-mcp install
# Register specific tools only
ensemble-mcp install --tools opencode,cursor
# Preview without making changes
ensemble-mcp install --dry-run
# Non-interactive
ensemble-mcp install --yesThe installer automatically detects how ensemble-mcp is available on your system and registers the appropriate command:
Priority | Detection | Registered Command |
1st |
|
|
2nd |
|
|
3rd | Neither found |
|
19 MCP Tools
Patterns (semantic memory)
Tool | Description |
| Semantic search over stored patterns |
| Store a new pattern with embedding |
| Remove old/unused patterns |
Drift Detection
Tool | Description |
| Cosine similarity between task and changes (0-1 score) |
Model Routing
Tool | Description |
| Recommend model tier for agent + task complexity |
Skills
Tool | Description |
| Scan skill directories with optional semantic search |
| Detect recurring patterns, propose as reusable skills |
| Accept, dismiss, or defer a skill suggestion |
Session
Tool | Description |
| Save pipeline checkpoint with optimistic versioning |
| Load latest or specific checkpoint |
| Search sessions by semantic similarity |
Codebase Indexer
Tool | Description |
| Build/refresh file-level codebase index |
| Query index by language, path, or text |
| Get import/dependency graph for a file |
| Generate compact project baseline summary (cached) |
Context Compression
Tool | Description |
| Compress verbose text into terse, token-efficient form while preserving technical content |
| Order prompt sections for optimal LLM cache hit rates (static → project → task) |
Utility
Tool | Description |
| Server health check |
| Reset all data (destructive, requires confirmation) |
Response Envelope
Every tool returns a standardized envelope:
{
"ok": true,
"data": { "matches": [...] },
"error": null,
"meta": {
"duration_ms": 12,
"source": "sqlite",
"confidence": "exact"
}
}Confidence indicators: exact (direct data), partial (mixed sources), estimated (heuristic).
Architecture
ensemble-mcp is structured as a harness infrastructure layer with clear separation between tool implementations and shared engine components:
ensemble-mcp/
src/ensemble_mcp/
server.py # MCP server + tool registration
config/ # Settings, defaults
contracts/ # Response envelope, error taxonomy
memory/ # ONNX embeddings, SQLite vector store, cosine similarity
security/ # Secret redaction, trust boundaries
state/ # Session/step lifecycle, idempotency, locks
tools/ # 19 MCP tool implementations + call-recording utility
installer/ # AI tool detection + MCP registration
dashboard/ # Web dashboard (aiohttp server, JSON API, SPA frontend)
compress/ # Rule-based text compression engine (context rot prevention)
cli/ # Startup banner
data/ # Bundled agent and skill files (AGENTS.md, skills)Technology Stack
Component | Choice |
Language | Python 3.11+ |
Distribution |
|
MCP Framework |
|
Embeddings | ONNX Runtime + MiniLM-L6-v2 (~22MB, 384-dim) |
Vector Storage | SQLite + numpy cosine similarity |
Tokenizer | HuggingFace |
Package Size | ~90MB (including ONNX + model) |
Local Storage
Path | Contents |
| SQLite database (WAL mode) |
| ONNX MiniLM-L6-v2 model (~22MB) |
| Global user configuration |
Configuration
Layered config with deterministic merge order:
Package defaults (built-in)
Global config (
~/.config/ensemble-mcp/config.toml)Project config (
.ensemble-mcp.toml)Environment variables (
ENSEMBLE_MCP_*)
# ~/.config/ensemble-mcp/config.toml
drift_threshold_aligned = 0.25
default_top_k = 5
cluster_similarity_threshold = 0.8Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
python -m pytest tests/ -v
# Lint
ruff check src/ tests/
# Format
ruff format src/ tests/
# Type check
mypy src/
# Build package
python -m buildDocker
docker build -t ensemble-mcp .
docker run --rm -v ~/.cache/ensemble-mcp:/home/app/.cache/ensemble-mcp ensemble-mcpEval Framework
Benchmark suite for measuring tool effectiveness:
# Run eval benchmarks
python evals/runner.py
# Or via pytest
python -m pytest evals/ -vSupported AI Tools
AI Tool | Config Format | Auto-Install |
OpenCode | JSON | Yes |
Claude Code | JSON | Yes |
GitHub Copilot (VS Code) | JSON | Yes |
Cursor | JSON | Yes |
Windsurf | JSON | Yes |
Devin CLI | JSON | Yes |
License
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
An MCP memory server. One memory your agents share — across models, devices and apps.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA sophisticated MCP server providing advanced memory capabilities with RAG, hallucination detection, and enterprise-grade AI infrastructure for intelligent agent ecosystems.-
- AlicenseAqualityAmaintenanceLocal-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.3712 npm5MIT
- AlicenseCqualityBmaintenanceAn MCP server offering hybrid memory recall and continuity tools for AI agents. It also provides a governance gateway that pre-approves risky shell/file/git actions before execution.19Apache 2.0
- FlicenseNot gradedqualityBmaintenanceAn MCP server that gives AI coding assistants durable long-term memory, reusable skills, and evidence-based decision intelligence, running fully offline with no external API keys.-