Smart Prompts MCP Server
An enhanced MCP server that fetches prompts from GitHub repositories with intelligent discovery, composition, and management features.
README
Smart Prompts MCP Server
An enhanced MCP (Model Context Protocol) server that fetches prompts from GitHub repositories with intelligent discovery, composition, and management features. This is an enhanced fork of prompts-mcp-server with GitHub integration and advanced features.
🌟 Key Features
Core Capabilities
- 🔄 GitHub Integration: Fetch prompts directly from GitHub repositories (public/private)
- 🔍 Smart Discovery: Advanced search with category and tag filtering
- 🔗 Prompt Composition: Combine multiple prompts into workflows
- 📊 Usage Tracking: Analytics on prompt usage patterns
- ⚡ Real-time Updates: Automatic synchronization with GitHub
- 🤖 AI Guidance: Enhanced tool descriptions and workflow recommendations
MCP Protocol Support
- Tools: 7 specialized tools for prompt management
- Resources: 13+ resource endpoints for browsing and discovery
- Prompts: Dynamic templates with Handlebars support
📋 Prerequisites
Before installation, ensure you have:
- Node.js 18+ installed
- npm or yarn package manager
- Git installed and configured
- GitHub account (for GitHub integration)
- GitHub Personal Access Token (for private repos or to avoid rate limits)
🚀 Installation
Step 1: Clone and Install
# Clone the repository
git clone https://github.com/jezweb/smart-prompts-mcp.git
cd smart-prompts-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Verify installation
./verify-install.sh
Step 2: Configure Environment
Create a .env file in the project root:
# Required: GitHub Configuration
GITHUB_OWNER=your-username # Your GitHub username or org
GITHUB_REPO=your-prompts-repo # Repository containing prompts
GITHUB_BRANCH=main # Branch to use (default: main)
GITHUB_PATH= # Subdirectory path (optional)
GITHUB_TOKEN=ghp_xxxxx # Personal access token (recommended)
# Optional: Cache Configuration
CACHE_TTL=300000 # Cache time-to-live in ms (default: 5 min)
CACHE_REFRESH_INTERVAL=60000 # Auto-refresh interval in ms (default: 1 min)
# Optional: Feature Flags
ENABLE_SEMANTIC_SEARCH=true # Advanced search features
ENABLE_PROMPT_COMPOSITION=true # Prompt combination features
ENABLE_USAGE_TRACKING=true # Track prompt usage
Step 3: MCP Client Configuration
For Claude Desktop (macOS)
Add to ~/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"
}
}
}
}
For Roo Cline (VS Code)
Add to Roo Cline MCP settings:
"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"
}
}
📁 Prompt Organization Best Practices
Recommended Folder Structure
your-prompts-repo/
├── README.md # Repository overview
├── ai-prompts/ # AI and meta-prompts
│ ├── meta-prompt-builder.md
│ └── prompt-engineer.md
├── development/ # Development prompts
│ ├── 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/ # Content prompts
│ ├── blog-post-writer.md
│ └── youtube-metadata.md
├── business/ # Business prompts
│ ├── proposal-generator.md
│ └── email-templates.md
└── INDEX.md # Optional: Category index
Naming Conventions
- Files: Use kebab-case (e.g.,
api-documentation-generator.md) - Prompt Names: Use snake_case in frontmatter (e.g.,
api_documentation_generator) - Categories: Use lowercase with hyphens (e.g.,
content-creation) - Keep names descriptive but concise
📝 Prompt File Format
---
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
🛠️ Available Tools
- 🔍
search_prompts- Always start here! Search by keyword, category, or tags - 📋
list_prompt_categories- Browse available categories with counts - 📖
get_prompt- Retrieve specific prompt (use exact name from search) - ✨
create_github_prompt- Create new prompts in GitHub - 🔗
compose_prompts- Combine multiple prompts - ❓
prompts_help- Get contextual help and guidance - ✅
check_github_status- Verify GitHub connection
Recommended Workflow
1. search_prompts → Find existing prompts
2. get_prompt → View full content
3. compose_prompts → Combine if needed
4. create_github_prompt → Only if nothing exists
🔧 Troubleshooting
Common Issues
1. "GitHub access failed" Error
# Check your token has repo scope
# Verify token in .env file
GITHUB_TOKEN=ghp_your_actual_token
# Test GitHub access
GITHUB_TOKEN=your_token node test-server.js
2. "Rate limit exceeded" Error
- Add a GitHub token to increase rate limits
- Reduce cache refresh interval
- Use
CACHE_TTLto cache longer
3. "No prompts found"
- Check repository structure matches expected format
- Verify GITHUB_PATH if using subdirectory
- Ensure .md files have YAML frontmatter
4. MCP Client Not Connecting
- Use absolute paths in configuration
- Check Node.js is in PATH
- Verify all environment variables
- Check logs:
tail -f ~/.claude/logs/mcp.log
5. Slow Performance
- Increase
CACHE_TTLfor less frequent updates - Reduce repository size (archive old prompts)
- Use categories to limit search scope
📈 Scaling Considerations
Current Limitations
-
GitHub API Rate Limits
- 60 requests/hour (unauthenticated)
- 5,000 requests/hour (authenticated)
- Each directory fetch = 1 request
-
Search Limitations
- No native semantic search in GitHub
- Linear search through all files
- Performance degrades with 100+ prompts
Scaling Strategies
For 50-200 Prompts
- ✅ Current implementation works well
- Use categories and tags for organization
- Implement local caching
- Add GitHub token for higher rate limits
For 200-1000 Prompts
- 🔄 Implement Index File
# INDEX.md in repo root prompts: - name: api_generator path: development/api-generator.md category: development tags: [api, codegen] - 📊 Add Search Index
- Generate search index on build
- Store in
search-index.json - Update via GitHub Actions
For 1000+ Prompts
- 🗄️ Database Layer
- SQLite for local caching
- Full-text search capabilities
- Sync with GitHub periodically
- 🔍 Elasticsearch/Algolia Integration
- Proper search infrastructure
- Faceted search
- Relevance ranking
Future Scaling Features (Roadmap)
-
Search Index Generation
- GitHub Action to build index
- Download single index file
- Local semantic search
-
Lazy Loading
- Fetch categories on demand
- Progressive enhancement
- Virtual scrolling for large lists
-
CDN Support
- Cache prompts at edge
- Reduce GitHub API calls
- Faster global access
🚀 Future MCP Server Ideas
Building on the GitHub integration pattern, here are potential MCP servers:
1. Code Snippets MCP Server
Store and manage reusable code snippets in GitHub
- Language-specific organization
- Syntax highlighting
- Dependency management
- Version history
2. Documentation Templates MCP
GitHub-based documentation template library
- README generators
- API documentation templates
- Project documentation
- Auto-generated from code
3. AI Personas MCP Server
Manage AI personality configurations
- Expertise definitions
- Communication styles
- Behavioral traits
- Team sharing
4. Project Scaffolding MCP
Full project template management
- Technology stacks
- Boilerplate code
- Best practices
- Configuration presets
5. Learning Resources MCP
Curated educational content
- Tutorials and guides
- Code examples
- Progress tracking
- Skill-based recommendations
6. Configuration Manager MCP
Version-controlled app configs
- Environment management
- Secret handling
- Team synchronization
- Rollback support
7. Workflow Automation MCP
GitHub Actions integration
- Workflow templates
- CI/CD pipelines
- Automation scripts
- Cross-repo orchestration
8. Knowledge Base MCP
Team knowledge management
- Q&A pairs
- Troubleshooting guides
- Best practices
- Searchable wiki
🧪 Development
# Development mode with hot reload
npm run dev
# Run tests
npm test
# Run specific test file
npm test -- src/github.test.ts
# Test coverage
npm run test:coverage
# Build for production
npm run build
# Test the built server
node test-server.js
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Priority Areas
-
Search Improvements
- Implement fuzzy search
- Add search result ranking
- Support for regex patterns
-
Performance Optimization
- Implement connection pooling
- Add request batching
- Optimize cache strategies
-
UI/Visualization
- Web interface for browsing
- Prompt preview tool
- Usage analytics dashboard
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
- Original prompts-mcp-server by @tanker327
- Model Context Protocol by Anthropic
- Built with inspiration from the MCP community
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Examples: jezweb/prompts
<p align="center">Made with ❤️ for the MCP community</p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。