Index of every page on this site: llms.txt
All skills
grasmash avatar

/claude-code-mcp-setup

@19514f4
Run it yourself

Add and configure MCP (Model Context Protocol) servers in Claude Code. Use when adding new MCP servers, configuring remote MCP, setting up OAuth MCP servers, troubleshooting MCP connections, or running /mcp diagnostics. Covers stdio, HTTP, and SSE transport types.

Use this Skill: https://skilld.dev/gh/grasmash/drupal-claude-skills/claude-code-mcp-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈72 tokens for metadata: the name and description. ≈885 when used: this file.

Description uses 3.6% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈288 characters, or 3.6%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Claude Code MCP Setup

Purpose

Guide for adding and configuring MCP (Model Context Protocol) servers in Claude Code CLI.

When to Use

  • Adding a new MCP server to Claude Code
  • Configuring remote MCP servers (HTTP/SSE)
  • Troubleshooting MCP connection failures
  • Understanding MCP transport types
  • Setting up OAuth-authenticated MCP servers

Quick Reference

CLI Commands

# Add local stdio MCP server
claude mcp add <name> <command> [args...]

# Add remote HTTP MCP server (supports OAuth)
claude mcp add --transport http <name> <url>

# Add remote SSE MCP server
claude mcp add --transport sse <name> <url>

# Add with environment variables
claude mcp add <name> -e API_KEY=xxx -- <command> [args...]

# Add with custom headers
claude mcp add --transport http <name> <url> --header "Authorization: Bearer xxx"

# List configured servers
claude mcp list

# Remove a server
claude mcp remove <name>

Transport Types

Type Use Case Example
stdio Local NPM packages, scripts claude mcp add my-server npx @org/mcp-server
http Remote servers with OAuth claude mcp add --transport http monday https://mcp.monday.com/mcp
sse Server-Sent Events servers claude mcp add --transport sse name https://example.com/sse

Common MCP Server Examples

monday.com (Remote HTTP with OAuth)

claude mcp add --transport http monday https://mcp.monday.com/mcp

After adding, restart Claude Code and run /mcp. First connection will prompt OAuth authorization in browser.

GitHub (Local with Token)

claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxx -- npx @modelcontextprotocol/server-github

Filesystem (Local)

claude mcp add filesystem npx @modelcontextprotocol/server-filesystem /path/to/directory

Custom Local Server

claude mcp add my-server node /path/to/server.js

Configuration Files

MCP servers are stored in:

  • User config: ~/.claude.json (global)
  • Project config: .mcp.json (per-project, legacy)

Manual Configuration (if needed)

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["@org/mcp-package"],
      "env": {
        "API_KEY": "your-key"
      }
    }
  }
}

For remote servers:

{
  "mcpServers": {
    "remote-server": {
      "type": "url",
      "url": "https://example.com/mcp"
    }
  }
}

Troubleshooting

Check MCP Status

# Inside Claude Code
/mcp

# Detailed diagnostics
/doctor

Common Issues

"Does not adhere to MCP server configuration schema"

  • Use claude mcp add CLI command instead of manual JSON editing
  • Ensure correct transport type for remote servers

"Failed to reconnect"

  • Check network connectivity
  • Verify OAuth authorization completed
  • Try removing and re-adding: claude mcp remove <name> && claude mcp add ...

OAuth not prompting

  • Restart Claude Code after adding server
  • Run /mcp to trigger connection
  • Check browser for blocked popups

Environment variable errors

  • Use -e VAR=value flag when adding
  • Or set in shell before running Claude Code

Verify Configuration

# Check what was added
cat ~/.claude.json | jq '.mcpServers'

# Validate JSON syntax
jq . ~/.claude.json

Resources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides a comprehensive guide for adding and configuring Model Context Protocol (MCP) servers in Claude Code. It covers various transport types, provides safe examples using official packages, and includes troubleshooting information for configuration management.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 19514f4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 2 months ago

README badge

README badge for grasmash/drupal-claude-skills/claude-code-mcp-setup