智能提示MCP服务器是一个增强版的MCP(模型上下文协议)服务器,具备从GitHub仓库中获取提示的功能,拥有智能发现、组合和管理等特性。它是 prompts-mcp-server 的增强分支,集成了GitHub并具备高级功能。
在开始使用本项目前,请先确保满足以下条件:
# 克隆仓库
git clone https://github.com/jezweb/smart-prompts-mcp.git
cd smart-prompts-mcp
# 安装依赖
npm install
# 构建项目
npm run build
# 验证安装
./verify-install.sh
在项目根目录下创建一个 .env 文件:
# 必需:GitHub配置
GITHUB_OWNER=your-username # 你的GitHub用户名或组织名
GITHUB_REPO=your-prompts-repo # 包含提示的仓库
GITHUB_BRANCH=main # 使用的分支(默认:main)
GITHUB_PATH= # 子目录路径(可选)
GITHUB_TOKEN=ghp_xxxxx # 个人访问令牌(推荐)
# 可选:缓存配置
CACHE_TTL=300000 # 缓存生存时间(毫秒,默认:5分钟)
CACHE_REFRESH_INTERVAL=60000 # 自动刷新间隔(毫秒,默认:1分钟)
# 可选:功能标志
ENABLE_SEMANTIC_SEARCH=true # 高级搜索功能
ENABLE_PROMPT_COMPOSITION=true # 提示组合功能
ENABLE_USAGE_TRACKING=true # 跟踪提示使用情况
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"smart-prompts": {
"command": "node",
"args": ["/absolute/path/to/smart-prompts-mcp/dist/index.js"],
"env": {
"GITHUB_OWNER": "your-username",
"GITHUB_REPO": "your-prompts-repo",
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
添加到Roo Cline MCP设置:
"smart-prompts": {
"command": "node",
"args": ["/absolute/path/to/smart-prompts-mcp/dist/index.js"],
"env": {
"GITHUB_OWNER": "your-username",
"GITHUB_REPO": "your-prompts-repo",
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
your-prompts-repo/
├── README.md # 仓库概述
├── ai-prompts/ # AI和元提示
│ ├── meta-prompt-builder.md
│ └── prompt-engineer.md
├── development/ # 开发提示
│ ├── backend/
│ │ ├── api-design.md
│ │ └── database-schema.md
│ ├── frontend/
│ │ ├── react-component.md
│ │ └── vue-composition.md
│ └── testing/
│ ├── unit-test-writer.md
│ └── e2e-test-suite.md
├── content-creation/ # 内容提示
│ ├── blog-post-writer.md
│ └── youtube-metadata.md
├── business/ # 业务提示
│ ├── proposal-generator.md
│ └── email-templates.md
└── INDEX.md # 可选:类别索引
api-documentation-generator.md)api_documentation_generator)content-creation)---
name: api_documentation_generator
title: REST API Documentation Generator
description: Generate comprehensive API documentation with examples
category: documentation
tags: [api, rest, documentation, openapi, swagger]
difficulty: intermediate
author: jezweb
version: 1.0
arguments:
- name: api_spec
description: The API specification or endpoint details
required: true
- name: format
description: Output format (markdown, openapi, etc)
required: false
default: markdown
---
# API Documentation Generator
Generate comprehensive documentation for {{api_spec}} in {{format}} format.
Include:
- Endpoint descriptions
- Request/response examples
- Authentication details
- Error codes
- Rate limiting information
search_prompts - 始终从这里开始!按关键字、类别或标签搜索list_prompt_categories - 浏览可用类别并显示数量get_prompt - 获取特定提示(使用搜索中的准确名称)create_github_prompt - 在GitHub中创建新提示compose_prompts - 组合多个提示prompts_help - 获取上下文帮助和指导check_github_status - 验证GitHub连接1. search_prompts → 查找现有提示
2. get_prompt → 查看完整内容
3. compose_prompts → 如果需要则组合
4. create_github_prompt → 仅在没有现有提示时使用
# 检查你的令牌是否具有repo权限
# 验证.env文件中的令牌
GITHUB_TOKEN=ghp_your_actual_token
# 测试GitHub访问
GITHUB_TOKEN=your_token node test-server.js
CACHE_TTL 进行更长时间的缓存GITHUB_PATH.md 文件包含YAML前置元数据tail -f ~/.claude/logs/mcp.logCACHE_TTL 以减少更新频率# 仓库根目录下的INDEX.md
prompts:
- name: api_generator
path: development/api-generator.md
category: development
tags: [api, codegen]
search-index.json 中基于GitHub集成模式,以下是潜在的MCP服务器:
在GitHub中存储和管理可重用的代码片段
基于GitHub的文档模板库
管理AI个性配置
完整的项目模板管理
精选的教育内容
版本控制的应用程序配置
集成GitHub Actions
团队知识管理
服务器包含全面的测试,以确保可靠性和性能。
# 运行完整测试套件
npm test
# 开发时的监视模式
npm run test:watch
# 生成覆盖率报告
npm run test:coverage
# 运行性能基准测试
npm run test:perf
# 验证安装
npm run test:verify
测试结果会自动以多种格式生成:
test-results/latest.json)test-results/latest.md)test-results/latest.html)查看最新的测试结果:
我们欢迎贡献!请参阅 CONTRIBUTING.md 了解指南。
本项目采用MIT许可证 - 详情请参阅 LICENSE 文件。
为MCP社区用心打造 ❤️