Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mediator

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

Python Tests MCP License


What is Mediator?

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.


Why Mediator?

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.


Core Capabilities

πŸ”Œ MCP-first connectivity

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.

🧠 Project-aware context

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

πŸ› οΈ Real engineering tools

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

πŸ§ͺ Structured verification

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.

πŸ” Security and control

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.

⚑ Process-aware execution

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.


Architecture

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 Mediator Mental Model

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.


Getting Started

Requirements

  • Python 3.13+
  • ripgrep available on PATH (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

1. Clone the Repository

git clone https://github.com/codeseeboy/Mediator-code.git
cd Mediator-code

2. Environment Setup

You can use either uv (recommended) or standard pip:

Using uv:

# Sync environment with dependencies
uv sync

Using pip / virtual environment:

python -m venv .venv
# On Windows: .venv\Scripts\activate
# On macOS/Linux: source .venv/bin/activate
pip install -e ".[dev]"

3. Build the Control Center Dashboard

The React frontend ships inside the Python package in mediator/ui/dist:

cd ui
npm install
npm run build
cd ..

4. Run the Test Suite

Verify your installation by running the automated tests:

uv run pytest
# or: pytest

5. Start Mediator

Run 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/

6. Connect via MCP (Model Context Protocol)

For Claude Desktop, Cursor, Cline, or other MCP stdio clients:

uv run mediator-mcp
# or: mediator-mcp

See docs/16_MCP_INTEGRATION.md and docs/17_MCP_QUICKSTARTS.md for ready-to-use client configuration snippets.

7. Connect via Chrome Extension

  1. Open Chrome and navigate to chrome://extensions.
  2. Enable Developer mode in the top-right corner.
  3. Click Load unpacked and select the extension/ directory.
  4. Open the extension popup, ensure it connects to ws://127.0.0.1:8765/ws, and start collaborating!

Repository Structure

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

Documentation

The repository contains a detailed engineering documentation set covering the product from concept through implementation.

Start here


Design Principles

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.


What Mediator Is Not

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.


Project Status

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.


Contributing

Mediator is being developed as an open-source project and contributions are welcome.

Before making substantial changes, start with:

  1. docs/01_PRODUCT_DEFINITION.md
  2. docs/04_SYSTEM_ARCHITECTURE.md
  3. docs/05_AGENT_PROTOCOL.md
  4. docs/06_TOOL_SPECIFICATION.md
  5. docs/13_DECISIONS.md
  6. docs/15_MEDIATOR_V2_ROADMAP.md

The project is large enough that understanding the architecture before changing a subsystem will save time.


Security

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.


License

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages