
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A Python library that adds MCP server support to Click CLI applications by converting their commands into MCP tools.
click-mcp is cataloged as an MCP server attributed to crowecawcaw. A Python library that adds MCP server support to Click CLI applications by converting their commands into MCP tools. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for click-mcp are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
It converts Click commands into MCP tools so agents can discover and invoke them, for example invoking a greet command with a name parameter.
Yes, the default mcp command name can be customized using the command_name parameter.
README.md · d7cddc83def7 · 采集于 2026-11-13 10:05:13 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
A Python library that extends Click applications with Model Context Protocol (MCP) support, allowing AI agents to interact with CLI tools.
click-mcp provides a simple decorator that converts Click commands into MCP tools. This enables AI agents to discover and interact with your CLI applications programmatically.
The Model Context Protocol (MCP) is an open standard for AI agents to interact with tools and applications in a structured way.
@click_mcp decorator syntaxpip install click-mcp
import click
from click_mcp import click_mcp
@click_mcp(server_name="my-cli-app")
@click.group()
def cli():
"""Sample CLI application."""
pass
@cli.command()
@click.option('--name', required=True, help='Name to greet')
def greet(name):
"""Greet someone."""
click.echo(f"Hello, {name}!")
if __name__ == '__main__':
cli()
When you run the MCP server, Click commands are converted into MCP tools:
greet becomes MCP tool greetusers.create)To invoke a command via MCP, send a request like:
{
"type": "invoke",
"tool": "greet",
"parameters": {
"name": "World"
}
}
To start the MCP server:
$ python my_app.py mcp
By default, click-mcp adds an mcp command to your CLI application. You can customize this name using the command_name parameter:
@click_mcp(command_name="start-mcp")
@click.group()
def cli():
"""Sample CLI application with custom MCP command name."""
pass
With this configuration, you would start the MCP server using:
$ python my_app.py start-mcp
This can be useful when:
You can also customize the name of the MCP server that's reported to clients:
@click_mcp(server_name="my-custom-tool")
@click.group()
def cli():
"""Sample CLI application with custom server name."""
pass
This can be useful when:
click-mcp supports nested command groups. When you have a complex CLI structure with subcommands, all commands are exposed as MCP tools:
@click_mcp
@click.group()
def cli():
"""Main CLI application."""
pass
@cli.group()
def users():
"""User management commands."""
pass
@users.command()
@click.option('--username', required=True)
def create(username):
"""Create a new user."""
click.echo(f"Creating user: {username}")
@users.command()
@click.argument('username')
def delete(username):
"""Delete a user."""
click.echo(f"Deleting user: {username}")
When exposed as MCP tools, the nested commands will be available with their full path using dot notation (e.g., "users.create" and "users.delete").
Click supports positional arguments using @click.argument(). When these are converted to MCP tools, they are represented as named parameters in the schema:
@cli.command()
@click.argument('source')
@click.argument('destination')
@click.option('--overwrite', is_flag=True, help='Overwrite destination if it exists')
def copy(source, destination, overwrite):
"""Copy a file from source to destination."""
click.echo(f"Copying {source} to {destination}")
This command is converted to an MCP tool with the following schema:
{
"type": "object",
"properties": {
"source": {
"description": "",
"schema": { "type": "string" },
"required": true
},
"destination": {
"description": "",
"schema": { "type": "string" },
"required": true
},
"overwrite": {
"description": "Overwrite destination if it exists",
"schema": { "type": "boolean" }
}
},
"required": ["source", "destination"]
}
The positional nature of arguments is handled internally by click-mcp. When invoking the command, you can use named parameters:
{
"type": "invoke",
"tool": "copy",
"parameters": {
"source": "file.txt",
"destination": "/tmp/file.txt",
"overwrite": true
}
}
The MCP server will correctly convert these to positional arguments when executing the Click command:
copy file.txt /tmp/file.txt --overwrite
When a Click command raises an exception, click-mcp captures the error and returns it as part of the MCP response. This allows AI agents to handle errors gracefully:
@cli.command()
@click.option('--filename', required=True)
def process(filename):
"""Process a file."""
try:
with open(filename, 'r') as f:
content = f.read()
click.echo(f"Processed file: {filename}")
except FileNotFoundError:
raise click.UsageError(f"File not found: {filename}")
If the file doesn't exist, the AI agent will receive an error message that it can present to the user or use to take corrective action.
Clone the repository and install Hatch:
git clone https://github.com/aws/click-mcp.git
cd click-mcp
pip install hatch
Run tests with Hatch:
# Run all tests
hatch run test
# Run tests with coverage
hatch run cov
Format code with Black:
# Format code
hatch run format
# Check formatting
hatch run check-format
Run linting checks with Ruff:
hatch run lint
Run type checking with MyPy:
hatch run typecheck
Run all checks (formatting, linting, type checking, and tests):
hatch run check-all
Build the package:
hatch run build
Generate documentation:
hatch run docs
MIT
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for click-mcp from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/click-mcp)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.