Token导航 LogoToken导航TokenDH.com
Cookiecutter MCP Server Bash logo
开发工具stdio官方级别未说明来源级核验

Cookiecutter MCP Server Bash

MCP Server

一个基于JSON-RPC 2.0协议的Cookiecutter模板管理服务器,支持本地和远程模板的项目快速生成与管理。

工具数

6

提示词数

0

GitHub Stars

0

资源数

0
开发工具ShellClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

greyhoundforty

提供方

greyhoundforty

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install cookiecutter

详细介绍

Cookiecutter MCP服务器

一个模型上下文协议(MCP)服务器,提供与Cookiecutter模板的无缝集成,用于快速构建项目框架。此服务器使您能够通过标准化的JSON-RPC 2.0接口从本地和远程Cookiecutter模板管理、测试和生成项目。

灵感与归因

特性

  • 🚀 模板管理 -列出、发现和管理Cookiecutter模板
  • 🌐 远程和本地支持 -使用GitHub存储库和本地模板目录
  • 📋 模板验证 -项目生成前测试模板可访问性
  • 🛠️ 灵活的配置 -通过JSON文件轻松配置模板
  • 📊 综合录井 -详细的日志记录和调试功能
  • ⚡ MCP协议 -完全符合JSON-RPC 2.0和MCP协议
  • 🎯 模板值 -支持自定义模板参数值

Claude desktop using cookiecutter mcp server

先决条件

  • 猛击 4.0+(macOS/Linux)
  • jq公司 -JSON处理器(brew install jqapt-get install jq)
  • 炊具切割器 -模板引擎(pip install cookiecutter)
  • Git -用于远程模板访问

安装

  1. 克隆存储库:
   git clone 
   cd cookiecutter-mcp-server
  1. 安装依赖项:
   # Install jq (if not already installed)
   brew install jq  # macOS
   # or
   sudo apt-get install jq  # Ubuntu/Debian

   # Install cookiecutter
   pip install cookiecutter
注: 此项目包括来自 MCP服务器Bash SDK。由于必要的文件已与此存储库捆绑在一起,因此不需要安装额外的SDK。

建筑

该项目建立在 MCP服务器Bash SDK 架构:

┌─────────────────────┐
│      MCP Client     │
└─────────┬───────────┘
          │ JSON-RPC 2.0
┌─────────▼──────────────────┐
│ cookiecutter_mcp_server.sh │ ← Custom Cookiecutter Implementation
│    ┌─────────────────┐     │
│    │ Tool Functions  |     │
│    │ - list_templates│     │
│    │ - generate_proj │     │
│    │ - test_access   │     │
│    └─────────────────┘     │
└────────────┬───────────────┘
             │
┌────────────▼──────────┐
│  mcpserver_core.sh    │ ← From MCP Server Bash SDK
│  ┌─────────────────┐  │
│  │ JSON-RPC Handler│  │
│  │ Protocol Logic  │  │
│  │ Error Handling  │  │
│  └─────────────────┘  │
└───────────────────────┘

配置

模板配置

编辑 assets/cookiecutter_mcp_config.json 要添加模板,请执行以下操作:

{
  "protocolVersion": "2024-11-05",
  "serverInfo": {
    "name": "CookieCutterPythonServer",
    "version": "0.1.0"
  },
  "templates": {
    "pypackage": {
      "name": "pypackage",
      "url": "https://github.com/audreyfeldroy/cookiecutter-pypackage",
      "description": "Cookiecutter template for a Python package with best practices",
      "category": "library",
      "language": "python"
    },
    "simple-test": {
      "name": "simple-test", 
      "url": "./simple-test",
      "description": "Local test cookiecutter template",
      "category": "custom",
      "language": "python"
    }
  }
}

Git配置(可选)

如果您遇到公共存储库的Git身份验证提示:

# Disable credential helper for public repos
git config --global credential.helper ""

用法

启动服务器

# Run the MCP server
./cookiecutter_mcp_server.sh

服务器将在stdin上监听JSON-RPC 2.0消息,并在stdout上做出响应。

可用工具

1.列出模板

echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_templates"}, "id": 1}' | ./cookiecutter_mcp_server.sh

2.获取模板信息

echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "get_template_info", "arguments": {"templateName": "pypackage"}}, "id": 2}' | ./cookiecutter_mcp_server.sh

3.测试模板访问

echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "test_template_access", "arguments": {"templateName": "pypackage"}}, "id": 3}' | ./cookiecutter_mcp_server.sh

4.生成项目(基础)

echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "generate_project", "arguments": {"templateName": "simple-test", "outputDir": "./my-new-project"}}, "id": 4}' | ./cookiecutter_mcp_server.sh

5.使用模板值生成项目

echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "generate_project", "arguments": {"templateName": "simple-test", "outputDir": "./my-custom-project", "templateValues": {"project_name": "awesome-project", "author_name": "Your Name", "author_email": "you@example.com"}}}, "id": 5}' | ./cookiecutter_mcp_server.sh

6.使用ZIP下载生成项目(仅限GitHub)

echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "generate_project_zip", "arguments": {"templateName": "pypackage", "outputDir": "./zip-project"}}, "id": 6}' | ./cookiecutter_mcp_server.sh

模板类型

远程模板(GitHub)

{
  "template-name": {
    "name": "template-name",
    "url": "https://github.com/user/cookiecutter-template",
    "description": "Description of the template",
    "category": "web-framework",
    "language": "python"
  }
}

本地模板

{
  "local-template": {
    "name": "local-template",
    "url": "./path/to/template/directory",
    "description": "Local cookiecutter template",
    "category": "custom", 
    "language": "python"
  }
}

本地模板要求:

  • 必须包含 cookiecutter.json 根目录下的文件
  • 遵循标准Cookiecutter目录结构
  • 使用MCP服务器目录中的相对路径或绝对路径

模板值

您可以使用以下命令为模板变量提供自定义值 templateValues 参数:

{
  "templateValues": {
    "project_name": "my-awesome-project",
    "author_name": "John Doe",
    "author_email": "john@example.com",
    "python_version": "3.11",
    "additional_tools": "requests,pandas"
  }
}

密钥必须与模板中定义的完全匹配 cookiecutter.json 文件。

高级用法

调试模式

通过设置启用调试日志记录 DEBUG_MODE=1 在……里面 cookiecutter_mcp_server.sh:

# Edit cookiecutter_mcp_server.sh
DEBUG_MODE=1

测试

运行测试套件以验证核心MCP服务器功能:

./test_mcpserver_core.sh

这将测试:

  • MCP协议合规性
  • 工具功能执行
  • 错误处理
  • JSON-RPC 2.0消息传递

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

目录标签

目录标签

开发工具ShellClaude本地部署项目脚手架模板管理JSON-RPC

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP