{"id":35631862,"url":"https://github.com/forge18/agent-router-mcp","last_synced_at":"2026-01-26T14:33:55.897Z","repository":{"id":332410158,"uuid":"1128085508","full_name":"forge18/agent-router-mcp","owner":"forge18","description":"Intelligent MCP router for AI subagents with config-driven rules and LLM semantic tagging","archived":false,"fork":false,"pushed_at":"2026-01-13T02:11:48.000Z","size":111,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T19:49:43.392Z","etag":null,"topics":["agent-routing","ai-agents","ai-orchestration","config-driven","intelligent-router","llm","mcp","model-context-protocol","ollama","rust","semantic-routing","subagent-routing","subagents"],"latest_commit_sha":null,"homepage":"https://github.com/forge18/agent-router-mcp","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forge18.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-05T05:47:34.000Z","updated_at":"2026-01-07T02:17:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/forge18/agent-router-mcp","commit_stats":null,"previous_names":["forge18/agent-router-mcp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/forge18/agent-router-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forge18%2Fagent-router-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forge18%2Fagent-router-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forge18%2Fagent-router-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forge18%2Fagent-router-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forge18","download_url":"https://codeload.github.com/forge18/agent-router-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forge18%2Fagent-router-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-routing","ai-agents","ai-orchestration","config-driven","intelligent-router","llm","mcp","model-context-protocol","ollama","rust","semantic-routing","subagent-routing","subagents"],"created_at":"2026-01-05T09:12:44.965Z","updated_at":"2026-01-26T14:33:55.891Z","avatar_url":"https://github.com/forge18.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent Router MCP\n\n![Beta](https://img.shields.io/badge/status-beta-yellow)\n![Build Status](https://github.com/forge18/agent-router-mcp/actions/workflows/ci.yml/badge.svg)\n![License](https://img.shields.io/badge/license-MIT-blue)\n\n\u003e **Beta Software** - This project is functional and tested. Feedback and bug reports are welcome.\n\nA **stateless, config-driven** Model Context Protocol (MCP) server that intelligently routes requests to specialized AI subagents using a hybrid rule-based + LLM approach.\n\n## Table of Contents\n\n**Getting Started**\n- [Key Features](#key-features)\n- [Requirements](#requirements)\n- [Quick Start Installation](#quick-start-installation)\n  - [1. Download Binary](#1-download-binary)\n  - [2. Download Config Files](#2-download-config-files)\n  - [3. Configure MCP Client](#3-configure-mcp-client)\n\n**Using the Server**\n- [MCP Tools Reference](#mcp-tools-reference)\n  - [get_routing](#get_routing)\n  - [start_ollama](#start_ollama)\n  - [pull_model](#pull_model)\n  - [load_model](#load_model)\n- [How It Works](#how-it-works)\n\n**Configuration**\n- [Configuration Files](#configuration-files)\n  - [agents.json](#configagentsjson)\n  - [rules.json](#configrulesjson)\n  - [llm-tags.json](#configllm-tagsjson)\n- [Customization Examples](#customization-examples)\n- [Model Switching](#model-switching)\n\n**Advanced Topics**\n- [Architecture](#architecture)\n- [Creating Agents/Subagents](#creating-agentssubagents)\n- [Cross-Platform Support](#cross-platform-support)\n- [Compiling from Source](#compiling-from-source)\n- [Development](#development)\n\n---\n\n## Key Features\n\n- 🔧 **Fully Config-Driven**: All routing logic defined in JSON - no code changes needed\n- 🚀 **Stateless Architecture**: No state between requests, configs loaded once on startup\n- ⚡ **Fast Routing**: Rule-based matching handles 90%+ of cases locally\n- 🧠 **LLM Semantic Tagging**: Uses any Ollama model for edge cases and semantic understanding\n- 🔄 **Flexible Rules**: Boolean logic (any_of, all_of) with nesting support\n- 📝 **User Customizable**: Define your own agents, tags, and routing rules\n\n## Requirements\n\n### Software\n- Rust 1.70+\n- Ollama installed and in PATH\n\n### Hardware\n- **RAM**: 8GB minimum (for 3B models like `smollm3:3b`)\n  - 16GB recommended for better performance and multitasking\n  - Larger models require more RAM (7B models need 16GB, 13B models need 32GB)\n- **Disk Space**: ~2GB for default model\n  - Varies by model size and quantization\n\n## Quick Start Installation\n\n\u003e **Prerequisites:** Make sure [Ollama](https://ollama.com) is installed and running. See [Requirements](#requirements) above.\n\n### 1. Download Binary\n\nDownload the latest release from [GitHub Releases](https://github.com/yourusername/agent-router-mcp/releases) for your platform:\n\n**Choose Your Binary:**\n- **Windows Intel/AMD**: `agent-router-mcp-windows-amd64.exe` (Most Windows PCs)\n- **Windows ARM**: `agent-router-mcp-windows-arm64.exe` (Surface Pro X, Windows Dev Kit 2023)\n- **macOS Intel**: `agent-router-mcp-macos-intel` (Intel Macs)\n- **macOS Apple Silicon**: `agent-router-mcp-macos-silicon` (M1/M2/M3 Macs)\n- **Linux Intel/AMD**: `agent-router-mcp-linux-amd64` (Most PCs/servers)\n- **Linux ARM**: `agent-router-mcp-linux-arm64` (Raspberry Pi 4+, AWS Graviton)\n\n**Not sure which binary?** On the command line:\n- **Linux/macOS**: Run `uname -m`\n  - Output `x86_64` → use `amd64`\n  - Output `aarch64` or `arm64` → use `arm64`\n- **Windows**: Run `echo %PROCESSOR_ARCHITECTURE%`\n  - Output `AMD64` → use `windows-amd64.exe`\n  - Output `ARM64` → use `windows-arm64.exe`\n\n**macOS/Linux**: Make it executable\n```bash\nchmod +x agent-router-mcp-*\n```\n\n### 2. Download Config Files\n\nDownload the config archive from [GitHub Releases](https://github.com/yourusername/agent-router-mcp/releases):\n- **Windows**: Download `agent-router-mcp-config.zip` and extract\n- **macOS/Linux**: Download `agent-router-mcp-config.tar.gz` and extract with `tar -xzf agent-router-mcp-config.tar.gz`\n\nPlace the extracted files in a folder (e.g., `C:\\agent-configs\\` on Windows or `~/agent-configs/` on macOS/Linux).\n\nAlternatively, download individual files:\n- [agents.json](https://raw.githubusercontent.com/yourusername/agent-router-mcp/main/config/agents.json)\n- [rules.json](https://raw.githubusercontent.com/yourusername/agent-router-mcp/main/config/rules.json)\n- [llm-tags.json](https://raw.githubusercontent.com/yourusername/agent-router-mcp/main/config/llm-tags.json)\n\n### 3. Configure MCP Client\n\nAdd to your MCP client's configuration file (location varies by client - check your client's documentation).\n\n**Example (Windows)**:\n```json\n{\n  \"mcpServers\": {\n    \"agent-router\": {\n      \"type\": \"stdio\",\n      \"command\": \"C:\\\\path\\\\to\\\\agent-router-mcp.exe\",\n      \"env\": {\n        \"OLLAMA_URL\": \"http://localhost:11434\",\n        \"MODEL_SOURCE\": \"huggingface\",\n        \"MODEL_NAME\": \"unsloth/SmolLM3-3B-128K-GGUF\",\n        \"AGENTS_CONFIG_PATH\": \"C:\\\\agent-configs\\\\agents.json\",\n        \"LLM_TAGS_CONFIG_PATH\": \"C:\\\\agent-configs\\\\llm-tags.json\",\n        \"RULES_CONFIG_PATH\": \"C:\\\\agent-configs\\\\rules.json\"\n      }\n    }\n  }\n}\n```\n\n**Example (macOS/Linux)**:\n```json\n{\n  \"mcpServers\": {\n    \"agent-router\": {\n      \"type\": \"stdio\",\n      \"command\": \"/path/to/agent-router-mcp\",\n      \"env\": {\n        \"OLLAMA_URL\": \"http://localhost:11434\",\n        \"MODEL_SOURCE\": \"huggingface\",\n        \"MODEL_NAME\": \"unsloth/SmolLM3-3B-128K-GGUF\",\n        \"AGENTS_CONFIG_PATH\": \"/Users/me/agent-configs/agents.json\",\n        \"LLM_TAGS_CONFIG_PATH\": \"/Users/me/agent-configs/llm-tags.json\",\n        \"RULES_CONFIG_PATH\": \"/Users/me/agent-configs/rules.json\"\n      }\n    }\n  }\n}\n```\n\nReplace the paths with your actual file locations.\n\n---\n\n## MCP Tools Reference\n\nThe server exposes 2 tools for managing Ollama and getting routing instructions:\n\n### `init_llm`\n\nInitialize the LLM environment. This tool:\n1. Checks if Ollama is installed\n2. Starts Ollama if not running\n3. Pulls the configured model if not downloaded\n4. Loads the model into memory\n\nCall this once before using `get_instructions`.\n\n**Input:** None required\n\n**Output (Success):**\n```json\n{\n  \"success\": true,\n  \"message\": \"LLM ready for routing\",\n  \"steps_performed\": [\n    \"Ollama already running\",\n    \"Model unsloth/SmolLM3-3B-128K-GGUF already installed\",\n    \"Model unsloth/SmolLM3-3B-128K-GGUF already loaded\"\n  ]\n}\n```\n\n### `get_instructions`\n\nGet routing instructions for a user request. **This is the main tool** that performs intelligent routing.\n\n**Input:**\n```json\n{\n  \"task\": \"Fix the authentication bug\",\n  \"intent\": \"review code before commit\",\n  \"original_prompt\": \"Can you fix the login issue in auth.ts?\",\n  \"associated_files\": [\"src/auth.ts\", \"src/middleware/auth.ts\"]\n}\n```\n\n- `task` (required): What the agent is doing - the current task or action being performed\n- `intent` (required): The agent's intent for this tool call (e.g., \"review code before commit\", \"help debug an issue\", \"prepare for pull request\")\n- `original_prompt` (optional): The original user request, preserved for better LLM semantic tagging. Useful when `task` is a summary or derivative of the original request.\n- `associated_files` (optional): List of file paths relevant to this task, used for file-based routing rules. If not provided, no file-based rules will match.\n\nNote: Git context (branch only) is **auto-detected** from the current working directory for branch-based routing rules.\n\n**Output (Success):**\n```json\n{\n  \"instructions\": [\n    {\n      \"trigger\": {\n        \"name\": \"file_pattern\",\n        \"description\": \"*auth*\"\n      },\n      \"context\": {\n        \"instructions\": \"Review authentication code for security vulnerabilities\",\n        \"files\": [\"src/auth.ts\", \"src/middleware/auth.ts\"],\n        \"confidence\": 100,\n        \"priority\": 80\n      },\n      \"route_to_agent\": {\n        \"name\": \"security-auditor\",\n        \"description\": \"Reviews code for security vulnerabilities, secrets, supply chain attacks\"\n      }\n    },\n    {\n      \"trigger\": {\n        \"name\": \"file_pattern\",\n        \"description\": \"*.ts\"\n      },\n      \"context\": {\n        \"instructions\": null,\n        \"files\": [\"src/auth.ts\", \"src/middleware/auth.ts\"],\n        \"confidence\": 100,\n        \"priority\": 50\n      },\n      \"route_to_agent\": {\n        \"name\": \"language-reviewer-typescript\",\n        \"description\": \"TypeScript-specific patterns and best practices\"\n      }\n    }\n  ]\n}\n```\n\n**Response Fields:**\n\n| Field | Description |\n|-------|-------------|\n| `instructions` | Array of routing instructions, one per agent to invoke |\n| `trigger.name` | What triggered the routing: `file_pattern`, `file_regex`, `branch_regex`, `prompt_regex`, `llm_tag` |\n| `trigger.description` | The specific pattern or tag that matched (e.g., `*.ts`, `security-concern`) |\n| `context.instructions` | Optional agent-specific instructions from the agent definition |\n| `context.files` | Files that triggered this routing (subset of input files) |\n| `context.confidence` | 0-100 confidence level (100 = deterministic rule match, 85 = LLM tag match) |\n| `context.priority` | 0-100 priority level from agent definition (higher = more important) |\n| `route_to_agent.name` | Agent name to route to |\n| `route_to_agent.description` | Agent description from config |\n\n**Output (Prerequisites Not Met):**\n\nThe tool performs automatic prerequisite checks and returns helpful error messages:\n\n```json\n{\"error\": \"Ollama is not running. Run init_llm first to start Ollama and load the model.\"}\n```\n```json\n{\"error\": \"Model not loaded into memory. Run init_llm to load it.\"}\n```\n\nWhen you receive these errors, call `init_llm` first.\n\n---\n\n## How It Works\n\n1. **Stateless**: No state maintained between requests\n2. **Config Loading**: Loads `agents.json`, `rules.json`, `llm-tags.json` on startup\n3. **Git Context**: Auto-detects branch from current directory (for branch-based rules)\n4. **LLM Tagging**: Analyzes **task, intent, and original_prompt** to identify semantic tags\n5. **Rule Matching**: Evaluates ALL rules (file patterns, regex, branch patterns, AND tag-based)\n6. **Return**: JSON result with routing instructions (empty result is valid if no rules match)\n\n---\n\n## Configuration Files\n\nAll routing logic lives in `config/*.json` - edit these to customize behavior:\n\n### `config/agents.json`\n\nDefine available subagents with optional instructions and priority:\n\n```json\n{\n  \"agents\": [\n    {\n      \"name\": \"security-auditor\",\n      \"description\": \"Reviews code for security vulnerabilities, secrets, supply chain attacks\",\n      \"instructions\": \"Focus on OWASP Top 10 vulnerabilities and secret exposure\",\n      \"priority\": 80\n    },\n    {\n      \"name\": \"language-reviewer-typescript\",\n      \"description\": \"TypeScript-specific patterns and best practices\",\n      \"priority\": 50\n    }\n  ]\n}\n```\n\n**Agent Fields:**\n\n| Field | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `name` | Yes | - | Unique agent identifier |\n| `description` | Yes | - | What this agent does (shown in routing response) |\n| `instructions` | No | null | Agent-specific instructions included in routing response |\n| `priority` | No | 50 | 0-100 priority level (higher = more important) |\n\n### `config/rules.json`\n\nDefine routing rules with boolean logic:\n\n```json\n{\n  \"rules\": [\n    {\n      \"description\": \"Route TypeScript files to TS reviewer\",\n      \"conditions\": {\n        \"any_of\": [\n          {\"file_pattern\": \"*.ts\"},\n          {\"file_pattern\": \"*.tsx\"}\n        ]\n      },\n      \"route_to_subagents\": [\"language-reviewer-typescript\"]\n    },\n    {\n      \"description\": \"Security files AND security tag → security auditor\",\n      \"conditions\": {\n        \"all_of\": [\n          {\"file_pattern\": \"*auth*\"},\n          {\"llm_tag\": \"security-concern\"}\n        ]\n      },\n      \"route_to_subagents\": [\"security-auditor\", \"code-reviewer\"]\n    },\n    {\n      \"description\": \"Commit intent triggers code review\",\n      \"conditions\": {\n        \"llm_tag\": \"commit-review\"\n      },\n      \"route_to_subagents\": [\"code-reviewer\"]\n    },\n    {\n      \"description\": \"PR intent triggers code review\",\n      \"conditions\": {\n        \"llm_tag\": \"pull-request\"\n      },\n      \"route_to_subagents\": [\"code-reviewer\"]\n    }\n  ]\n}\n```\n\n**Supported Conditions:**\n- `file_pattern` - Glob match on file paths (e.g., `*.ts`, `*auth*`)\n- `file_regex` - Regex match on file paths\n- `prompt_regex` - Regex match on task, intent, or original_prompt\n- `branch_regex` - Regex match on git branch name\n- `llm_tag` - Match LLM-identified semantic tags (LLM analyzes task, intent, and original_prompt)\n\n**Boolean Logic:**\n- `any_of` - OR logic (match if ANY condition is true)\n- `all_of` - AND logic (match if ALL conditions are true)\n- Supports nesting for complex rules\n\n### `config/llm-tags.json`\n\nDefine semantic tags for LLM to identify. The LLM analyzes **task, intent, and original_prompt** when identifying tags:\n\n```json\n{\n  \"tags\": [\n    {\n      \"name\": \"commit-review\",\n      \"description\": \"Intent indicates preparing for a commit, pre-commit review, or finalizing changes\",\n      \"examples\": [\n        \"review before commit\",\n        \"pre-commit check\",\n        \"finalize changes\"\n      ]\n    },\n    {\n      \"name\": \"pull-request\",\n      \"description\": \"Intent indicates preparing a pull request or code review for merge\",\n      \"examples\": [\n        \"create pull request\",\n        \"prepare PR\",\n        \"ready for review\"\n      ]\n    },\n    {\n      \"name\": \"security-concern\",\n      \"description\": \"Code that handles authentication, authorization, encryption, secrets...\",\n      \"examples\": [\n        \"JWT token generation\",\n        \"Password hashing\",\n        \"API key handling\"\n      ]\n    }\n  ]\n}\n```\n\n## Customization Examples\n\n### Add a New Agent\n\nEdit `config/agents.json`:\n```json\n{\n  \"agents\": [\n    {\n      \"name\": \"my-custom-agent\",\n      \"description\": \"Does something special\"\n    }\n  ]\n}\n```\n\n### Add a Routing Rule\n\nEdit `config/rules.json`:\n```json\n{\n  \"rules\": [\n    {\n      \"description\": \"Route GraphQL files to API specialist\",\n      \"conditions\": {\n        \"file_pattern\": \"*.graphql\"\n      },\n      \"route_to_subagents\": [\"api-specialist\"]\n    },\n    {\n      \"description\": \"Performance-critical code on hotfix branch\",\n      \"conditions\": {\n        \"all_of\": [\n          {\"llm_tag\": \"performance-critical\"},\n          {\"branch_regex\": \"^hotfix/.*\"}\n        ]\n      },\n      \"route_to_subagents\": [\"performance-optimizer\", \"code-reviewer\"]\n    }\n  ]\n}\n```\n\n### Add a Custom LLM Tag\n\nEdit `config/llm-tags.json`:\n```json\n{\n  \"tags\": [\n    {\n      \"name\": \"error-handling\",\n      \"description\": \"Code that handles errors, exceptions, or error states\",\n      \"examples\": [\n        \"try-catch blocks\",\n        \"error boundaries\",\n        \"Result types\"\n      ]\n    }\n  ]\n}\n```\n\n## Model Switching\n\nThe router supports models from **two sources**:\n\n### Model Sources\n\n| Source | `MODEL_SOURCE` | Model Name Format | Example |\n|--------|---------------|-------------------|---------|\n| **HuggingFace** (default) | `huggingface` | `username/repo-name` | `unsloth/SmolLM3-3B-128K-GGUF` |\n| **Ollama** | `ollama` | `model:tag` | `llama3.2:3b` |\n\n### Using HuggingFace Models (Default)\n\nHuggingFace offers thousands of GGUF models. The router automatically prefixes with `hf.co/` when pulling:\n\n```bash\n# Default: HuggingFace SmolLM3\nexport MODEL_SOURCE=\"huggingface\"\nexport MODEL_NAME=\"unsloth/SmolLM3-3B-128K-GGUF\"\n\n# Other HuggingFace models\nexport MODEL_NAME=\"bartowski/Qwen2.5-3B-Instruct-GGUF\"\nexport MODEL_NAME=\"TheBloke/Llama-2-7B-GGUF\"\n```\n\nBrowse HuggingFace GGUF models: https://huggingface.co/models?library=gguf\n\n### Using Ollama Models\n\nFor models from Ollama's native library:\n\n```bash\nexport MODEL_SOURCE=\"ollama\"\nexport MODEL_NAME=\"llama3.2:3b\"\n\n# Try different models\nollama pull granite4-h-micro:3b\nexport MODEL_NAME=\"granite4-h-micro:3b\"\n\nollama pull qwen2.5:3b\nexport MODEL_NAME=\"qwen2.5:3b\"\n```\n\n**Popular Ollama models:**\n\n| Model | Size | Best For |\n|-------|------|----------|\n| `smollm3:3b` | 3B | Balanced, fast |\n| `granite4-h-micro:3b` | 3B | Instruction following |\n| `llama3.2:3b` | 3B | General purpose |\n| `qwen2.5:3b` | 3B | Code understanding |\n| `phi3:3.8b` | 3.8B | Reasoning |\n\nBrowse Ollama models: https://ollama.com/library\n\n### LM Studio Support (Coming Soon)\n\nLM Studio backend support is planned, allowing LM Studio as an alternative to Ollama.\n\n### Advanced LLM Configuration\n\n| Environment Variable | Default | Description |\n|---------------------|---------|-------------|\n| `THINKING_MODE` | `true` | Enable thinking/reasoning mode for supported models |\n| `TEMPERATURE` | `0.1` | LLM temperature (0.0-1.0). Lower = more deterministic |\n\n**Thinking Mode**: When enabled and the model supports it, the LLM will reason through its decisions before answering. This can improve classification accuracy for ambiguous requests.\n\nSupported thinking models:\n- `deepseek-r1` - DeepSeek's reasoning model\n- `qwen3`, `qwen2.5` - Alibaba's multilingual models\n- `cogito` - Specialized thinking model\n- `qwq` - QwQ reasoning model\n\n```bash\n# Disable thinking mode (if model doesn't support it well)\nexport THINKING_MODE=false\n\n# Use lower temperature for more deterministic results\nexport TEMPERATURE=0.05\n```\n\n---\n\n## Architecture\n\nThis MCP is a **pure router** - it doesn't execute agents, it just determines which subagents should handle a request.\n\n### Flow Diagram\n\n```\nAgent Call\n  ├─ Task: \"Fix auth bug\"\n  ├─ Intent: \"review code before commit\"\n  ├─ Original Prompt: \"Can you fix the login issue?\" (optional)\n  └─ Associated Files: [\"src/auth.ts\"] (provided by caller)\n       ↓\n┌──────────────────────────────────────────────────┐\n│  Agent Router MCP (Stateless Router)             │\n│                                                  │\n│  1. Load Configs                                 │\n│     • agents.json (agent definitions)            │\n│     • rules.json (routing rules)                 │\n│     • llm-tags.json (semantic tags)              │\n│                                                  │\n│  2. Auto-Detect Git Context                      │\n│     • Branch only (for branch-based rules)       │\n│                                                  │\n│  3. LLM Semantic Tagging                         │\n│     • Analyzes task + intent + original_prompt   │\n│     • Returns: [\"security-concern\",              │\n│                 \"commit-review\"]                 │\n│                                                  │\n│  4. Apply ALL Rules                              │\n│     • File patterns: *.ts → ts-reviewer          │\n│     • File patterns: *auth* → security-auditor   │\n│     • Branch regex: feature/* → code-reviewer    │\n│     • LLM tags: security-concern → auditor       │\n│     • LLM tags: commit-review → code-reviewer    │\n│                                                  │\n│  5. Return Results                               │\n│     • Empty result is valid (no rules matched)   │\n└──────────────────────────────────────────────────┘\n       ↓\nRouting Result\n  ├─ Agents: [language-reviewer-typescript, security-auditor, code-reviewer]\n  ├─ Method: \"rules+llm-tags\"\n  └─ Reasoning: \"Rules + LLM semantic tags\"\n```\n\n**Example Agent Names (included in default config):**\n- **Language Reviewers**: `language-reviewer-typescript`, `language-reviewer-rust`, `language-reviewer-python`, `language-reviewer-javascript`, `language-reviewer-csharp`, `language-reviewer-lua`, `language-reviewer-zig`, `language-reviewer-gdscript`\n- **Security \u0026 Quality**: `security-auditor`, `code-reviewer`\n- **Testing**: `test-engineer-junior`, `test-engineer-midlevel`, `test-engineer-senior`\n- **DevOps**: `devops-engineer-junior`, `devops-engineer-midlevel`, `devops-engineer-senior`\n- **Specialized**: `planning-architect`, `documentation-writer`, `performance-optimizer`, `accessibility-specialist`\n\n\u003e **Note:** These are just names for routing. Your actual subagents live elsewhere (e.g., as separate MCP tools, CLI commands, or API endpoints).\n\n## Creating Agents/Subagents\n\nThis router determines which agents should handle requests. You need to create the actual agent implementations in your IDE.\n\n### Natively Supported\n\nThese platforms have built-in agent support:\n\n#### Claude Code (Sub-Agents)\n- Agents are markdown files with YAML frontmatter in `.claude/agents/`\n- Supports per-agent model selection (`model: sonnet`, `opus`, `haiku`)\n- Full documentation: [Claude Code Agents](https://github.com/anthropics/claude-code)\n\n#### GitHub Copilot (Custom Agents)\n- Agents are markdown files in `.github/agents/` or `{org}/.github/agents/`\n- Supports custom prompts, tool selection, and MCP servers\n- Full documentation: [GitHub Copilot Custom Agents](https://github.blog/changelog/2025-10-28-custom-agents-for-github-copilot/)\n\n#### OpenCode (Agents/Subagents)\n- Agents are markdown files in `~/.config/opencode/agent/` or `.opencode/agent/`\n- Supports per-agent model selection and tool permissions\n- Full documentation: [OpenCode Agents](https://opencode.ai/docs/agents/)\n\n### Workarounds Available\n\nThese platforms can use this router via MCP integration or workarounds:\n\n- **Cursor** - Use via MCP integration (agent functionality in development)\n- **Windsurf** - Use via MCP integration\n- **Cline** - Use via MCP integration\n- **Roo** - Use via MCP integration\n\n## Cross-Platform Support\n\nThis MCP server works on all major platforms. Ollama installation varies by platform:\n\n| Platform | Installation | Service Behavior |\n|----------|-------------|------------------|\n| **macOS** | `brew install ollama` | Runs as background service automatically |\n| **Linux** | `curl -fsSL https://ollama.com/install.sh \\| sh` | Start with `ollama serve` |\n| **Windows** | Download from [ollama.com](https://ollama.com) | Runs as Windows service automatically |\n\n## Compiling from Source\n\nIf you prefer to build from source instead of downloading pre-built binaries:\n\n### Prerequisites\n\n- **Rust 1.70+**: Install from [rustup.rs](https://rustup.rs)\n- **For cross-compilation (optional)**:\n  - Zig: `brew install zig` (macOS) or [download from zig.dev](https://ziglang.org/download/)\n  - MinGW-w64 (for Windows builds): `brew install mingw-w64` (macOS)\n\n### Quick Build (Current Platform)\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/agent-router-mcp.git\ncd agent-router-mcp\n\n# Build using the build script\n./scripts/build-all.sh\n\n# Binaries will be created in dist/\n```\n\n### Cross-Platform Build (All Targets)\n\nTo build binaries for all platforms (Linux, macOS, Windows):\n\n```bash\n# Install prerequisites (macOS)\nbrew install zig mingw-w64\n\n# Install cargo-zigbuild\ncargo install cargo-zigbuild\n\n# Build for all platforms\n./scripts/build-all.sh\n\n# Binaries will be created in dist/:\n# - agent-router-mcp-linux-amd64\n# - agent-router-mcp-linux-arm64\n# - agent-router-mcp-macos-intel\n# - agent-router-mcp-macos-silicon\n# - agent-router-mcp-windows-amd64.exe\n# - agent-router-mcp-windows-arm64.exe\n```\n\n### Manual Build\n\n```bash\n# Build for current platform\ncargo build --release\n\n# Binary will be at: target/release/agent-router-mcp\n# (or target/release/agent-router-mcp.exe on Windows)\n```\n\n## Development\n\n```bash\n# Run tests\ncargo test\n\n# Run with debug logging\nRUST_LOG=debug cargo run\n\n# Format code\ncargo fmt\n\n# Lint\ncargo clippy\n\n# Build for development\ncargo build\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforge18%2Fagent-router-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforge18%2Fagent-router-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforge18%2Fagent-router-mcp/lists"}