setup-mcp

A project setup command that examines a codebase and recommends MCP servers. MCP servers let an AI agent connect to external tools or services, and the command writes their configuration to `.mcp.json`.

In plain words
What is it for?
Use it when setting up AI-tool integrations for a project. It helps identify the technology stack, consult the official MCP Registry, check trust signals, and configure suitable servers.
Why use it?
It avoids choosing integrations blindly and keeps new server entries alongside existing configuration. It also checks the project's languages, frameworks, and tooling before making recommendations.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/agoldian/claudenv/setup-mcp
Clone the repo
git clone --depth 1 https://github.com/AGoldian/claudenv

Made for: Claude Code.

Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,154 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.01154
Opus 5 $0.00005 $0.00577
Sonnet 5 $0.00002 $0.00231
Haiku 4.5 $0.00001 $0.00115

Measured 3d ago against content hash 786a3e95d4cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

setup-mcp scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads MCP configurationmediumAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

Remind the user that `.mcp.json` is safe to commit — it only contains placeholders, not actual secrets.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

allowed-tools: Read, Write, Glob, Grep, Bash(curl:*), Bash(find:*), Bash(cat:*)
scaffold/.claude/commands/setup-mcp.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP Server Setup

You are configuring MCP servers for this project. Analyze the tech stack, search the official MCP Registry, verify trust signals, and generate .mcp.json.

Step 1: Analyze the Project

Understand what this project uses:

Read existing documentation:

  • Read CLAUDE.md if it exists — it contains the tech stack summary
  • Read _state.md if it exists

Check for existing MCP config:

  • Read .mcp.json if it exists — you will merge new entries, not overwrite

Scan manifest files: !find . -maxdepth 3 \( -name "package.json" -o -name "pyproject.toml" -o -name "go.mod" -o -name "Cargo.toml" -o -name "Gemfile" -o -name "composer.json" -o -name "requirements.txt" \) -not -path "*/node_modules/*" -not -path "*/.venv/*" -not -path "*/vendor/*" 2>/dev/null | head -20

Scan framework and tooling configs: !find . -maxdepth 2 \( -name "tsconfig*.json" -o -name "next.config.*" -o -name "vite.config.*" -o -name "docker-compose.*" -o -name "Dockerfile" -o -name ".env*" -o -name "prisma" -o -name "drizzle.config.*" \) -not -path "*/node_modules/*" 2>/dev/null | head -20

Read the manifest files you found. Identify:

  • Programming languages and frameworks
  • Databases (PostgreSQL, MongoDB, Redis, etc.)
  • Cloud services (AWS, GCP, Azure)
  • External APIs (Stripe, Sentry, etc.)
  • Dev tools (Docker, GitHub Actions, etc.)

Step 2: Search the MCP Registry

Read the MCP server reference for search and evaluation guidance: @.claude/skills/doc-generator/templates/mcp-servers.md

For each major technology in the project, search the official MCP Registry API:

curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=<tech>&version=latest&limit=10'

For each candidate server with an npm package, verify trust by checking monthly downloads:

curl -s 'https://api.npmjs.org/downloads/point/last-month/<npm-package>'

Optionally check GitHub stars for additional trust signal:

curl -s 'https://api.github.com/repos/<owner>/<repo>'

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 116 lines · 9 tokens per session scan B 786a3e95d4cc

Subscribe to this mod's changes

setup-mcp is a command published in the GitHub repository AGoldian/claudenv (10 stars, last pushed 2mo ago), licensed MIT. It adds 9 tokens to every session and 1,154 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 2 findings (reads mcp configuration, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.