Turn an AI conversation into a real software-engineering workflow.
A local-first agent runtime that gives existing AI assistants a controlled connection to your development environment.
GitHub Β· Documentation Β· Architecture Β· Security
Modern AI assistants are excellent at reasoning, writing code, and debugging. The missing piece is direct, controlled access to the real development environment.
Normally, the workflow looks like this:
AI writes code
β
You copy it
β
You edit files
β
You run commands
β
You copy errors back
β
AI reasons again
Mediator removes that manual handoff.
βββββββββββββββββββββββ
β AI / AI CLIENT β
β ChatGPT Β· Claude Β· β
β Cursor Β· Gemini... β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β MEDIATOR β
β Agent Runtime β
β State Β· Security β
β Context Β· Tools β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β LOCAL COMPUTER β
β Files Β· Terminal β
β Git Β· Tests Β· Apps β
βββββββββββββββββββββββ
The core idea is simple:
AI thinks β Mediator orchestrates β Computer executes.
The AI remains the reasoning layer. Mediator becomes the controlled execution layer between intelligence and the local machine.
Mediator is not another AI model.
It is infrastructure for connecting existing AI intelligence to real software-engineering execution.
That means an AI can move through an engineering loop such as:
Understand
β
Inspect
β
Plan
β
Edit
β
Execute
β
Test
β
Observe failure
β
Reason
β
Fix
β
Retest
β
Verify
β
Complete
Instead of repeatedly asking the developer to move information between the AI and terminal, Mediator provides the execution bridge.
Mediator is designed around the Model Context Protocol, supporting local MCP connectivity through stdio and Streamable HTTP.
This makes it possible to connect the runtime to AI development environments and clients that understand MCP.
Mediator can orient itself inside an unfamiliar repository instead of blindly reading files.
- Ranked repository mapping
- Symbol discovery
- File and directory inspection
- Git history and status
- Structured project context
The runtime exposes controlled tools for the operations an engineering agent actually needs:
- Filesystem operations
- Terminal commands
- Git operations
- Test execution
- Process management
- Repository inspection
- Symbol discovery
- Workspace checkpoints
Tests are not treated as an opaque wall of terminal output.
Mediator can detect supported test frameworks and return structured failure information such as:
Test
File
Line
Message
Relevant output
That gives the AI useful debugging context instead of forcing it to interpret an entire raw terminal log.
Local execution is powerful, so Mediator treats the execution boundary as a first-class security surface.
The runtime includes mechanisms for:
- Workspace-bounded operations
- Permission-aware tool execution
- Controlled command execution
- Process isolation
- Prompt-injection defense scanning
- Audit-oriented execution state
- Shadow Git checkpoints
The goal is not to give an AI unrestricted shell access and hope for the best.
The goal is to create a controlled execution boundary.
Long-running processes, command output, process trees, and execution state are handled as runtime concerns rather than one-off shell calls.
On Windows, Mediator uses process-management primitives such as Job Objects to improve process-tree cleanup and isolation.
At a high level:
USER
β
βΌ
βββββββββββββββββββββ
β AI INTERFACE β
β ChatGPT / Claude β
β Cursor / MCP ... β
βββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββββ
β BROWSER / CLIENT β
β BRIDGE β
βββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββ
β MEDIATOR β
β β
β Transport β
β β β
β Protocol β
β β β
β Security Broker β
β β β
β Agent / Session Runtime β
β β β
β Context + Planning β
β β β
β Tool Registry + Executor β
ββββββββββββββββ€ββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
βΌ βΌ βΌ
Filesystem Terminal Git
β β β
ββββββββββββββββΌβββββββββββββββ
βΌ
Tests / Apps
β
βΌ
Tool Result
β
βΌ
AI
For the detailed architecture, see docs/04_SYSTEM_ARCHITECTURE.md.
The project is intentionally built around a simple separation of responsibilities:
| Layer | Responsibility |
|---|---|
| AI | Intelligence, reasoning, planning, coding, debugging |
| Mediator | Orchestration, state, security, context, execution |
| Tools | Filesystem, terminal, Git, tests, processes |
| Project Context | Repository structure, symbols, history |
| Client / Extension | Bridge between the AI interface and Mediator |
| User | Direction, approval, and control |
This separation is one of the core architectural principles of the project.
- Python 3.13+
ripgrepavailable onPATH(for fast code search and symbols)- Node.js 18+ (for developing or building the React dashboard)
- Git
- A supported MCP-capable AI client (Claude Desktop, Cursor, etc.) or the Mediator Chrome extension
git clone https://github.com/codeseeboy/Mediator-code.git
cd Mediator-codeYou can use either uv (recommended) or standard pip:
Using uv:
# Sync environment with dependencies
uv syncUsing pip / virtual environment:
python -m venv .venv
# On Windows: .venv\Scripts\activate
# On macOS/Linux: source .venv/bin/activate
pip install -e ".[dev]"The React frontend ships inside the Python package in mediator/ui/dist:
cd ui
npm install
npm run build
cd ..Verify your installation by running the automated tests:
uv run pytest
# or: pytestRun the Mediator runtime server bound to loopback:
uv run mediator --workspace .
# or: python -m mediator --workspace .The control center dashboard will be live at:
π http://127.0.0.1:8765/
For Claude Desktop, Cursor, Cline, or other MCP stdio clients:
uv run mediator-mcp
# or: mediator-mcpSee
docs/16_MCP_INTEGRATION.mdanddocs/17_MCP_QUICKSTARTS.mdfor ready-to-use client configuration snippets.
- Open Chrome and navigate to
chrome://extensions. - Enable Developer mode in the top-right corner.
- Click Load unpacked and select the
extension/directory. - Open the extension popup, ensure it connects to
ws://127.0.0.1:8765/ws, and start collaborating!
Mediator/
β
βββ mediator/ # Core local agent runtime (Python)
β βββ agent/ # Agent runtime, session registry, loops & directives
β βββ context/ # Repository map, PageRank scoring, primer & activity
β βββ events/ # Event bus and state transitions
β βββ mcp/ # MCP Streamable HTTP, stdio & WebMCP bridge
β βββ protocol/ # Typed message definitions and envelopes
β βββ security/ # Security broker, permissions & execution policies
β βββ tools/ # Tool implementations (terminal, filesystem, git, tests, processes)
β βββ ui/dist/ # Built static assets for the React control center
β
βββ ui/ # Control center frontend source (React 18 + TypeScript + Vite)
β
βββ extension/ # Chrome browser extension (Manifest V3)
β βββ background/ # Service worker & background bridge
β βββ content/ # Web content parsers & provider bridges
β βββ protocol/ # Browser-side message handling
β βββ ui/ # Extension popup interface
β
βββ tests/ # 685+ automated unit and integration tests
β
βββ docs/ # Comprehensive architecture, security, and design specs
β βββ 00_COMPLETE_DOCUMENTATION.md
β βββ 04_SYSTEM_ARCHITECTURE.md
β βββ 08_SECURITY_SPECIFICATION.md
β βββ Importants/ # Extension specs & blueprints
β
βββ scripts/ # E2E test harnesses and automation scripts
β
βββ pyproject.toml # Python package build definition (PEP 621 / hatchling)
βββ uv.lock # Deterministic dependency lockfile
βββ README.md # Project documentation entry point
The repository contains a detailed engineering documentation set covering the product from concept through implementation.
docs/00_COMPLETE_DOCUMENTATION.mdβ complete project referencedocs/01_PRODUCT_DEFINITION.mdβ product vision and scopedocs/02_PRD.mdβ product requirementsdocs/03_SRS.mdβ software requirementsdocs/04_SYSTEM_ARCHITECTURE.mdβ system architecturedocs/05_AGENT_PROTOCOL.mdβ agent protocoldocs/06_TOOL_SPECIFICATION.mdβ tool contractsdocs/08_SECURITY_SPECIFICATION.mdβ security modeldocs/10_UX_SPECIFICATION.mdβ UX architecturedocs/15_MEDIATOR_V2_ROADMAP.mdβ current V2 roadmapdocs/16_MCP_INTEGRATION.mdβ MCP integrationdocs/17_MCP_QUICKSTARTS.mdβ MCP setup guidesdocs/18_M5_IDE_RUNTIME.mdβ IDE/runtime direction
Mediator is being built around a few non-negotiable principles:
Local-first
The execution runtime lives close to the developer's machine and projects.
AI-agnostic
The runtime should not depend on a single model provider for its intelligence layer.
Controlled execution
Tools should have explicit boundaries instead of unrestricted access.
Observable execution
The user and AI should be able to understand what is happening and why.
Stateful engineering loops
The runtime should preserve enough execution context to support real multi-step work.
Verification over assumption
A successful file write is not the same thing as a working feature. Builds, tests, health checks and process state matter.
Modular evolution
Transport, protocol, security, tools, context and UI should evolve independently where possible.
Mediator is not trying to replace every AI coding tool with another model or another chat interface.
It is an execution and coordination layer.
The core proposition is:
Use the AI you already trust. Give it a controlled way to work with the computer you already use.
That distinction is central to the project.
Mediator is an actively evolving engineering project.
The repository already contains the core runtime architecture, MCP integration, tool system, context layer, security components, browser integration, UI work and an extensive automated test suite. Some integrations and higher-level agent capabilities are still evolving.
For the most accurate implementation status, see docs/15_MEDIATOR_V2_ROADMAP.md.
Mediator is being developed as an open-source project and contributions are welcome.
Before making substantial changes, start with:
docs/01_PRODUCT_DEFINITION.mddocs/04_SYSTEM_ARCHITECTURE.mddocs/05_AGENT_PROTOCOL.mddocs/06_TOOL_SPECIFICATION.mddocs/13_DECISIONS.mddocs/15_MEDIATOR_V2_ROADMAP.md
The project is large enough that understanding the architecture before changing a subsystem will save time.
Mediator executes operations against real development environments. Treat security as part of the product, not an optional feature.
If you discover a security issue, please avoid publishing sensitive exploit details in a public issue until the issue has been responsibly assessed.
See docs/08_SECURITY_SPECIFICATION.md for the project's security model.
Mediator is released under a Source-Available Non-Commercial & Anti-Plagiarism License.
- You are welcome to inspect, build, and use this software locally for personal, educational, and evaluation purposes.
- Re-branding, re-publishing, commercial exploitation, or claiming ownership of this architecture or implementation is strictly prohibited.
See LICENSE for the full legal terms.
Mediator
AI intelligence. Local execution. One engineering loop.