Synchronize Model Context Protocol (MCP) server configurations across different tools and applications
Project description
MCP Config Sync
A Python package for synchronizing Model Context Protocol (MCP) server configurations across different AI tools and applications.
Overview
MCP Config Sync helps you maintain consistent MCP server configurations across multiple tools like Claude Desktop, Amazon Q, VS Code extensions, and other MCP-compatible applications. It automatically discovers, combines, and synchronizes your MCP server configurations, ensuring all your tools have access to the same servers.
Features
- Automatic Discovery: Finds MCP configuration files across common locations
- Smart Merging: Combines unique MCP servers from multiple configuration files
- Conflict Resolution: Handles conflicting configurations intelligently
- Backup Support: Creates backups before modifying files (enabled by default)
- Cross-Platform: Works on macOS, Linux, and Windows
- Dry Run Mode: Preview changes before applying them
- Flexible Configuration: Support for custom configuration file paths
Installation
From PyPI (Recommended)
pip install mcp-config-sync
From Source
git clone https://github.com/jon-the-dev/mcp_config_sync.git
cd mcp_config_sync
pip install -e .
Quick Start
Command Line Usage
After installation, you can use the mcp-config-sync command:
# Preview changes for all registered MCP applications (default behavior)
mcp-config-sync
# Actually sync all registered MCP applications
mcp-config-sync --sync
# List all available MCP applications
mcp-config-sync --list-apps
# Preview changes for specific applications only
mcp-config-sync --apps amazonq cline
# Actually sync specific applications only
mcp-config-sync --apps amazonq cline --sync
# List all discovered MCP servers
mcp-config-sync --list-all
# Preview removal of a specific server from all configurations
mcp-config-sync --remove server-name
# Actually remove a specific server from all configurations
mcp-config-sync --remove server-name --sync
# Skip creating backup files during sync
mcp-config-sync --sync --no-backup
# Enable verbose logging
mcp-config-sync --verbose
Python API Usage
from mcp_config_sync import MCPServerSync
# Initialize the synchronizer for all apps
syncer = MCPServerSync()
# Or initialize for specific apps
syncer = MCPServerSync(apps=["amazonq", "cline"])
# Or use custom config files
syncer = MCPServerSync(config_files=["/path/to/config1.json", "/path/to/config2.json"])
# Discover existing configuration files
syncer.discover_config_files()
# Combine MCP servers from all files
syncer.combine_mcp_servers()
# Get all servers
servers = syncer.list_all_servers()
print(f"Found {len(servers)} MCP servers")
# Sync configurations across all files
results = syncer.replace_all_configs()
Working with Apps
from mcp_config_sync import get_all_apps, get_app_names, get_app
# Get all available apps
apps = get_all_apps()
print(f"Available apps: {list(apps.keys())}")
# Get app names only
app_names = get_app_names()
print(f"App names: {app_names}")
# Get specific app info
app = get_app("amazonq")
if app:
print(f"App: {app.display_name}")
print(f"Config: {app.config_path}")
Supported Applications
MCP Config Sync supports the following MCP-compatible applications:
| App Name | Display Name | Description | Config Path |
|---|---|---|---|
amazonq |
Amazon Q | Amazon Q AI assistant configuration | ~/.aws/amazonq/mcp.json |
cline |
Cline (VS Code) | Cline VS Code extension MCP settings | ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json |
claude-desktop |
Claude Desktop | Anthropic Claude Desktop application | ~/Library/Application Support/Claude/claude_desktop_config.json |
Adding New Applications
To add support for a new MCP application, you can:
- Submit a Pull Request: Add the new app to
mcp_config_sync/apps.py - Use Custom Config Files: Use the
--config-filesoption for one-off usage
Example PR to add a new app:
# In mcp_config_sync/apps.py
"new-app": MCPApp(
name="new-app",
display_name="New MCP App",
config_path="~/path/to/new-app/config.json",
description="Description of the new MCP application",
homepage="https://example.com",
),
You can specify custom paths using the --config-files option:
mcp-config-sync --config-files /path/to/config1.json /path/to/config2.json
Configuration File Format
MCP configuration files should contain a mcpServers object:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"]
},
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "your-api-key"
}
}
}
}
Examples
Basic Synchronization
# Preview changes for all registered MCP applications (default)
mcp-config-sync
# Actually sync all registered MCP applications
mcp-config-sync --sync
This will:
- Discover all existing MCP configuration files for registered apps
- Extract and combine unique MCP servers
- Show a preview of what changes would be made (default behavior)
- With
--sync: Create backups of existing files and write the unified configuration to all files
Sync Specific Applications
# Preview changes for only Amazon Q and Cline
mcp-config-sync --apps amazonq cline
# Actually sync only Amazon Q and Cline
mcp-config-sync --apps amazonq cline --sync
List Available Applications
mcp-config-sync --list-apps
Output:
============================================================
AVAILABLE MCP APPLICATIONS
============================================================
Found 3 registered MCP applications:
----------------------------------------
📱 App: amazonq
Display Name: Amazon Q
Description: Amazon Q AI assistant configuration
Config Path: ~/.aws/amazonq/mcp.json
Status: ✓ CONFIG EXISTS
Homepage: https://aws.amazon.com/q/
📱 App: cline
Display Name: Cline (VS Code)
Description: Cline VS Code extension MCP settings
Config Path: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Status: ✓ CONFIG EXISTS
Homepage: https://github.com/saoudrizwan/claude-dev
📱 App: claude-desktop
Display Name: Claude Desktop
Description: Anthropic Claude Desktop application
Config Path: ~/Library/Application Support/Claude/claude_desktop_config.json
Status: ✓ CONFIG EXISTS
Homepage: https://claude.ai/
============================================================
Total: 3 applications (3 with existing configs)
============================================================
List All Servers
mcp-config-sync --list-all
Output:
============================================================
ALL MCP SERVERS
============================================================
Found 3 MCP servers:
----------------------------------------
🔧 Server: filesystem
Command: npx
Args: -y @modelcontextprotocol/server-filesystem /Users/jon/Documents
🔧 Server: brave-search
Command: npx
Args: -y @modelcontextprotocol/server-brave-search
Environment Variables: BRAVE_API_KEY
🔧 Server: postgres
Command: npx
Args: -y @modelcontextprotocol/server-postgres
Environment Variables: POSTGRES_CONNECTION_STRING
Remove a Server
# Preview removal of a specific server from all configurations
mcp-config-sync --remove old-server-name
# Actually remove a specific server from all configurations
mcp-config-sync --remove old-server-name --sync
Preview Changes
# See what would be changed without modifying files (default behavior)
mcp-config-sync --verbose
# The old --dry-run flag is deprecated but still works
mcp-config-sync --dry-run --verbose
Development
Setting up Development Environment
git clone https://github.com/jon-the-dev/mcp_config_sync.git
cd mcp_config_sync
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Running Tests
pytest
Code Formatting
# Format code
black mcp_config_sync/
# Sort imports
isort mcp_config_sync/
# Type checking
mypy mcp_config_sync/
Publishing to PyPI
First Time Setup
Build and Upload
# Build the package
python -m build
# Upload to TestPyPI first (recommended)
python -m twine upload --repository testpypi dist/*
# Test installation from TestPyPI
pip install --index-url https://test.pypi.org/simple/ mcp-config-sync
# Upload to PyPI
python -m twine upload dist/*
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
pytest - Format code:
black . && isort . - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Jon - jon@zer0day.net
Changelog
v0.2.0 (2025-01-08)
- BREAKING CHANGE: Default behavior now shows preview instead of performing sync
- Added
--syncflag to actually perform destructive operations - Added detailed diff preview showing what changes would be made
- Deprecated
--dry-runflag in favor of default preview behavior - Updated help text and documentation with new usage examples
- Maintains backward compatibility with deprecation warnings
v0.1.0 (2025-01-07)
- Initial release
- Basic MCP server synchronization functionality
- Command-line interface
- Python API
- Support for common MCP configuration file locations
- Backup and dry-run capabilities
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_config_sync-0.2.0.tar.gz.
File metadata
- Download URL: mcp_config_sync-0.2.0.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
658886d9b3c43dbfb5b172a14100aaf737bed772c8b1dc9d04fb8e7e271aa064
|
|
| MD5 |
17a9c66bdd7961fd003965f0d6f8160e
|
|
| BLAKE2b-256 |
eab5e6b78c67775813be638292d83c68cf4ea182dbf55c824bfe432df752c0d9
|
File details
Details for the file mcp_config_sync-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_config_sync-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de9e31ac697aa9f922cfa689d5475dc9c13ab75d0294c15b77e8adea4709fa76
|
|
| MD5 |
7cfb90e45a03d19a9e66210e7229a84f
|
|
| BLAKE2b-256 |
9121c0f3ba8416635bcf0dc8d5c784d72c3b77dd6a8e7ae8a3395abbacb9d8de
|