Skip to content

LoneExile/lmcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

lmcp

Lightweight MCP Manager - A lightweight CLI tool to manage your Claude MCP servers

Toggle Model Context Protocol (MCP) servers on and off without losing your configurations. Perfect for managing multiple MCP servers and quickly switching between different setups.

✨ Features

  • 🎯 Interactive UI - Intuitive checkbox interface for toggling servers
  • πŸ’Ύ Configuration Preservation - Disabled servers are safely stored, not deleted
  • ⚑ Fast Switching - Quickly enable/disable servers without editing JSON files
  • πŸ”„ Bulk Operations - Toggle all servers or invert selection with a single key
  • 🎨 Color-Coded Status - Visual indicators for active (βœ“) and disabled (βœ—) servers
  • πŸ›‘οΈ Safe Defaults - Never overwrites your existing configurations

πŸ“¦ Installation

Global Installation (Recommended)

npm install -g lmcp

Using npx (No Installation)

npx lmcp

From Source

git clone https://github.com/loneexile/lmcp.git
cd lmcp
pnpm install
pnpm build
pnpm link --global

πŸš€ Quick Start

Simply run the command:

lmcp

You'll see an interactive interface:

❯ lmcp
MCP Server Manager
Select which MCP servers should be active in Claude:

? Toggle MCP servers (active servers will be in ~/.claude.json):
❯◉ βœ“ github (active)
 β—‰ βœ“ context7 (active)
 β—― βœ— playwright (disabled)
 β—― βœ— postgres (disabled)
 β—― βœ— docker-mcp (disabled)

↑↓ navigate β€’ space select β€’ a all β€’ i invert β€’ ⏎ submit

Keyboard Shortcuts

Key Action
↑ ↓ Navigate through servers
Space Toggle individual server
a Toggle all servers
i Invert current selection
Enter Apply changes
Ctrl+C Cancel without changes

πŸ’‘ How It Works

lmcp manages two configuration files:

  1. ~/.claude.json - Contains your active MCP servers (loaded by Claude)
  2. ~/.lmcp.json - Stores disabled servers (preserved but not loaded)

When you toggle a server:

  • βœ… Enabled β†’ Server config moved to ~/.claude.json
  • ❌ Disabled β†’ Server config moved to ~/.lmcp.json

Your server configurations are never deleted, just moved between files. This means you can freely experiment with different server combinations without losing your setup.

Example Workflow

# 1. Run lmcp
lmcp

# 2. Use spacebar to select which servers should be active
#    For example, enable only 'github' and 'context7'

# 3. Press Enter to apply

# Output:
βœ“ Enabled: github
βœ“ Enabled: context7
βœ— Disabled: playwright
βœ— Disabled: postgres

Configuration updated successfully!
Active servers: 2
Disabled servers: 2

πŸ”§ Use Cases

Testing Individual Servers

Quickly enable only one server to test its functionality:

lmcp  # Disable all except the one you want to test

Development vs Production

Maintain separate sets of servers for different environments:

  • Development: Enable debugging and testing servers
  • Production: Enable only essential, stable servers

Performance Optimization

Claude loads faster with fewer servers. Disable unused servers to improve startup time.

Troubleshooting

When Claude behaves unexpectedly, disable all servers and enable them one-by-one to identify the problematic server.

πŸ“š Documentation

Comprehensive documentation is available in the /docs directory:

πŸ“‹ Requirements

  • Node.js 16 or higher
  • Claude Desktop with an existing ~/.claude.json configuration file
  • MCP Servers already configured in ~/.claude.json

πŸ—οΈ Project Structure

lmcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts      # CLI entry point
β”‚   β”œβ”€β”€ config.ts     # Configuration file handlers
β”‚   β”œβ”€β”€ manager.ts    # Server toggle logic
β”‚   β”œβ”€β”€ ui.ts         # Interactive UI
β”‚   └── types.ts      # TypeScript types
β”œβ”€β”€ openspec/         # OpenSpec documentation
β”œβ”€β”€ package.json
└── README.md

πŸ› οΈ Development

Setup

# Clone the repository
git clone https://github.com/loneexile/lmcp.git
cd lmcp

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Build for production
pnpm build

# Link for local testing
pnpm link --global

Scripts

pnpm build        # Compile TypeScript
pnpm dev          # Run in development mode
pnpm lint         # Run Biome linter
pnpm lint:fix     # Fix linting issues
pnpm format       # Format code with Biome
pnpm typecheck    # Type check without building

Code Quality

This project uses:

  • TypeScript with strict mode
  • Biome for linting and formatting
  • Tab indentation and double quotes

πŸ› Troubleshooting

No MCP servers found error

Cause: No ~/.claude.json or ~/.lmcp.json files exist

Solution: Make sure you have Claude Desktop installed and at least one MCP server configured. See Claude MCP documentation for setup instructions.

Changes not reflected in Claude

Cause: Claude needs to be restarted to reload configurations

Solution: Quit and restart Claude Desktop after making changes.

Permission errors

Cause: Insufficient permissions to read/write config files

Solution:

# Check file permissions
ls -la ~/.claude.json ~/.lmcp.json

# Fix permissions if needed (macOS/Linux)
chmod 644 ~/.claude.json ~/.lmcp.json

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

πŸ“„ License

MIT

πŸ”— Links

🌟 Acknowledgments

Inspired by claude-ext by Jacob Wang.

Built for the Claude Desktop and Model Context Protocol ecosystem.


Made with ❀️ by LoneExile

About

CLI tool to manage Claude MCP servers - toggle between active and disabled states

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors