1.0.0 • Published 4 months ago

mcp-template-server v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

MCP 模板服务器

这是一个基于 Model Context Protocol (MCP) 的模板服务器,专门用于提供模板管理功能。

功能

  1. 列出所有模板类别
  2. 按类别筛选模板
  3. 搜索模板
  4. 获取模板详情
  5. 获取填充参数后的模板内容
  6. 提供模板提示

从NPM安装

# 全局安装
npm install -g mcp-template-server

# 启动服务器
mcp-template-server

手动安装与使用

# 克隆仓库
git clone <仓库地址>
cd MCP-Simple

# 安装依赖并构建
./build.sh

# 启动服务器
node build/index.js

在 Cursor 中使用

  1. 打开 Cursor 的 MCP 配置面板
  2. 添加新的 MCP 服务
  3. 选择服务类型为"command"
  4. 如果全局安装了npm包,输入命令:mcp-template-server
  5. 如果手动安装,输入命令:node /path/to/MCP-Simple/build/index.js
  6. 保存配置并连接

可用工具

工具名称描述参数
list_categories列出所有模板类别
list_templates_by_category按类别列出模板category: 类别名称
search_templates搜索模板keyword: 搜索关键词
get_template_details获取模板详情template_id: 模板ID
get_template_content获取填充参数后的模板内容template_id: 模板ID, params: 参数对象

可用提示

提示名称描述参数
create_template创建模板内容template_id: 模板ID, params: 参数对象(可选)

示例

列出所有类别

const result = await client.callTool({
  name: "list_categories",
  arguments: {}
});

按类别列出模板

const result = await client.callTool({
  name: "list_templates_by_category",
  arguments: {
    category: "公众号头图"
  }
});

获取模板内容

const result = await client.callTool({
  name: "get_template_content",
  arguments: {
    template_id: "tech-header",
    params: {
      firstLine: "从零开始",
      secondLine: "20分钟开发MCP",
      features: "简单易用,功能强大,快速上手"
    }
  }
});

使用提示

const prompt = await client.getPrompt("create_template", {
  template_id: "tech-header",
  params: {
    firstLine: "从零开始",
    secondLine: "20分钟开发MCP",
    features: "简单易用,功能强大,快速上手"
  }
});