external-agent-mcp
Provides tools to run Ruff formatter and linter for automated code formatting and safe fixes.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@external-agent-mcpanalyze code with gemini for performance issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
external-agent-mcp
Local stdio MCP bridge that lets Codex call installed external CLI coding agents for bounded read-only code analysis and deterministic quality fixes.
This first version supports:
Cursor Agent via
/usr/local/bin/cursor agent --print --mode=planGemini CLI via
/opt/homebrew/bin/gemini --prompt ... --approval-mode planClaude Code via
/opt/homebrew/bin/claude --print --permission-mode plan
The server is dependency-free Node.js and speaks MCP over line-delimited JSON-RPC on stdio.
Tools
analyze_code
Runs one external provider against a repository path and returns a structured JSON payload containing command metadata, exit status, bounded stdout, and bounded stderr.
Required arguments:
provider:cursor,gemini, orclauderepo_path: absolute path to the repository/workspacetask: concrete read-only code analysis task
Optional arguments:
files: focus files; repo-relative or absolute paths underrepo_pathextra_context: additional instructionsmodel: provider-specific model overridetimeout_sec: defaults to600, capped at1800max_output_chars: defaults to30000, capped at100000include_stderr: defaults totrue
agent_status
Checks configured provider binaries with version commands. It does not run an analysis prompt.
quality_fix
Runs allow-listed deterministic quality commands over a bounded file set. This is intended for mechanical fixes that should not spend LLM tokens.
Default commands:
ruff_format:ruff format <files>ruff_safe_fix:ruff check --fix <files>
Additional commands:
ruff_check:ruff check <files>ruff_unsafe_fix:ruff check --fix --unsafe-fixes <files>; requiresallow_unsafe_fixes: true
Required arguments:
repo_path: absolute path to the git repository/workspace
Optional arguments:
files: repo-relative or absolute files to fix; required unlessallow_repo_wideis truecommands: defaults to["ruff_format", "ruff_safe_fix"]allow_repo_wide: allows target.; defaults tofalseallow_unsafe_fixes: required forruff_unsafe_fix; defaults tofalsetimeout_sec: per-command timeout; defaults to120, capped at900max_output_chars: per-command output cap; defaults to30000max_changed_files: maximum newly dirty files; defaults to20include_diff_stat: defaults totrue
The result includes command outputs, before/after git status paths, newly dirty files, out-of-scope newly dirty files, safety errors, and optional diff stat.
Related MCP server: Cursor Agent MCP Server
Codex config
Add this to ~/.codex/config.toml or a trusted project .codex/config.toml:
[mcp_servers.external_agent]
command = "node"
args = ["/Users/luchong/OpenSourceProject/external-agent-mcp/src/server.mjs"]
startup_timeout_sec = 10
tool_timeout_sec = 900
[mcp_servers.external_agent.env]
EXTERNAL_AGENT_ALLOWED_ROOTS = "/Users/luchong/Desktop:/Users/luchong/OpenSourceProject"Optional binary overrides:
[mcp_servers.external_agent.env]
CURSOR_AGENT_BIN = "/usr/local/bin/cursor"
GEMINI_BIN = "/opt/homebrew/bin/gemini"
CLAUDE_BIN = "/opt/homebrew/bin/claude"
RUFF_BIN = "ruff"
EXTERNAL_AGENT_ALLOWED_ROOTS = "/Users/luchong/Desktop:/Users/luchong/OpenSourceProject"After changing MCP config, refresh/restart Codex or start a new thread so the new tool surface is loaded.
Manual test
npm testExample tool arguments
External analysis
{
"provider": "gemini",
"repo_path": "/Users/luchong/Desktop/Agnes_Core",
"task": "Analyze the stream cancellation implementation. Focus on correctness, structured error propagation, and missing tests.",
"files": [
"kw-agent-service/path/to/file.py"
],
"timeout_sec": 900,
"max_output_chars": 40000
}Deterministic Ruff fix
{
"repo_path": "/Users/luchong/Desktop/Agnes_Core",
"files": [
"kw-agent-service/path/to/file.py"
],
"commands": [
"ruff_format",
"ruff_safe_fix"
],
"timeout_sec": 120,
"max_changed_files": 10
}Safety notes
The bridge uses
child_process.spawnwith argv arrays, not shell command strings.Read-only provider modes are hardcoded for normal analysis calls.
quality_fixrequires a git repository so it can report before/after changed files and flag unexpected newly dirty files.quality_fixrequires explicit files by default; repo-wide.runs requireallow_repo_wide: true.EXTERNAL_AGENT_ALLOWED_ROOTSis strongly recommended. If it is unset, the bridge allows any existing absolute directory passed by the MCP caller.The bridge does not pass
--yolo,--force, or equivalent write-friendly flags.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/parkavenue9639/external-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server