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.
- Python 3.6 or higher
- Claude Desktop App installed
- Save the python file as
mcp
(without extension) to/usr/local/bin/
:
sudo mv mcp /usr/local/bin/
- Make it executable:
sudo chmod +x /usr/local/bin/mcp
- Create a Scripts directory in your user folder:
C:\Users\your_username\Scripts
-
Save these two files in the Scripts directory:
mcp.py
(the Python script)mcp.bat
with the following content:
@echo off python "%~dp0mcp.py" %*
-
Add to your user PATH:
- Press Win + R
- Type
rundll32 sysdm.cpl,EditEnvironmentVariables
- Under "User variables", select "Path" and click "Edit"
- Click "New" and add
C:\Users\your_username\Scripts
- Click "OK" on all windows
- Open a new terminal for changes to take effect
# 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
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
This tool specifically manages the "filesystem" MCP server configuration while preserving any other MCP server configurations that may exist in your Claude config file.
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.
Here's how the filesystem configuration portion typically looks:
{
"globalShortcut": "",
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Documents/project1",
"/Users/username/Downloads/project2"
]
}
}
}
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Users\\username\\Documents\\GitHub\\project1",
"C:\\Users\\username\\Documents\\GitHub\\project2"
]
}
}
}
-
If the command isn't found after installation:
- On macOS: Restart your terminal
- On Windows: Open a new Command Prompt
-
If you get permission errors:
- On macOS: Make sure the script is executable
- On Windows: Make sure Python is in your PATH
-
If directories aren't being added:
- Verify the directory exists
- Use absolute paths
- On Windows, use backslashes or escaped forward slashes
- 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.