1.0.0 • Published 4 months ago
mcp-template-server v1.0.0
MCP 模板服务器
这是一个基于 Model Context Protocol (MCP) 的模板服务器,专门用于提供模板管理功能。
功能
- 列出所有模板类别
- 按类别筛选模板
- 搜索模板
- 获取模板详情
- 获取填充参数后的模板内容
- 提供模板提示
从NPM安装
# 全局安装
npm install -g mcp-template-server
# 启动服务器
mcp-template-server
手动安装与使用
# 克隆仓库
git clone <仓库地址>
cd MCP-Simple
# 安装依赖并构建
./build.sh
# 启动服务器
node build/index.js
在 Cursor 中使用
- 打开 Cursor 的 MCP 配置面板
- 添加新的 MCP 服务
- 选择服务类型为"command"
- 如果全局安装了npm包,输入命令:
mcp-template-server
- 如果手动安装,输入命令:
node /path/to/MCP-Simple/build/index.js
- 保存配置并连接
可用工具
工具名称 | 描述 | 参数 |
---|---|---|
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: "简单易用,功能强大,快速上手"
}
});
1.0.0
4 months ago