Skip to main content
Glama

cli2mcp

Turn any command-line tool into an MCP server in one line.

License Language Status Python MCP License


🎯 Why?

MCP is becoming the default way for agents to call tools, but most useful internal tools are still plain CLIs. Building a full MCP server for each command requires SDK boilerplate, packaging, and maintenance. cli2mcp fills this gap with a zero-dependency adapter that turns a command template into a callable MCP tool instantly.

Target audience: Agent developers, platform engineers, and AI tinkerers who want to expose CLI utilities, scripts, and internal tools to Claude, Cursor, or custom MCP clients without writing server code.

Related MCP server: cli2mcp

✨ Features

  • Wrap any command with {placeholders} as an MCP tool

  • Auto-generate JSON Schema from placeholders

  • Works over stdio with initialize, tools/list, and tools/call

  • Timeouts, stderr capture, and non-zero exit reporting

🚀 Quick Start

# Install
pip install cli2mcp

# Run
cli2mcp --help

📦 Installation

From Source

git clone https://github.com/YOUR_USERNAME/cli2mcp.git
cd cli2mcp
# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest -v

🎬 Demo

The GIF above was recorded using Charm VHS:

vhs < demo.tape

📖 Usage

# Show help
cli2mcp --help

# Common usage examples
cli2mcp --example

🏗️ Architecture

graph LR
    A[Input] --> B[Core Engine]
    B --> C[Output]
    B --> D[Plugins]
    D --> E[Extensions]

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repo

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

📄 License

MIT © 2026 — See LICENSE for details.


If this project helped you, please ⭐ star it!

Made with ❤️ and AI

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Wrap any CLI as a Model Context Protocol (MCP) server for Claude, ChatGPT, Cursor, Gemini and any MCP-compatible client — schema auto-inferred from --help.
    23
    12
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to call any CLI tool by scanning its help output and serving it as an MCP server.
    1
    GPL 3.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Universal MCP server that wraps any CLI tool, enabling AI assistants to run commands via natural language.
    MIT