Advanced Examples
Real-world usage scenarios and advanced configurations for MCP Server Manager.
Multi-Project Setup with Profiles
Manage different server configurations for different projects using profiles.
Scenario: Web Developer with Multiple Projects
# Create profiles for different project types
mcpsm profile create frontend
mcpsm profile create backend
mcpsm profile create fullstack
# Add servers to frontend profile
mcpsm profile add frontend filesystem
mcpsm profile add frontend github
# Add servers to backend profile
mcpsm profile add backend postgres
mcpsm profile add backend redis
mcpsm profile add backend docker
# Fullstack gets everything
mcpsm profile add fullstack filesystem
mcpsm profile add fullstack github
mcpsm profile add fullstack postgres
mcpsm profile add fullstack docker
# Switch between profiles as needed
mcpsm profile use frontend # When working on React app
mcpsm profile use backend # When working on API
mcpsm profile use fullstack # When working on everythingRemote Server Configuration
HTTP Server with Bearer Token
mcpsm add stripe \
--type http \
--url "https://mcp.stripe.com" \
--token "sk_live_..."SSE Server with OAuth
mcpsm add company-api \
--type sse \
--url "https://api.company.com/mcp/sse" \
--oauthThen authenticate:
mcpsm auth login company-apiCustom Headers
For servers requiring custom headers, edit the config directly:
mcpsm config{
"remoteServers": [
{
"id": "custom-api",
"name": "Custom API",
"type": "http",
"url": "https://api.example.com/mcp",
"headers": {
"X-API-Key": "your-api-key",
"X-Custom-Header": "value"
}
}
]
}Tool Filtering for Token Optimization
Reduce context token usage by disabling unnecessary tools.
View token usage by tool
mcpsm tokens --detailedOutput:
Server: filesystem (4,250 tokens)
├─ read_file 1,200 tokens ✓ enabled
├─ write_file 1,100 tokens ✓ enabled
├─ list_directory 800 tokens ✓ enabled
├─ search_files 750 tokens ✗ disabled
└─ get_file_info 400 tokens ✓ enabledDisable high-token tools you don't need
# Disable specific tools
mcpsm tools disable filesystem search_files
mcpsm tools disable github list_commits
# Or use TUI for visual selection
mcpsm
# Press T to open tools screenCreate a minimal tool set
# Disable all tools first
mcpsm tools disable filesystem --all
# Enable only what you need
mcpsm tools enable filesystem read_file
mcpsm tools enable filesystem write_file
mcpsm tools enable filesystem list_directoryAutomation and CI/CD Integration
Export configuration for backup
# Export to JSON file
mcpsm export -o ~/backups/mcp-config-$(date +%Y%m%d).json
# Export in Claude format
mcpsm export --format claude -o claude-config.jsonImport on a new machine
# From backup file
mcpsm import ~/backups/mcp-config-20240115.json
# From existing client
mcpsm import --from claude
mcpsm import --from cursorCI/CD Pipeline Script
#!/bin/bash
# setup-mcp.sh - Run on new development machines
# Install mcpsm
npm install -g mcp-server-manager
# Import standard config from URL or local file
mcpsm import ./team-mcp-config.json
# Enable required clients
mcpsm clients enable claude
mcpsm clients enable cursor
# Sync to all enabled clients
mcpsm clients sync
# Test all servers
mcpsm test
# Start daemon with auto-startup
mcpsm start
mcpsm startup enableJSON Output for Scripts
# List servers as JSON
mcpsm list --json | jq '.servers[].name'
# Check specific server status
mcpsm test filesystem --json | jq '.status'
# Get client sync status
mcpsm clients --json | jq '.[] | select(.enabled == true)'Daemon and Gateway Configuration
Running as Background Service
# Start daemon
mcpsm start
# Enable auto-start on boot
mcpsm startup enable
# View live logs
mcpsm logs -f
# Check status
mcpsm statusCustom Port Configuration
# Change gateway port
mcpsm port 9000
# Verify the change
mcpsm settings get portUsing with Multiple Claude Desktop Windows
The daemon allows multiple Claude Desktop windows to share the same MCP servers:
- Start the daemon:
mcpsm start - All Claude windows connect to the same gateway
- Server state is shared across windows
Multi-Client Synchronization
Sync specific servers to specific clients
# Enable clients
mcpsm clients enable claude
mcpsm clients enable cursor
mcpsm clients enable windsurf
# Sync all servers to all enabled clients
mcpsm clients sync
# Or sync to specific client
mcpsm clients sync claudeDifferent configurations per client
Use profiles combined with manual sync:
# Set up work profile
mcpsm profile use work
mcpsm clients sync cursor
# Set up personal profile
mcpsm profile use personal
mcpsm clients sync claudeLocal Development Servers
Filesystem server with specific paths
mcpsm add project-files \
--type stdio \
--command "npx" \
--args "-y @modelcontextprotocol/server-filesystem /Users/me/projects"Multiple filesystem servers for different directories
# Documents
mcpsm add docs \
--type stdio \
--command "npx" \
--args "-y @modelcontextprotocol/server-filesystem ~/Documents"
# Code
mcpsm add code \
--type stdio \
--command "npx" \
--args "-y @modelcontextprotocol/server-filesystem ~/Code"
# Downloads (disabled by default)
mcpsm add downloads \
--type stdio \
--command "npx" \
--args "-y @modelcontextprotocol/server-filesystem ~/Downloads"
mcpsm disable downloadsGitHub server with personal token
mcpsm add github \
--type stdio \
--command "npx" \
--args "-y @modelcontextprotocol/server-github" \
--env "GITHUB_PERSONAL_ACCESS_TOKEN=ghp_..."Health Monitoring
Regular health checks
# Run comprehensive health check
mcpsm doctor
# Test all servers
mcpsm test
# View server status with token counts
mcpsm list --tokensCreate a monitoring script
#!/bin/bash
# monitor-mcp.sh
# Test servers
result=$(mcpsm test --json)
# Check for failures
failures=$(echo $result | jq '[.[] | select(.status == "failed")] | length')
if [ "$failures" -gt 0 ]; then
echo "MCP Server Alert: $failures server(s) failed"
echo $result | jq '.[] | select(.status == "failed")'
# Send notification, write to log, etc.
fiTips and Best Practices
1. Start with minimal servers
Only add servers you actually need. More servers = more tokens = higher costs.
2. Use profiles
Group servers by context. Switch profiles instead of enabling/disabling individual servers.
3. Monitor token usage
Run mcpsm tokens regularly to see which servers and tools consume the most tokens.
4. Keep daemon running
Use mcpsm startup enable to ensure the gateway is always available.
5. Export regularly
Back up your configuration: mcpsm export -o backup.json
6. Test before syncing
Always run mcpsm test before syncing to clients to catch broken servers.