MCP Server that exposes CLI commands as tools for Claude using YAML configuration files
Project description
MCP-This
MCP Server that exposes CLI commands as tools using YAML files.
mcp-this is an MCP server that makes command-line tools available to Claude via the Model-Control-Protocol. The server reads YAML configuration files to define which commands should be exposed as MCP tools, along with their parameters and execution details. This allows Claude to execute CLI commands without requiring you to write any code.
📋 Features
- 🔧 Dynamic Tool Creation: Define CLI tools in YAML without writing code
- 🔄 Command Execution: Execute shell commands with parameter substitution
- 📁 Working Directory Support: Run commands in specific directories
- 🧩 Toolset Organization: Group related tools into logical toolsets
- 🤖 Claude Integration: Seamless integration with Claude Desktop
🚀 Installation
Using pip
pip install mcp-this
Using uv (recommended)
uv pip install mcp-this
🏁 Quick Start
- Create a YAML configuration file:
Using top-level tools
tools:
curl:
description: "Make HTTP requests"
execution:
command: "curl <<arguments>>"
parameters:
arguments:
description: "Complete curl arguments including options and URL"
required: true
Using toolsets
A toolset is a way to organize groups of tools. In the future, toolsets could, for example, share settings like allow/deny lists. Toolsets could also be used, for example, to enable/disable/search for sets of tools.
toolsets:
curl:
description: "Transfer data from or to a server"
tools:
curl:
description: "Make HTTP requests"
execution:
command: "curl <<arguments>>"
parameters:
arguments:
description: "Complete curl arguments including options and URL"
required: true
- Run the MCP server:
# Using tools path
mcp-this --tools-path /path/to/your/config.yaml
# Using JSON string directly
mcp-this --tools '{"tools": {"echo": {"description": "Echo command", "execution": {"command": "echo <<message>>"}, "parameters": {"message": {"description": "Message to echo", "required": true}}}}}'
# Using environment variable
export MCP_THIS_CONFIG_PATH=/path/to/your/config.yaml
mcp-this
🛠️ Configuration Structure
The configuration YAML files can follow one of two structures:
Toolsets Format (Original)
This format organizes tools into logical groups called toolsets:
toolsets:
toolset_name:
description: "Toolset description"
tools:
tool_name:
description: "Tool description"
execution:
command: "command template with <<parameter>> placeholders"
parameters:
parameter_name:
description: "Parameter description"
required: true/false
Top-level Tools Format (New)
This simpler format defines tools directly at the top level:
tools:
tool_name:
description: "Tool description"
execution:
command: "command template with <<parameter>> placeholders"
parameters:
parameter_name:
description: "Parameter description"
required: true/false
Combined Format
You can also use both formats in the same file:
tools:
echo:
description: "Simple echo command"
execution:
command: "echo <<message>>"
parameters:
message:
description: "Message to echo"
required: true
toolsets:
file:
description: "File operations"
tools:
cat:
description: "Display file contents"
execution:
command: "cat <<file_path>>"
parameters:
file_path:
description: "Path to file"
required: true
Parameter Substitution
Parameters in command templates use the <<parameter>> syntax:
command: "find . -name \"<<pattern>>\" -type f | xargs wc -l"
When the tool is invoked, these placeholders are replaced with the actual parameter values.
🔌 Claude Desktop Integration
Using npx and uvx (Recommended)
The simplest way to configure Claude Desktop is to use npx and uvx to install and run mcp-this on demand:
{
"mcpServers": {
"mcp-this": {
"command": "npx",
"args": [
"-y",
"uvx",
"mcp-this",
"--tools-path",
"/path/to/your/config.yaml"
],
"env": {
"SOME_API_KEY": "your-secret-key"
}
}
}
}
This approach:
- Automatically installs the latest version from PyPI when needed
- Doesn't require manual installation or updates
- Cleanly isolates dependencies
Using the default configuration
If you want to use the default configuration that comes with the package:
{
"mcpServers": {
"mcp-this": {
"command": "npx",
"args": [
"-y",
"uvx",
"mcp-this"
]
}
}
}
Using a locally installed package
If you've installed mcp-this globally or in your environment:
{
"mcpServers": {
"mcp-this": {
"command": "mcp-this",
"args": ["--tools-path", "/path/to/your/config.yaml"],
"env": {
"SOME_API_KEY": "your-secret-key"
}
}
}
}
🧪 Development
Setup Development Environment
# Clone the repository
git clone https://github.com/your-username/mcp-this.git
cd mcp-this
# Install dependencies
uv sync
Development Commands
# Run linting
make linting
# Run tests
make tests
# Run the MCP server in development mode
make mcp_dev
# Build package
make package-build
# Publish package to PyPI
make package-publish
Testing with MCP Inspector
# Test with MCP Inspector using environment variable
MCP_THIS_CONFIG_PATH=./path/to/config.yaml uv run mcp dev ./src/mcp_this/mcp_server.py
# Test with MCP Inspector using command-line flags
uv run mcp dev -m mcp_this --tools-path ./path/to/config.yaml
# Test with MCP Inspector using JSON string
uv run mcp dev -m mcp_this --tools '{"tools": {"example": {"description": "Example tool", "execution": {"command": "echo Test"}}}}'
📚 Examples
Check out the examples directory for sample configuration files and usage patterns:
- top_level_tools_example.yaml: Example of the simplified top-level tools format
- toolset_example__curl.yaml: Example of the original toolsets format
📜 License
This project is licensed under the terms of the LICENSE file included in the repository.
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_this-0.0.3.tar.gz.
File metadata
- Download URL: mcp_this-0.0.3.tar.gz
- Upload date:
- Size: 92.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8acce3bba5112f83af71df59924e0a7ff7ecb2be22f53f2f572274a62932be62
|
|
| MD5 |
e36f5cd7399113e3f5c4a0ab64465a8f
|
|
| BLAKE2b-256 |
684d29d2ca1844e8dadf194e195065c29a812fadd135ab9a678a830d6c3ff16f
|
File details
Details for the file mcp_this-0.0.3-py3-none-any.whl.
File metadata
- Download URL: mcp_this-0.0.3-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a6d0303d29140ea642dfb2aecd6527b72715f88ff589602f70c010546cb9354
|
|
| MD5 |
dd5b5e1b9bb573d654ba01aff007861a
|
|
| BLAKE2b-256 |
98008c2944b4c427f120eac05ed527434759e2ad1d8a7a58c291642c8035ee30
|