Skip to content
mcp-server-installer logo

MCP Server Installer

mcp-server-installer

Add MCP servers to Claude Code configuration at user level (~/.claude). Supports stdio, HTTP, and SSE transports with environment variable prompting. Use when "add mcp server", "install mcp", "configure mcp server", "new mcp", or "setup mcp server".

SKILL.md

Full skill instructions

MCP Server Installer

Autonomously add MCP (Model Context Protocol) servers to Claude Code configuration at the user level (~/​.claude/​mcp.json).

When to Activate

  • "add mcp server"
  • "install mcp", "configure mcp"
  • "new mcp server", "setup mcp"
  • "add [server-name] mcp"
  • User provides MCP server configuration JSON

Process

Step 1: Gather Server Information

Ask user for:

  1. Server name (e.g., "mobile-mcp-server")

    • Must be lowercase with hyphens
    • Will be used as the key in mcpServers object
  2. Transport type:

    • stdio - Local command execution (most common)
    • http - Remote HTTP server
    • sse - Server-Sent Events (deprecated but supported)
  3. Based on transport type:

    For stdio:

    • Command (e.g., "npx", "node", "/​usr/​local/​bin/​server")
    • Arguments array (e.g., ["@daipham/​mobile-mcp-server@latest"])
    • Environment variables (if needed)

    For http:

    For sse:

Step 2: Collect Environment Variables

Always ask user: "Does this MCP server require any environment variables?"

If yes, for each variable:

  • Variable name (e.g., "API_KEY", "DATABASE_URL")
  • Description/​purpose
  • Whether it's required or optional
  • Default value (if optional)

Document in output: List all required environment variables with instructions on where to set them.

Step 3: Read Existing Configuration

Check for existing .mcp.json at user level:

cat ~/​.claude/​mcp.json

If file doesn't exist, create new structure. If exists, parse and merge.

Step 4: Generate Configuration

Use templates from templates.md to generate the server configuration based on transport type.

Apply environment variable syntax:

  • ${VAR} - Required variable (will error if not set)
  • ${VAR:-default} - Optional variable with default value

Step 5: Update Configuration File

Merge strategy:

  • Preserve existing servers
  • Add new server to mcpServers object
  • Maintain JSON formatting (2-space indent)
  • Validate JSON before writing

Write to ~/​.claude/​mcp.json.

Step 6: Create Environment File Reference

If environment variables are needed, inform user:

⚠️ Environment Variables Required:

Set these in your shell profile (~/​.zshrc or ~/​.bashrc):

export VAR_NAME="value"
export ANOTHER_VAR="value"

Or create a project-specific .env file and reference it:
"envFile": "${workspaceFolder}/​.env"

Step 7: Validate and Test

Run validation:

claude mcp list

Show the newly added server in the output.

Output Format

✅ MCP Server Added: [server-name]

📁 Configuration: ~/​.claude/​mcp.json

🔧 Transport: [stdio/​http/​sse]
📦 Command: [command with args] (if stdio)
🌐 URL: [url] (if http/​sse)

📋 Configuration Added:
```json
{
  "server-name": {
    // configuration here
  }
}

⚠️ Environment Variables Required:

  • VAR_NAME: [description]
  • ANOTHER_VAR: [description]

💡 Set environment variables:

  1. Add to ~/​.zshrc or ~/​.bashrc: export VAR_NAME="your-value"

  2. Or use project .env file: "envFile": "${workspaceFolder}/​.env"

✅ Restart Claude Code to activate the new MCP server.

🧪 Test with: claude mcp list


## Error Handling

- **Invalid JSON**: Show parsing error, ask user to verify configuration
- **Duplicate server name**: Ask if user wants to overwrite existing server
- **Missing required fields**: Prompt for missing information
- **File permission errors**: Suggest checking ~/​.claude directory permissions

## Important Notes

1. **User-level scope**: Servers added at `~/​.claude/​mcp.json` are available across all projects
2. **Environment variables**: Always prompt for environment variables - many MCP servers require API keys or configuration
3. **Restart required**: Claude Code must be restarted after adding MCP servers
4. **Validation**: Use `claude mcp list` to verify the server was added successfully
5. **Security**: Never log or display actual environment variable values

## Reference

See `templates.md` for configuration templates for each transport type.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View