Skip to main content
Glama

Here is the complete text.

Open Notepad with:

cmd

notepad README.md Press Ctrl + A, press Delete, then copy and paste this entire block into Notepad, save (Ctrl + S), and close Notepad:

markdown

EdgeRoute ⚔

License: MIT Python 3.10+ Protocol: MCP

A sub-millisecond, self-improving "System 1" edge decision engine for AI IDEs and agents (Kiro, Cursor, Claude Code, Windsurf, Cline). EdgeRoute is a local Model Context Protocol (MCP) server that evaluates developer intent in under 2 milliseconds using an on-device linear projection head. Instead of sending every repetitive routing decision to expensive cloud LLMs, EdgeRoute classifies actions locally, abstains when uncertain, and continuously fine-tunes itself on your machine via online stochastic gradient descent (SGD).


šŸš€ Key Advantages

  • ⚔ Sub-Millisecond Decisions: Evaluates state in < 2 ms on local CPU (L1/L2 cache), with zero network latency.

  • šŸ›”ļø Calibrated Abstention Gate: Rejects false positives by abstaining whenever confidence is below 60%, delegating complex reasoning to standard LLMs.

  • šŸ”„ Local Experience Replay & On-Device SGD: Automatically adapts to your unique workflow by logging outcomes to an encrypted local SQLite buffer and running background mini-batch SGD.

  • šŸ“Š Measurable ROI Telemetry: Tracks lifetime tokens saved, developer latency eliminated, and estimated cloud cost reductions in real time.

  • šŸ”’ 100% Private & Offline: Never transmits your code, prompts, or weights to external cloud servers.


Related MCP server: local-forge

šŸ›ļø Architecture

User Prompt / Code Context │ ā–¼ [ Deterministic Feature Hasher ] (zlib CRC32 / 128-d Vector) │ ā–¼ [ Linear Softmax Head (CPU) ] (< 0.5 ms execution) │ ā”Œā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā–¼ ā–¼ Confidence >= 60% Confidence < 60% Instant Tool Execution Abstain (Fallback to Cloud LLM) │ ā–¼ [ User Feedback Signal ] │ ā–¼ [ Local SQLite Replay Buffer ] │ ā–¼ (Continuous Background Daemon) [ Mini-Batch SGD Weight Update ]


šŸ“¦ Quickstart

1. Clone & Setup

git clone https://github.com/Kedar7412/edgeroute-mcp.git
cd edgeroute-mcp
python -m venv venv
Activate virtual environment:

Windows: venv\Scripts\activate
macOS / Linux: source venv/bin/activate
2. Install Dependencies
bash


pip install -r requirements.txt
3. Seed Baseline Intelligence
bash


python seed_anchors.py
4. Interactive Live Test
bash


python interactive.py
šŸ”Œ Client Setup Guides
1. Kiro
Add to your Kiro user config (Ctrl + Shift + P → Kiro: Open user MCP config (JSON)):

json


{
  "mcpServers": {
    "edgeroute": {
      "command": "python",
      "args": ["/absolute/path/to/decision_engine_mcp.py"],
      "disabled": false,
      "autoApprove": ["*"]
    }
  }
}
To make Kiro automatically query EdgeRoute on every prompt without manual commands, create .kiro/steering/edgeroute.md:

markdown


---
inclusion: always
---
Before taking actions, query `route_decision` from `edgeroute`. If `abstained` is false, follow the recommended action. Log outcomes using `log_outcome`.
2. Cursor
Create or edit .cursor/mcp.json in your workspace root:

json


{
  "mcpServers": {
    "edgeroute": {
      "command": "python",
      "args": ["/absolute/path/to/decision_engine_mcp.py"]
    }
  }
}
3. Claude Desktop
Add to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
json


{
  "mcpServers": {
    "edgeroute": {
      "command": "python",
      "args": ["/absolute/path/to/decision_engine_mcp.py"]
    }
  }
}
4. Claude Code (CLI)
Add to your global Claude CLI configuration (~/.claude.json):

json


{
  "mcpServers": {
    "edgeroute": {
      "command": "python",
      "args": ["/absolute/path/to/decision_engine_mcp.py"]
    }
  }
}
5. Windsurf / Codeium
Open Settings → MCP Servers and add:

json


{
  "mcpServers": {
    "edgeroute": {
      "command": "python",
      "args": ["/absolute/path/to/decision_engine_mcp.py"]
    }
  }
}
6. VS Code (Cline / Roo Code)
In the Cline MCP settings tab, click Add New MCP Server and paste the JSON configuration.

šŸ› ļø MCP Tools Reference
Tool	Parameters	Description
route_decision	context: string	Evaluates prompt context in < 2 ms and returns top action, probabilities, and abstention status.
log_outcome	context: string, selected_action: string, accepted: bool	Logs user acceptance or override into the local SQLite replay buffer for future fine-tuning.
train_head	epochs: int, batch_size: int	Executes local mini-batch SGD on accumulated experience and commits updated weights.
get_savings_report	(none)	Returns a lifetime ROI summary showing tokens saved, time saved, and monetary value generated.
šŸ“„ License
Distributed under the MIT License. See LICENSE for more information.



---
### Push it to GitHub
After saving and closing Notepad, run these 3 commands in your terminal:
```cmd
git add README.md
git commit -m "docs: update full README documentation"
git push

Related MCP Connectors

Related MCP Servers