SK

shane-kercheval/mcp-this

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 3 forks 质量 72 趋势 10Apache-2.0

MCP-这允许你将任何命令行工具转换为MCP工具,并创建结构化提示模板,任何MCP客户端(例如Claude Desktop)都能使用。ER用于任何命令

概览

一个MCP服务器,通过YAML配置文件动态展示CLI/bash命令作为工具和提示模板。 MCP-这允许你将任何命令行工具转换为MCP工具,并创建任何MCP客户端(例如Claude Desktop)都能使用的结构化提示模板。你无需编写代码,只需在YAML文件中定义命令、提示符及其参数,MCP服务器即可向像Claude Desktop这样的MCP客户端提供。 将CLI命令转换为MCP工具,并使用简单的YAML配置创建可重复使用的提示模板。 在 YAML 中定义(CLI 命令)和(AI 模板): 就是这样!Claude 现在可以:- (获取当前时间,系统信息) - (带引导参数的代码审查员) 用结构化提示模板增强你的my-tools.yaml: 1. 点击消息输入中的+图标 2.选择“从mcp-this-custom添加” 3.选择提示词(例如,“summarize-webpage”) 4.

概述(AI 翻译)

一个MCP服务器,通过YAML配置文件动态将CLI/bash命令作为工具和提示模板暴露。

mcp-this 允许你将任何命令行工具转换为 MCP 工具,并创建结构化提示模板,任何 MCP 客户端(例如 Claude Desktop)都能使用。你无需编写代码,只需在 YAML 文件中定义命令、提示符及其参数,MCP 服务器即可向像 Claude Desktop 这样的 MCP 客户端开放。

核心价值: 将 CLI 命令转换为 MCP 工具,并使用简单的 YAML 配置创建可重复使用的提示模板。


工作原理

在 YAML 中定义 tools(CLI 命令)和 prompts(AI 模板):

在 Claude Desktop 中的应用:

就是这样!克劳德现在可以:

  • 执行你自定义的CLI工具(获取当前时间,系统信息)
  • 使用你的结构化提示模板(带引导论证的代码审查员)

快速启动

1.安装uvx

2.创建你的第一个工具

创建my-tools.yaml:

2.1.添加AI提示模板(可选)

用结构化提示模板增强你的my-tools.yaml:

在Claude Desktop中使用提示词:

  1. 点击消息输入中的+图标
  2. 选择“从mcp-this-custom添加”

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

mcp-this

An MCP Server that dynamically exposes CLI/bash commands as tools and prompt templates through YAML configuration files.

mcp-this lets you turn any command-line tool into an MCP tool and create structured prompt templates that any MCP Client (e.g. Claude Desktop) can use. Instead of writing code, you simply define commands, prompts, and their parameters in YAML files, and the MCP Server makes them available to MCP Clients like Claude Desktop.

Core Value: Transform CLI commands into MCP tools and create reusable prompt templates using simple YAML configuration.


How It Works

Define tools (CLI commands) and prompts (AI templates) in YAML:

tools:
  get-current-time:
    description: |
      Display the current date and time in various formats.
      
      Examples:
      - get_current_time(format="iso") → 2025-05-18T17:17:39Z
      - get_current_time(format="readable") → Friday, May 18, 2025 5:17 PM
    execution:
      command: >-
        if [ ">" = "iso" ]; then 
          date -u +"%Y-%m-%dT%H:%M:%SZ"; 
        elif [ ">" = "readable" ]; then 
          date "+%A, %B %d, %Y %I:%M %p"; 
        else 
          echo "ISO: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"; 
          echo "Readable: $(date "+%A, %B %d, %Y %I:%M %p")"; 
        fi
    parameters:
      format:
        description: "Time format: iso, readable, or empty for both"
        required: false

  system-info:
    description: Get basic system information
    execution:
      command: uname -a && echo "CPU: $(nproc) cores"
    parameters: {}

prompts:
  code-reviewer:
    description: Perform a thorough code review with best practices focus
    template: |
      Please review the following code with a focus on:
      - Code quality and best practices
      - Security vulnerabilities
      - Performance considerations
      {{#if focus_area}}- Special attention to: {{focus_area}}{{/if}}
      
      Code to review:
      {{code}}
      
      {{#if context}}Additional context: {{context}}{{/if}}
    arguments:
      code:
        description: Code to review
        required: true
      focus_area:
        description: Specific area to focus on (e.g., security, performance)
        required: false
      context:
        description: Additional context about the code
        required: false

Use in Claude Desktop:

{
  "mcpServers": {
    "mcp-this-custom": {
      "command": "uvx",
      "args": ["mcp-this", "--config-path", "/path/to/your-tools.yaml"]
    }
  }
}

That’s it! Claude can now:

  • Execute your custom CLI tools (get-current-time, system-info)
  • Use your structured prompt templates (code-reviewer with guided arguments)

Quick Start

1. Install uvx

# Install uv (includes uvx)
curl -LsSf https://astral.sh/uv/install.sh | sh

2. Create Your First Tool

Create my-tools.yaml:

tools:
  web-scraper:
在 GitHub 查看完整 README

安装

uvx mcp-this --config-path /path/to/your-tools.yaml
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-this-custom": { "command": "uvx", "args": ["mcp-this", "--config-path", "/path/to/your-tools.yaml"] } } }