YM

ydmitry/mcp-tools-cookbook

开发工具

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

20 stars 3 forks 质量 56 趋势 10

一套全面的模型上下文协议(MCP)工具模式和配方合集。这本食谱展示了各种MCP设计模式,你可以作为构建自己......

概览

一套全面的模型上下文协议(MCP)工具模式和配方合集。本手册展示了各种MCP设计模式,您可以作为构建模块,用于自有的AI驱动应用。 本食谱展示了关键的MCP工具模式: - - 现成可用的全面代码审查提示 - - 动态反应(Reason + Act)模式提示生成 - : 将MCP转换为提示仓库服务 - - 通过智能问题进行渐进式信息收集- :通过提出有针对性的问题,优雅地处理不完整的用户输入 - → - 顺序工具依赖 - :复杂的工作流,需要状态管理和有序执行 - - 桥接外部工具(如web_search)与MCP处理- :从服务器端扩展和编排本地客户端工具 - - 通过嵌入命令建议下一步行动的工具 - , , , - 有趣的示例工具 - : 引导对话流程通过工具响应内容 看看这些MCP工具模式......

概述(AI 翻译)

一套全面的模型上下文协议(MCP)工具模式和配方合集。本手册展示了各种MCP设计模式,您可以作为构建模块,用于自有的AI驱动应用。

🧑 🍳 可用配方(图案)

本食谱展示了关键的MCP工具模式:

🎯 提示暴露模式

  • code_reviewer_prompt - 即用的全面代码审查提示
  • react_prompt_generator - 动态反应(Reason + Act)模式提示生成
  • 用例:将MCP转换为即时存储库服务

🤔 澄清问题模式

  • smart_recipe_generator - 前瞻性信息收集,提出智能问题
  • 用例:通过提出针对性的后续问题,优雅地处理不完整的用户输入

🔄 多步骤工具模式

  • step1_initialize_workflow → step2_execute_workflow - 顺序工具依赖关系
  • 用例:需要状态管理和有序执行的复杂工作流

🌐 客户端工具编排模式

  • sequential_web_search - 桥接外部工具(如web_search)与MCP处理

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

README

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

MCP Tools Cookbook

A comprehensive collection of Model Context Protocol (MCP) tool patterns and recipes. This cookbook demonstrates various MCP design patterns that you can use as building blocks for your own AI-powered applications.

🧑‍🍳 Available Recipes (Patterns)

This cookbook demonstrates essential MCP tool patterns:

🎯 Prompt Exposure Pattern

  • code_reviewer_prompt - Ready-to-use comprehensive code review prompts
  • react_prompt_generator - Dynamic ReAct (Reason + Act) pattern prompt generation
  • Use case: Transform MCP into a prompt repository service

🤔 Clarification Questions Pattern

  • smart_recipe_generator - Progressive information gathering with intelligent questions
  • Use case: Handle incomplete user input gracefully by asking targeted follow-up questions

🔄 Multi-Step Tool Pattern

  • step1_initialize_workflow → step2_execute_workflow - Sequential tool dependencies
  • Use case: Complex workflows requiring state management and ordered execution

🌐 Client Tool Orchestration Pattern

  • sequential_web_search - Bridges external tools (like web_search) with MCP processing
  • Use case: Extend and orchestrate native client tools from the server side

🎲 Response-Driven Navigation Pattern

  • tool_with_follow_up - Tools that suggest next actions through embedded commands
  • quantum_mood_analyzer, rubber_duck_debugger, coffee_brew_oracle - Fun example tools
  • Use case: Guide conversation flow through tool response content

📸 Patterns in Action

See these MCP tool patterns demonstrated in real AI conversations:

🎯 Prompt Exposure Pattern

The code_reviewer_prompt tool exposing a comprehensive, ready-to-use code review template

🤔 Clarification Questions Pattern

The smart_recipe_generator tool progressively gathering information through targeted questions

🌐 Client Tool Orchestration Pattern

The sequential_web_search tool orchestrating multiple web searches and processing results

🎲 Response-Driven Navigation Pattern

The tool_with_follow_up tool suggesting next actions, leading to rubber_duck_debugger execution

🚀 Quick Start

Setup Your Kitchen (Environment)

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Or use the convenient activation script:

source activate.sh

Using with AI Applications

Connect this cookbook to LLM applications that support MCP:

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-tools-cookbook": { "command": "python", "args": ["path-to-repository/mcp_server.py"] } } }