MCP configuration and implementation review
Review MCP setups as a security-first configuration audit.
Prefer concrete evidence from the provided config, code, logs, docs, or diff. Do not give generic MCP advice until you have extracted the exact launch command, transport, auth model, tool surface, and trust boundaries.
For Codex or Claude Desktop stdio startup failures such as timed out after X seconds, handshaking with MCP server failed, or connection closed: initialize response, first read references/windows-codex-stdio-debugging.md and follow that flow before recommending larger timeout values.
Review goals
- Identify whether the request is about configuration only, implementation code, or both.
- Extract the actual MCP shape:
- server name and purpose
- transport (
stdio, streamable HTTP, SSE, websocket if present)
- launch command or container image
- environment variables and secret sources
- auth flow and token path
- exposed tools/resources/prompts
- filesystem, shell, browser, network, or database reach
- Report findings by severity with precise remediation.
- End with a clear ship decision:
approve, approve with fixes, or block.
What to inspect first
When the user gives config files such as mcp.json, desktop settings, project config, docker compose, shell launchers, or PR diffs, extract these items before judging quality:
- exact command being executed (
npx, node, uvx, python, docker, local binary)
- pinned version vs floating latest tag
- who supplies secrets and where they are stored
- whether tools execute code, shell commands, SQL, filesystem writes, web fetches, or browser actions
- whether the server can reach internal systems or production data
- whether auth uses bearer tokens, API keys, OAuth, sessions, or no auth
- whether logs or traces may capture secrets or prompt content
If details are missing, state the missing evidence explicitly in the report and downgrade confidence.
High-risk findings to look for
Treat these as default high-priority checks.
1. Dangerous server startup and supply-chain risk
Flag when you find:
npx / pnpm dlx / bunx without a pinned version
- docker images using floating tags like
latest
- curl-pipe-shell installers in setup docs
- unreviewed third-party MCP servers with broad host permissions
- startup commands that inherit the full environment by default
Recommended fix pattern:
- pin package or image versions
- prefer reviewed local wrappers over raw remote installers
- pass a minimal explicit environment allowlist
- document expected binary hash or package source when possible
2. Secret handling failures
Flag when you find:
- API keys or tokens hardcoded in config
- secrets committed in
.json, .env, shell scripts, or screenshots
- secrets forwarded into subprocesses without need
- verbose logging of auth headers, prompts, or tool arguments containing secrets
Recommended fix pattern:
- move secrets to environment or secret manager
- redact auth material in logs
- scope tokens per server and per environment
- avoid sharing one broad token across multiple MCP servers
3. Over-broad tool exposure
Flag when you find:
- shell execution tools with unrestricted arguments
- filesystem tools rooted at
/, home directory, or repository parent
- SQL tools against production without read-only boundaries
- browser or HTTP tools that can hit arbitrary internal hosts
- mixed-purpose servers exposing many unrelated dangerous tools
Recommended fix pattern:
- restrict roots, hosts, schemas, and allowed commands
- split dangerous tools into separate reviewed servers
- add explicit deny rules for destructive operations
- prefer read-only defaults
4. OAuth and token handling problems for MCP
For HTTP-based MCP authorization reviews, check against current MCP authorization requirements:
- clients should use OAuth 2.1 patterns with PKCE
- clients must use the
resource parameter for the intended MCP server
- MCP servers must validate that tokens were issued for them
- tokens must not be forwarded to another server that is not their intended audience
- HTTPS is required for authorization endpoints and non-localhost redirects
Block on:
- accepting tokens without audience validation
- forwarding user access tokens from one service to another MCP server
- missing PKCE in authorization code flows
- query-string access tokens
- session-cookie auth used as the primary control for MCP API operations without documented justification
Use references/mcp-review-checklist.md for the security checklist and references/report-template.md for the response shape.
Review workflow
Step 1: inventory the trust boundary
Write one short paragraph covering:
- who launches the MCP server
- what the server can reach
- what credentials it receives
- what destructive actions it can take
Step 2: classify the server
Choose one or more labels:
local productivity
developer tooling
data access
browser automation
deployment / infra
custom business api
high-risk executor
Use stricter standards as the server gets closer to production systems, shell access, or write actions.
Step 3: run the checklist
Walk the relevant sections from references/mcp-review-checklist.md:
- startup and packaging
- secrets and environment
- authn/authz
- tool capability limits
- network and data egress
- logging and observability
- operational hygiene
For Windows stdio MCP incidents on Codex, also run the targeted startup triage in references/windows-codex-stdio-debugging.md. Treat timeout as a symptom, not a root cause, until you have evidence that the server actually received and failed to answer initialize.
Step 4: produce findings
For every material issue, include:
- severity:
critical, high, medium, or low
- evidence: file, key, command, or code path
- why it matters in this topology
- exact remediation
Do not inflate severity for style issues. Do escalate if the server has shell execution, production credentials, or cross-system token forwarding.
Step 5: issue a decision
Use:
approve when no material risk remains
approve with fixes when issues are bounded and non-blocking
block when exploitation could lead to credential theft, arbitrary execution, broad data access, or confused-deputy auth problems
Output format
Follow references/report-template.md.
Default structure:
summary
architecture snapshot
findings
missing evidence
decision
Keep the summary short. Spend most space on evidence-backed findings.
Review heuristics
- Prefer least privilege over convenience.
- Prefer pinned dependencies over dynamic download at runtime.
- Prefer server-specific credentials over shared global credentials.
- Prefer read-only and narrow roots over broad access.
- Prefer explicit allowlists over open-ended tool inputs.
- Prefer separate MCP servers for unrelated trust domains.
- If a tool can execute code, write files, access private networks, or mutate production state, assume abuse paths exist until constrained.
- Prefer proving where stdio failed over increasing
startup_timeout_sec blindly.
- For Windows stdio MCP servers, test whether the client is sending newline-delimited JSON or
Content-Length framed messages; do not assume one format.
What good looks like
A strong MCP setup usually has:
- pinned package or image versions
- a minimal environment allowlist
- narrowly scoped filesystem or network permissions
- read-only defaults where possible
- clear OAuth audience/resource handling for HTTP transports
- no hardcoded secrets
- concise operational docs describing upgrade, rollback, and owner
Do not do this
- Do not approve a config just because it “works locally”.
- Do not assume stdio is safe by default; review the launched command and inherited environment.
- Do not assume OAuth is correct because a login screen exists.
- Do not bury the blocking issue under many minor suggestions.
- Do not recommend adding broader permissions to “fix” broken tools without calling out the security tradeoff.
1---2name: mcp-config-reviewer3description: review mcp configuration and implementation for security, correctness, and operational risk. use when chatgpt is asked to inspect mcp.json, claude desktop or codex mcp settings, server launch commands, oauth settings, token handling, tool exposure, startup failures, stdio handshake errors, timeout errors, or pull requests that add or modify mcp servers. especially useful for finding dangerous defaults, over-permissive tools, token forwarding, missing audience validation, unsafe stdio commands, hardcoded secrets, and weak review reports.4---56# MCP configuration and implementation review78Review MCP setups as a security-first configuration audit.910Prefer concrete evidence from the provided config, code, logs, docs, or diff. Do not give generic MCP advice until you have extracted the exact launch command, transport, auth model, tool surface, and trust boundaries.1112For Codex or Claude Desktop stdio startup failures such as `timed out after X seconds`, `handshaking with MCP server failed`, or `connection closed: initialize response`, first read [references/windows-codex-stdio-debugging.md](references/windows-codex-stdio-debugging.md) and follow that flow before recommending larger timeout values.1314## Review goals15161. Identify whether the request is about configuration only, implementation code, or both.172. Extract the actual MCP shape:18 - server name and purpose19 - transport (`stdio`, streamable HTTP, SSE, websocket if present)20 - launch command or container image21 - environment variables and secret sources22 - auth flow and token path23 - exposed tools/resources/prompts24 - filesystem, shell, browser, network, or database reach253. Report findings by severity with precise remediation.264. End with a clear ship decision: `approve`, `approve with fixes`, or `block`.2728## What to inspect first2930When the user gives config files such as `mcp.json`, desktop settings, project config, docker compose, shell launchers, or PR diffs, extract these items before judging quality:3132- exact command being executed (`npx`, `node`, `uvx`, `python`, `docker`, local binary)33- pinned version vs floating latest tag34- who supplies secrets and where they are stored35- whether tools execute code, shell commands, SQL, filesystem writes, web fetches, or browser actions36- whether the server can reach internal systems or production data37- whether auth uses bearer tokens, API keys, OAuth, sessions, or no auth38- whether logs or traces may capture secrets or prompt content3940If details are missing, state the missing evidence explicitly in the report and downgrade confidence.4142## High-risk findings to look for4344Treat these as default high-priority checks.4546### 1. Dangerous server startup and supply-chain risk4748Flag when you find:4950- `npx` / `pnpm dlx` / `bunx` without a pinned version51- docker images using floating tags like `latest`52- curl-pipe-shell installers in setup docs53- unreviewed third-party MCP servers with broad host permissions54- startup commands that inherit the full environment by default5556Recommended fix pattern:5758- pin package or image versions59- prefer reviewed local wrappers over raw remote installers60- pass a minimal explicit environment allowlist61- document expected binary hash or package source when possible6263### 2. Secret handling failures6465Flag when you find:6667- API keys or tokens hardcoded in config68- secrets committed in `.json`, `.env`, shell scripts, or screenshots69- secrets forwarded into subprocesses without need70- verbose logging of auth headers, prompts, or tool arguments containing secrets7172Recommended fix pattern:7374- move secrets to environment or secret manager75- redact auth material in logs76- scope tokens per server and per environment77- avoid sharing one broad token across multiple MCP servers7879### 3. Over-broad tool exposure8081Flag when you find:8283- shell execution tools with unrestricted arguments84- filesystem tools rooted at `/`, home directory, or repository parent85- SQL tools against production without read-only boundaries86- browser or HTTP tools that can hit arbitrary internal hosts87- mixed-purpose servers exposing many unrelated dangerous tools8889Recommended fix pattern:9091- restrict roots, hosts, schemas, and allowed commands92- split dangerous tools into separate reviewed servers93- add explicit deny rules for destructive operations94- prefer read-only defaults9596### 4. OAuth and token handling problems for MCP9798For HTTP-based MCP authorization reviews, check against current MCP authorization requirements:99100- clients should use OAuth 2.1 patterns with PKCE101- clients must use the `resource` parameter for the intended MCP server102- MCP servers must validate that tokens were issued for them103- tokens must not be forwarded to another server that is not their intended audience104- HTTPS is required for authorization endpoints and non-localhost redirects105106Block on:107108- accepting tokens without audience validation109- forwarding user access tokens from one service to another MCP server110- missing PKCE in authorization code flows111- query-string access tokens112- session-cookie auth used as the primary control for MCP API operations without documented justification113114Use `references/mcp-review-checklist.md` for the security checklist and `references/report-template.md` for the response shape.115116## Review workflow117118### Step 1: inventory the trust boundary119120Write one short paragraph covering:121122- who launches the MCP server123- what the server can reach124- what credentials it receives125- what destructive actions it can take126127### Step 2: classify the server128129Choose one or more labels:130131- `local productivity`132- `developer tooling`133- `data access`134- `browser automation`135- `deployment / infra`136- `custom business api`137- `high-risk executor`138139Use stricter standards as the server gets closer to production systems, shell access, or write actions.140141### Step 3: run the checklist142143Walk the relevant sections from `references/mcp-review-checklist.md`:144145- startup and packaging146- secrets and environment147- authn/authz148- tool capability limits149- network and data egress150- logging and observability151- operational hygiene152153For Windows stdio MCP incidents on Codex, also run the targeted startup triage in [references/windows-codex-stdio-debugging.md](references/windows-codex-stdio-debugging.md). Treat timeout as a symptom, not a root cause, until you have evidence that the server actually received and failed to answer `initialize`.154155### Step 4: produce findings156157For every material issue, include:158159- severity: `critical`, `high`, `medium`, or `low`160- evidence: file, key, command, or code path161- why it matters in this topology162- exact remediation163164Do not inflate severity for style issues. Do escalate if the server has shell execution, production credentials, or cross-system token forwarding.165166### Step 5: issue a decision167168Use:169170- `approve` when no material risk remains171- `approve with fixes` when issues are bounded and non-blocking172- `block` when exploitation could lead to credential theft, arbitrary execution, broad data access, or confused-deputy auth problems173174## Output format175176Follow `references/report-template.md`.177178Default structure:1791801. `summary`1812. `architecture snapshot`1823. `findings`1834. `missing evidence`1845. `decision`185186Keep the summary short. Spend most space on evidence-backed findings.187188## Review heuristics189190- Prefer least privilege over convenience.191- Prefer pinned dependencies over dynamic download at runtime.192- Prefer server-specific credentials over shared global credentials.193- Prefer read-only and narrow roots over broad access.194- Prefer explicit allowlists over open-ended tool inputs.195- Prefer separate MCP servers for unrelated trust domains.196- If a tool can execute code, write files, access private networks, or mutate production state, assume abuse paths exist until constrained.197- Prefer proving where stdio failed over increasing `startup_timeout_sec` blindly.198- For Windows stdio MCP servers, test whether the client is sending newline-delimited JSON or `Content-Length` framed messages; do not assume one format.199200## What good looks like201202A strong MCP setup usually has:203204- pinned package or image versions205- a minimal environment allowlist206- narrowly scoped filesystem or network permissions207- read-only defaults where possible208- clear OAuth audience/resource handling for HTTP transports209- no hardcoded secrets210- concise operational docs describing upgrade, rollback, and owner211212## Do not do this213214- Do not approve a config just because it “works locally”.215- Do not assume stdio is safe by default; review the launched command and inherited environment.216- Do not assume OAuth is correct because a login screen exists.217- Do not bury the blocking issue under many minor suggestions.218- Do not recommend adding broader permissions to “fix” broken tools without calling out the security tradeoff.