Mesh MCP

Mesh MCP

Mesh is an MCP server that lets Claude Code, Codex CLI, and Gemini CLI call other AI models for second opinions and multi-model workflows. It routes requests through local CLIs first, falling back to OpenRouter for any other model.

Category
访问服务器

README

Mesh MCP

Let your AI assistant consult other AI models for code review, debugging, planning, and consensus — without leaving its session.

Mesh is an MCP server for Claude Code, Codex CLI, and Gemini CLI. Plug it in and your assistant gains tools to call Gemini, GPT-5, Claude Opus, and 30+ other models for second opinions, structured workflows, and multi-model debate.

A typical session looks like:

You:    "Codereview with gemini pro on the auth/ module, then continue
         with o3 for a second pass, then planner to outline fixes."
Claude: → calls mesh codereview (gemini pro), gathers findings
        → continues with o3 for cross-check
        → calls mesh planner to produce a fix strategy
        ← surfaces a unified report with both perspectives

Mesh routes every model call through the local gemini or codex CLI when it can, and falls back to OpenRouter for anything else.

Forked from BeehiveInnovations/pal-mcp-server. Mesh strips the original's six direct API providers (Gemini/OpenAI/Azure/X.AI/DIAL/Custom) and routes everything through local CLIs + OpenRouter instead. See NOTICE for full attribution.

Why use Mesh:

  • 🧠 Multi-model workflows — codereview, debug, planner, consensus, secaudit, and 13 more tools
  • 🔒 Local-first — no external API call when your gemini or codex CLI can serve the request
  • 🔄 Resilient — automatic fallback Gemini CLI → Codex CLI → OpenRouter
  • 📦 One install — ./setup.sh configures everything; no per-provider API key juggling
  • 🪶 Lean — three backends total, no accumulated provider sprawl

Quick Start

Prerequisites: Python 3.11+, Git. At least one of:

  • Gemini CLI — npm i -g @google/gemini-cli && gemini login
  • Codex CLI — npm i -g @openai/codex && codex login
  • OpenRouter API key (set as OPENROUTER_API_KEY in .env)

Install:

git clone https://github.com/dgdev25/mesh.git
cd mesh
./setup.sh             # idempotent: venv, deps, .env, Claude Code registration

Use it:

"Use mesh chat with gemini-2.5-pro to review this auth flow"
"Get consensus from gpt-5 and opus on whether to use Redis or Postgres"
"Use mesh debug with o3 to find the race condition"

How It Works

MCP Client (Claude Code, Codex CLI, Gemini CLI)
    ↓
Mesh MCP Server
    ↓
Gemini CLI       (gemini-* models)
Codex CLI        (gpt-*, o3, o4 models)
OpenRouter HTTPS (everything else: opus, sonnet, deepseek, grok, …)
    ↓
Automatic fallback if a backend can't handle the request

All three backends produce identical ModelResponse objects, so tool code never has to care which one served the request.


Configuration

# Optional CLI path overrides (defaults: search PATH for `gemini` and `codex`)
GEMINI_CLI_PATH=/usr/local/bin/gemini
CODEX_CLI_PATH=/usr/local/bin/codex
CLI_TIMEOUT_SECONDS=120

# OpenRouter fallback (required if neither CLI is installed)
OPENROUTER_API_KEY=sk-or-...
OPENROUTER_ALLOWED_MODELS=                    # empty = no restrictions

# Defaults
DEFAULT_MODEL=auto                            # 'auto' picks per task
DEFAULT_THINKING_MODE_THINKDEEP=high
DISABLED_TOOLS=analyze,refactor,testgen,secaudit,docgen,tracer

Full reference: docs/configuration.md.


Documentation


Core Tools

Each tool ships with its own multi-step workflow and parameters that consume context window space even when idle. Non-essential tools are disabled by default — toggle via DISABLED_TOOLS in .env.

Collaboration & Planning (enabled by default)

  • clink — bridge to external CLIs (Gemini planner, Codex codereviewer, etc.)
  • chat — brainstorm, get second opinions, validate approaches
  • thinkdeep — extended reasoning, edge case analysis
  • planner — break down complex projects into actionable plans
  • consensus — multi-model debate with stance steering

Code Analysis & Quality (enabled by default)

  • debug — systematic root-cause analysis
  • precommit — validate changes before committing
  • codereview — professional reviews with severity levels

Development Tools (disabled by default)

  • analyze — architecture and dependency analysis
  • refactor — refactoring with decomposition focus
  • testgen — test generation with edge cases
  • secaudit — OWASP Top 10 (2025) security audits
  • docgen — documentation generation with complexity analysis
  • tracer — call-flow mapping

Utilities

  • apilookup — current API/SDK lookups in a sub-process
  • challenge — prevent reflexive AI agreement
  • listmodels — show configured backends and available models
  • version — server version and capabilities

Example Workflows

Multi-model code review (codereview takes one model per pass — chain via continuation):

"Run codereview with gemini pro on the auth/ directory, then continue with o3
 for a second opinion, then use planner to outline a fix strategy"

Collaborative debugging (thinking_mode only applies to thinking-capable models — name one):

"Use debug with gemini pro and thinking_mode=max on this race condition,
 then validate the fix with precommit"

Architecture planning (consensus takes multiple models with stances):

"Use planner to break down our microservices migration, then run consensus
 with sonnet supporting the proposal and o3 opposing it"

See docs/advanced-usage.md for more.


Testing

pytest tests/                                              # unit + integration (mocked)
MESH_RUN_CLI_TESTS=1 pytest tests/test_cli_integration.py  # real subprocess against gemini/codex
python -m simulator_tests --quick                          # end-to-end MCP scenarios

Current status: 595 unit tests passing.


License

Apache License 2.0 — see LICENSE for the full text and NOTICE for upstream attribution.

Acknowledgments

Star History Chart

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选