MSG - MCP Swarm Gateway
Turns web-based AIs into full-powered agents with local PC access, 33 tools across 8 categories, and parallel swarm orchestration with real-time validation.
README
MSG - MCP Swarm Gateway
Universal MCP Bridge + Multi-Agent Swarm Orchestrator
Turn any web-based AI (ChatGPT, Claude, Grok, Kimi, DeepSeek, Gemini) into a full-powered agent with access to your local PC, terminal, browser, and code execution - with a swarm of parallel agents validated in real-time.
What Makes MSG Different
| Feature | MCP SuperAssistant | Other Tools | MSG |
|---|---|---|---|
| Web AI Chat Support | 11 platforms | 2-5 | 11+ platforms |
| Local MCP Tools | ~10 | Varies | 33 tools, 8 categories |
| Multi-Agent Swarm | No | No | Yes - parallel agents |
| Parallel Validation | No (just pytest) | No | Review agents + pytest |
| Custom Skills/Plugins | No | Limited | Hot-loadable skill system |
| Web Dashboard | No | No | Real-time monitoring |
| Browser Extension | Yes | No | Yes (11 platforms) |
Architecture
Web AI Chats (ChatGPT, Claude, Grok, Kimi, DeepSeek, Gemini...)
|
HTTP/WebSocket (CORS-enabled)
|
+----v--------------+---------------+
| MSG GATEWAY | SWARM ORCH. |
| (FastAPI) | (Parallel) |
+----v--------------+---------------+
|
+----v--------------+
| MCP LOCAL TOOLS |
| (33 tools) |
+----v--------------+
| Your PC |
| Files, Terminal |
| Browser, Code |
+-------------------+
Quick Start
1. Install Dependencies
pip install mcp[cli] fastapi uvicorn websockets pyyaml jinja2 psutil httpx
Optional (for browser tools):
pip install playwright
playwright install chromium
2. Run MSG
cd msg
python run.py
The dashboard will be available at:
- Dashboard: http://localhost:8765/dashboard
- API Docs: http://localhost:8765/docs
- Tool Explorer: http://localhost:8765/tools
3. Install Browser Extension
- Open Chrome/Firefox extensions page
- Enable "Developer mode"
- Click "Load unpacked" and select the
extension/folder - The MSG tool panel will appear on supported AI chat sites
4. Connect Your AI Chat
Option A: Browser Extension (Recommended)
The extension automatically injects MCP tool capabilities into:
- ChatGPT (chatgpt.com)
- Claude (claude.ai)
- Grok (grok.x.ai)
- Kimi (kimi.ai)
- DeepSeek (chat.deepseek.com)
- Gemini (gemini.google.com)
- Perplexity (perplexity.ai)
- Mistral (chat.mistral.ai)
- OpenRouter (openrouter.ai)
- T3 Chat (t3.chat)
Option B: Direct API
Send tool calls directly from any app:
curl -X POST http://localhost:8765/api/v1/tools/execute_command \
-H "Content-Type: application/json" \
-d '{"params": {"command": "ls -la"}}'
Option C: WebSocket (Real-time)
const ws = new WebSocket('ws://localhost:8765/ws');
ws.send(JSON.stringify({
tool: 'read_file',
params: {path: '/path/to/file.txt'}
}));
ws.onmessage = (e) => console.log(JSON.parse(e.data));
33 Built-in MCP Tools
Filesystem (8)
| Tool | Description |
|---|---|
read_file |
Read text file with optional offset/limit |
write_file |
Write or overwrite a file |
append_file |
Append content to a file |
list_directory |
List files with metadata (size, mtime) |
search_files |
Recursive glob search |
create_directory |
Create directory structure |
delete_path |
Delete file or directory |
get_file_info |
Size, modified time, permissions |
Terminal (3)
| Tool | Description |
|---|---|
execute_command |
Run shell command with timeout (security sandboxed) |
execute_script |
Run a script file |
start_background_process |
Start daemon process, return PID |
Browser (4)
| Tool | Description |
|---|---|
browser_visit |
Navigate to URL, get page content |
browser_click |
Click element by selector |
browser_input |
Fill form input |
browser_screenshot |
Capture page screenshot |
Code Execution (3)
| Tool | Description |
|---|---|
run_python |
Execute Python code in isolated subprocess |
run_javascript |
Execute JS via Node.js |
evaluate_expression |
Evaluate math/code expressions |
System (4)
| Tool | Description |
|---|---|
get_system_info |
CPU, RAM, disk, OS info |
list_processes |
Running processes |
kill_process |
Kill process by PID |
search_web |
Web search via DuckDuckGo |
Git (4)
| Tool | Description |
|---|---|
git_status |
Repository status |
git_log |
Commit history |
git_diff |
Current diff |
git_exec |
Run any git command |
Docker (4)
| Tool | Description |
|---|---|
docker_ps |
List containers |
docker_exec |
Execute in container |
docker_logs |
Container logs |
docker_run |
Run new container |
Dev Tools (3)
| Tool | Description |
|---|---|
npm_install |
npm install |
pip_install |
pip install |
run_tests |
Run pytest/jest |
Swarm Orchestrator
The swarm executes complex projects with parallel validation:
- You submit a project: "Build a Python web scraper"
- Project Manager decomposes it into tasks
- Code Agents (parallel) write the code
- Review Agents (parallel) validate each batch - checking syntax, docstrings, error handling
- Verdict: PASS / WARNING / REVISE
- Debug Agent fixes REVISE items
- Test Agent runs integration tests
- Results delivered
Parallel Validation (The Key Feature)
Unlike other systems that only run pytest after code is done, MSG runs Review Agents in parallel with Code Agents. While one agent is still writing code, another is already reviewing what was just completed. This catches issues immediately, not after hours of work.
Submit a Swarm Task
curl -X POST http://localhost:8765/api/v1/swarm/task \
-H "Content-Type: application/json" \
-d '{"description": "Build a calculator app", "files": ["calc.py", "test_calc.py"]}'
Check status:
curl http://localhost:8765/api/v1/swarm/task/{task_id}
Configuration
Edit config.yaml:
gateway:
host: "0.0.0.0"
port: 8765
security:
allowed_directories:
- "/home/yourname/projects"
blocked_commands:
- "rm -rf /"
max_execution_time: 30
swarm:
max_parallel_agents: 5
review_strictness: "strict"
Security
- Path sandboxing: Tools can only access allowed directories
- Command blocklist: Dangerous commands are rejected
- Execution timeouts: No infinite hangs
- Output limits: Prevents memory exhaustion
- Optional auth: Token-based API authentication
Tech Stack
| Component | Technology |
|---|---|
| MCP Server | mcp (FastMCP) Python SDK |
| Gateway | FastAPI + WebSockets |
| Process Mgmt | asyncio + subprocess |
| Browser | Playwright |
| Message Bus | asyncio Queue |
| Dashboard | FastAPI + Jinja2 + vanilla JS |
| Extension | Vanilla JS (content script) |
Project Stats
- 34 Python files, 3,693 lines of code
- 33 MCP tools across 8 categories
- 5 agent types in the swarm (coder, reviewer, tester, debugger + orchestrator)
- 11 AI platforms supported via browser extension
- 6 dashboard pages with real-time WebSocket updates
- 100% syntax clean - all files pass py_compile
License
MIT - Use it, modify it, make money with it. Go get 'em.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。