Skip to content

berrydev-ai/install-mcp-servers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@berrydev-ai/install-mcp-servers

Install MCP (Model Context Protocol) servers from a configuration file using the Claude CLI.

Installation

# Run directly without installing
npx @berrydev-ai/install-mcp-servers ./path/to/mcp.json

# Or with bunx
bunx @berrydev-ai/install-mcp-servers ./path/to/mcp.json

# Or install globally
npm install -g @berrydev-ai/install-mcp-servers

Prerequisites

  • Claude CLI must be installed and available in your PATH
  • Node.js 18+ or Bun

Usage

install-mcp-servers [options] [config-file]

Options

Option Description
-f, --file <path> Path to the MCP config file (default: .mcp.json)
-s, --scope <scope> Installation scope: user, project, or local (default: user)
-d, --dry-run Print commands without executing
-h, --help Show help message

Examples

# Install servers from .mcp.json in current directory
install-mcp-servers

# Install from a specific config file
install-mcp-servers my-servers.json
install-mcp-servers -f ./config/mcp.json

# Preview what will be installed (dry run)
install-mcp-servers -d

# Install to project scope instead of user scope
install-mcp-servers -s project

# Combine options
install-mcp-servers -s project -d ./config/mcp.json

Configuration File Format

The configuration file should be a JSON file with the following structure:

{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["-y", "package-name"],
      "env": {
        "API_KEY": "${API_KEY}"
      }
    }
  }
}

Fields

Field Type Description
command string The command to run (e.g., npx, bunx, uvx, docker)
args string[] Arguments to pass to the command
env object Environment variables for the server

Example Configuration

{
  "mcpServers": {
    "Context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"]
    },
    "mastra": {
      "command": "npx",
      "args": ["-y", "@mastra/mcp-docs-server"]
    },
    "oracle-mcp": {
      "command": "bunx",
      "args": ["-y", "@bercastle/oracle-mcp@0.4.0", "--mcp"],
      "env": {
        "SOURCEGRAPH_ACCESS_TOKEN": "${SOURCEGRAPH_ACCESS_TOKEN}",
        "XAI_API_KEY": "${XAI_API_KEY}"
      }
    },
    "duckdb-analytics": {
      "command": "uvx",
      "args": ["mcp-server-motherduck", "--db-path", ":memory:"],
      "env": {
        "AWS_ACCESS_KEY_ID": "${AWS_ACCESS_KEY_ID}",
        "AWS_SECRET_ACCESS_KEY": "${AWS_SECRET_ACCESS_KEY}"
      }
    },
    "playwright": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm", "--init",
        "mcr.microsoft.com/playwright/mcp"
      ]
    }
  }
}

Installation Scopes

The --scope flag determines where the MCP server configuration is stored:

  • user (default): Installs to your user-level Claude configuration
  • project: Installs to the current project's Claude configuration
  • local: Installs to the local Claude configuration

How It Works

This tool reads your MCP configuration file and executes the equivalent claude mcp add commands for each server. For example, a server configured as:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "my-package"],
      "env": {
        "API_KEY": "secret"
      }
    }
  }
}

Will execute:

claude mcp add my-server npx -y my-package --env API_KEY=secret

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •