modelscope·@sparesparrow/mcp-prompts
通过简化的SOLID架构,启用提示词的创建、管理和模板化,允许用户按类别组织提示词并在运行时填充模板。
一个用于管理提示和模板并具备项目编排能力的MCP服务器。是Model Context Protocol生态系统的一部分。
<a href="https://glama.ai/mcp/servers/i0z4f3pr82"> <img width="380" height="200" src="https://glama.ai/mcp/servers/i0z4f3pr82/badge" alt="Prompts Server MCP server" /> </a>此服务器提供了一种简单的方式来存储、检索和应用AI提示模板,使您更容易在AI应用程序中保持一致的提示模式。
npx -y @sparesparrow/mcp-prompts
npm install -g @sparesparrow/mcp-prompts
docker run -p 3003:3003 -v ~/mcp/data:/app/data sparesparrow/mcp-prompts:latest
安装后,您可以按照以下步骤验证服务器是否正常工作:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "list_prompts",
arguments: {}
});
服务器可以通过环境变量进行配置:
| 环境变量 | 描述 | 默认值 |
|---|---|---|
| SERVER_NAME | 服务器名称 | MCP Prompts Server |
| SERVER_VERSION | 服务器版本 | package.json 版本 |
| STORAGE_TYPE | 存储类型:'file', 'postgres' 或 'mdc' | file |
| PROMPTS_DIR | 存储提示的目录 | ~/mcp/data/prompts |
| BACKUPS_DIR | 备份目录 | ~/mcp/data/backups |
| PORT | HTTP 服务器端口 | 3003 |
| LOG_LEVEL | 日志级别 | info |
| HTTP_SERVER | 启用 HTTP 服务器 | false |
| HOST | HTTP 服务器主机 | 0.0.0.0 |
| 环境变量 | 描述 | 默认值 |
|---|---|---|
| PG_HOST | PostgreSQL 主机 | localhost |
| PG_PORT | PostgreSQL 端口 | 5432 |
| PG_DATABASE | PostgreSQL 数据库名 | mcp_prompts |
| PG_USER | PostgreSQL 用户名 | postgres |
| PG_PASSWORD | PostgreSQL 密码 | |
| PG_SSL | 使用 SSL 连接 PostgreSQL | false |
| POSTGRES_CONNECTION_STRING | 完整的 PostgreSQL 连接字符串(覆盖单独设置) |
| 环境变量 | 描述 | 默认值 |
|---|---|---|
| MDC_RULES_DIR | MDC 规则目录 | ./.cursor/rules |
在 Claude 3 桌面应用程序中,您可以在 claude_desktop_config.json 中配置 MCP 提示服务器:
{
"mcpServers": {
"prompts": {
"command": "npx",
"args": [
"-y",
"@sparesparrow/mcp-prompts"
],
"env": {
"STORAGE_TYPE": "file",
"PROMPTS_DIR": "/path/to/your/prompts/directory",
"LOG_LEVEL": "debug"
}
}
}
}
MCP 提示服务器提供以下工具:
add_prompt: 添加新提示get_prompt: 通过 ID 获取提示update_prompt: 更新现有提示list_prompts: 列出所有提示delete_prompt: 通过 ID 删除提示apply_template: 应用变量到提示模板要查看可用的提示:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "list_prompts",
arguments: {}
});
按标签过滤:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "list_prompts",
arguments: {
tags: ["development"]
}
});
通过 ID 检索特定提示:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "get_prompt",
arguments: {
id: "development-workflow"
}
});
应用变量到模板提示:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "apply_template",
arguments: {
id: "development-system-prompt",
variables: {
"project_type": "web frontend",
"language": "JavaScript/React",
"project_name": "TaskManager",
"project_goal": "create a task management application with drag-and-drop functionality",
"technical_context": "Using React 18, TypeScript, and Material UI"
}
}
});
添加新提示:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "add_prompt",
arguments: {
name: "Bug Report Template",
description: "Template for submitting bug reports",
content: "## Bug Report\n\n### Description\n{{description}}\n\n### Steps to Reproduce\n{{steps}}\n\n### Expected Behavior\n{{expected}}\n\n### Actual Behavior\n{{actual}}\n\n### Environment\n{{environment}}",
isTemplate: true,
variables: ["description", "steps", "expected", "actual", "environment"],
tags: ["bug", "template", "documentation"]
}
});
编辑现有提示:
use_mcp_tool({
server_name: "prompt-manager",
tool_name: "edit_prompt",
arguments: {
id: "development-workflow",
content: "Updated workflow content here...",
tags: ["development", "workflow", "python", "updated"]
}
});
当开始开发一个新功能时:
当审查代码时:
提示具有以下结构:
{
"id": "unique-id",
"name": "Prompt Name",
"description": "Optional description",
"content": "The prompt content with {{variables}}",
"tags": ["tag1", "tag2"],
"isTemplate": true,
"variables": ["variable1", "variable2"],
"metadata": {
"author": "Your Name",
"version": "1.0.0"
}
}
MCP 提示服务器包括一个强大的 MutablePrompt 接口,允许提示在多种格式之间转换:
MutablePrompt 接口提供了在这些格式之间转换提示的方法:
// Create a mutable prompt
const factory = new MutablePromptFactoryImpl();
const prompt = factory.create({
name: "API Design Guide",
descrip…
通过向量嵌入技术,为项目提供记忆库和RAG上下文支持,以增强代码理解和管理,并与RooCode和Cline集成。
通过全局和分支特定的记忆库,管理跨 Claude AI 会话的项目文档和上下文的服务器,通过结构化的 JSON 文档存储实现一致的知识管理。
快递100 MCP Server提供快递信息查询、快递运费预估比价、快递时效查询(含发货前时效查询与在途动态时效查询)等功能。
一种模型上下文协议服务器,通过在语言模型交互之间高效缓存数据来减少令牌消耗,自动存储和检索信息以最小化冗余令牌使用。
通过集成DeepSeek R1的高级推理引擎以处理复杂推理任务,从而增强Claude推理能力的服务器。
图片解读MCP,一键分析图片内容,提取文字,理解场景,让信息一目了然。