MCP Config Manager

A command-line tool for managing Claude's Model Context Protocol (MCP) server configuration. This tool simplifies the process of adding and removing directories that Claude can access, and starting the MCP server.

Requirements

  • Python 3.6 or higher
  • Claude Desktop App installed

Installation

On macOS

  1. Save the python file as mcp (without extension) to /usr/local/bin/:
sudo mv mcp /usr/local/bin/
  1. Make it executable:
sudo chmod +x /usr/local/bin/mcp

On Windows (No Admin Rights Required)

  1. Create a Scripts directory in your user folder:
C:\Users\your_username\Scripts
  1. Save these two files in the Scripts directory:

    • mcp.py (the Python script)
    • mcp.bat with the following content:
    @echo off
    python "%~dp0mcp.py" %*
  2. Add to your user PATH:

    1. Press Win + R
    2. Type rundll32 sysdm.cpl,EditEnvironmentVariables
    3. Under "User variables", select "Path" and click "Edit"
    4. Click "New" and add C:\Users\your_username\Scripts
    5. Click "OK" on all windows
    6. Open a new terminal for changes to take effect

Usage

Basic Commands

# Start the MCP server with configured directories
mcp

# Add a new directory
mcp --add /path/to/directory          # macOS
mcp --add C:\path\to\directory        # Windows

# Remove a directory
mcp --remove /path/to/directory       # macOS
mcp --remove C:\path\to\directory     # Windows

# List all configured directories
mcp --list

# Show help
mcp --help

Configuration File Location

The tool automatically manages the Claude configuration file located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: C:\Users\your_username\AppData\Roaming\Claude\claude_desktop_config.json

Configuration Management

This tool specifically manages the "filesystem" MCP server configuration while preserving any other MCP server configurations that may exist in your Claude config file.

Multiple MCP Servers

If your configuration includes multiple MCP servers, for example:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["..."]
    },
    "otherServer": {
      "command": "something",
      "args": ["..."]
    }
  }
}

The tool will only modify the "filesystem" portion and preserve all other configurations.

Example Configurations

Here's how the filesystem configuration portion typically looks:

macOS:

{
  "globalShortcut": "",
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Documents/project1",
        "/Users/username/Downloads/project2"
      ]
    }
  }
}

Windows:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:\\Users\\username\\Documents\\GitHub\\project1",
        "C:\\Users\\username\\Documents\\GitHub\\project2"
      ]
    }
  }
}

Troubleshooting

  1. If the command isn't found after installation:

    • On macOS: Restart your terminal
    • On Windows: Open a new Command Prompt
  2. If you get permission errors:

    • On macOS: Make sure the script is executable
    • On Windows: Make sure Python is in your PATH
  3. If directories aren't being added:

    • Verify the directory exists
    • Use absolute paths
    • On Windows, use backslashes or escaped forward slashes

Notes

  • This tool is designed to work with the Claude desktop application and its MCP server configuration.
  • It only modifies the "filesystem" MCP server configuration, leaving all other MCP server configurations untouched.
  • The tool will create the necessary configuration structure if it doesn't exist, while preserving any existing configurations.
  • It maintains the correct configuration format for each operating system while managing directory access.