agentsclimarketplace

Claude code mcp

Skill ucsandman/claude-code-capability-primer/skills/claude-code-mcp

Use when configuring MCP servers in Claude Code — connecting external tools (GitHub, Stripe, Sentry, databases), choosing transports (HTTP, stdio, WebSocket), managing scopes, handling authentication, scaling with tool search, and decidi...From its SKILL.md

Install
npx -y skills add ucsandman/claude-code-capability-primer --skill claude-code-mcp

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

9.7 KB, ~2.6k tokens by cl100k_base, as published. Nobody here has run it

Claude Code MCP Servers

What is MCP?

Model Context Protocol (MCP) = external tools/data/resources exposed to Claude as callable tools. Live systems: issue trackers, databases, APIs, browsers, design tools. Not suitable for repo-local logic (use skills or scripts instead).

Tools are named mcp__<server-name>__<tool-name> in output. Example: mcp__github__list_issues.


Configuration

Three scopes, stored in two files:

ScopeStored inShared with teamLoaded in
Local (default)~/.claude.json (project-specific path)NoCurrent project only
Project.mcp.json (repo root)Yes, via gitCurrent project only
User~/.claude.json (top-level mcpServers key)NoAll your projects

Add a server:

# HTTP server (hosted)
claude mcp add --transport http <name> <url>
claude mcp add --transport http stripe https://mcp.stripe.com

# Stdio server (local process, needs --)
claude mcp add <name> -- <command> [args...]
claude mcp add playwright -- npx -y @playwright/mcp@latest

# Set scope
claude mcp add --scope user <name> <url>
claude mcp add --scope project <name> <url>

Verify:

claude mcp list
claude mcp get <name>

Remove:

claude mcp remove <name> [--scope local|project|user]

Edit .mcp.json directly:

{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.github.com/...",
      "headers": {
        "Authorization": "Bearer ${GITHUB_TOKEN}"
      }
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    }
  }
}

Transports

HTTP (hosted, recommended for remote servers):

  • Stateless, runs at a URL.
  • claude mcp add --transport http <name> <url>
  • Also called streamable-http in JSON (MCP spec naming).

Stdio (local, for filesystem/browser/db access):

  • Command runs on your machine, talks via stdin/stdout.
  • claude mcp add <name> -- <command> [args...]
  • Critical: Separate options from server command with --. Everything after -- goes untouched to the server.
  • Pass env vars via --env KEY=value or env in config.
  • Startup timeout: 30s default; set MCP_TIMEOUT=60000 (ms) if slow.

SSE (hosted, DEPRECATED — use HTTP instead):

  • Server-Sent Events; older streaming transport.
  • "type": "sse" in .mcp.json.

WebSocket (hosted, for persistent bidirectional connections):

  • Configure in .mcp.json or claude mcp add-json.
  • "type": "ws" with url, headers, timeout, alwaysLoad.
  • Use HTTP instead when server only responds to requests (HTTP has OAuth support, WebSocket does not).

Authentication

Environment variables (stdio servers):

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

${} syntax (or ${VAR:-default} for defaults) expands from shell env at runtime.

HTTP headers (hosted servers):

{
  "mcpServers": {
    "api": {
      "type": "http",
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${API_TOKEN}"
      }
    }
  }
}

OAuth (interactive browser sign-in):

  1. claude mcp add --transport http <name> <url>
  2. Server shows ! Needs authentication in /mcp
  3. Inside claude session: /mcp → select server → Authenticate → sign in → auto-connected

Static token (at add time):

claude mcp add --transport http <name> <url> --header "Authorization: Bearer <token>"

Tool Search (Deferred Loading)

What it does: Instead of loading all tool definitions upfront (bloats context for 50+ tools), Claude searches on demand and loads only what it needs (3–5 tools per search). Saves ~85% context overhead.

Who supports it: Requires Sonnet 4.5+ or Opus 4.5+. Haiku does not support tool search (on Claude Code or API).

Enabled by default: Yes. Falls back to upfront loading on Vertex AI or custom ANTHROPIC_BASE_URL.

Configure via ENABLE_TOOL_SEARCH env var:

ValueBehavior
(unset)Deferred on demand (default). Falls back to upfront on Vertex AI / proxy.
trueForce deferred (fails on older models or proxies without tool_reference support).
falseForce upfront; load all tool defs at startup.
autoThreshold: upfront if <10% of context, deferred otherwise.
auto:NThreshold: upfront if <N% of context. Example: auto:5 for 5%.

Set in settings.json:

{
  "ENABLE_TOOL_SEARCH": "true"
}

Override per query (Agent SDK only):

for await (const msg of query({
  prompt: "...",
  options: { env: { ENABLE_TOOL_SEARCH: "auto:5" } }
})) { ... }

Always load one server upfront (skip search):

{
  "mcpServers": {
    "my-server": {
      "type": "http",
      "url": "...",
      "alwaysLoad": true
    }
  }
}

Permissions

Tools from MCP require explicit allow-list.

CLI (first time):

  • Claude asks: "Allow use of mcp__<server>__<tool>?"
  • Approve in session.

Pre-approve via settings.json:

{
  "permissions": {
    "allow": [
      "mcp__github__*",
      "mcp__stripe__*"
    ]
  }
}

Use wildcards to avoid per-tool approval.


Scope Precedence

When the same server is defined in multiple scopes:

  1. Local
  2. Project
  3. User
  4. Plugin-provided
  5. Claude.ai connectors

The entry from the highest-precedence source is used entirely (fields not merged).


Connection Status

Run /mcp in session or claude mcp list from shell:

StatusMeaningFix
✓ ConnectedReady.Use it.
! Needs authenticationOAuth/token required./mcp → select → Authenticate or --header on add.
✗ Failed to connectServer down, unreachable, or bad config.Check URL (HTTP), command (stdio), env vars, timeouts.
⏸ Pending approvalProject-scope server awaiting approval./mcp → approve, or add to permissions.allow.

Debug stdio: Run the command directly to see errors:

npx -y @playwright/mcp@latest

Debug HTTP:

curl -I https://mcp.sentry.dev/mcp
# 404/405: up, reachable.
# 401/403: auth missing/invalid.
# No response: network/DNS issue.

Startup timeout:

MCP_TIMEOUT=60000 claude

Resources and Prompts

Reference resources in prompts (like @file.md):

@server:protocol://path
@github:issue://123
@postgres:schema://users

Execute MCP prompts as commands:

/mcp__servername__promptname [args...]
/mcp__github__pr_review 456

When to Use MCP vs Skills/Scripts

Use MCP when:

  • Tool is external API/service/database with live state.
  • Needs to read/act on remote system (GitHub, Stripe, Slack, browser).
  • Shared across projects (user or project scope).
  • Already exists and MCP-compatible.

Use skill/script when:

  • Repo-local logic, refactoring, generation, testing.
  • Parses your codebase and emits artifacts.
  • Runs only in this project.
  • Custom to your workflow.

Examples

Stdio server (local CLI, no auth):

"mcpServers": {
  "my-tools": {
    "command": "my-mcp-server",
    "args": ["mcp", "--transport", "stdio"],
    "description": "what this server exposes"
  }
}

Common servers people add: context7 (live library docs), github (GitHub API), stripe (Stripe API), plus filesystem, database, and browser/automation servers.

Check your actual servers: /mcp in session or claude mcp list from shell.


Troubleshooting Checklist

  1. Server not in /mcp list?

    • Check scope: claude mcp get <name> or grep ~/.claude.json and .mcp.json.
    • Local servers tied to project root or exact directory. Re-add if different project.
  2. Status: "Failed to connect"?

    • HTTP: curl -I <url> to confirm reachable.
    • Stdio: run command directly to see error.
    • Missing env var / token / startup timeout.
  3. Tools visible but Claude won't call?

    • Missing permissions.allow pre-approval. /mcp to approve, or add to settings.
  4. No tools in /mcp tool list?

    • Server started but no tools registered → likely missing API key / env var.
    • Check server docs for required vars; pass via --env KEY=value or env field.
  5. Changes to .mcp.json don't apply?

    • Restart session (Claude reads .mcp.json at startup).
    • Check file syntax (valid JSON).
    • Run claude mcp reset-project-choices if you rejected server earlier.

Key Settings You Control

{
  "mcpServers": {
    "name": {
      "type": "http|stdio|sse|ws",
      "url": "...",
      "command": "...",
      "args": [...],
      "env": { "KEY": "${VAR}" },
      "headers": { "Authorization": "Bearer ${TOKEN}" },
      "alwaysLoad": true,
      "timeout": 600000
    }
  },
  "ENABLE_TOOL_SEARCH": "auto|auto:5|true|false",
  "permissions": {
    "allow": ["mcp__<server>__*"]
  }
}

Related

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most mcp tooling skills give in ~2.6k tokens

Counted across 780 of the 1,136 authors here whose files we hold, read 2026-09-06

  • Use Zod for input validationin 34 of 780, across 21 files
  • Use stdio for local clientsin 27 of 780, across 10 files
  • Restart Claude Code after configurationin 26 of 780, across 23 files
  • Verify MCP server connection before using toolsin 23 of 780, across 17 files
  • Define input schemas for every toolin 20 of 780, across 11 files
  • Use Streamable HTTP for remote clientsin 18 of 780, across 8 files
  • Pin SDK version in package.jsonin 17 of 780, across 6 files
  • Keep server logic independent of transportin 16 of 780, across 6 files
  • Verify SDK methods against official documentationin 15 of 780, across 5 files
  • Format evaluation results as an XML filein 15 of 780, across 12 files
  • Test servers using the MCP Inspectorin 15 of 780, across 14 files
  • Create ten complex and independent evaluation questionsin 14 of 780, across 11 files

Said here and by no other author read

  • use skills or scripts for repo-local logic
  • separate stdio server options with double dashes
  • set MCP_TIMEOUT for slow server startup
  • approve tool permissions in the session
  • use wildcards in permissions to allow tool groups
  • restart session after modifying configuration files

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.