smart-prompts-mcp

jezweb/smart-prompts-mcp

3.4

If you are the rightful owner of smart-prompts-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Smart Prompts MCP Server is an advanced Model Context Protocol server designed to fetch and manage prompts from GitHub repositories with enhanced features for discovery, composition, and management.

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

  1. ๐Ÿ” search_prompts - Always start here! Search by keyword, category, or tags
  2. ๐Ÿ“‹ list_prompt_categories - Browse available categories with counts
  3. ๐Ÿ“– get_prompt - Retrieve specific prompt (use exact name from search)
  4. โœจ create_github_prompt - Create new prompts in GitHub
  5. ๐Ÿ”— compose_prompts - Combine multiple prompts
  6. โ“ prompts_help - Get contextual help and guidance
  7. โœ… 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_TTL to 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_TTL for less frequent updates
  • Reduce repository size (archive old prompts)
  • Use categories to limit search scope

๐Ÿ“ˆ Scaling Considerations

Current Limitations

  1. GitHub API Rate Limits

    • 60 requests/hour (unauthenticated)
    • 5,000 requests/hour (authenticated)
    • Each directory fetch = 1 request
  2. 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)

  1. Search Index Generation

    • GitHub Action to build index
    • Download single index file
    • Local semantic search
  2. Lazy Loading

    • Fetch categories on demand
    • Progressive enhancement
    • Virtual scrolling for large lists
  3. 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

๐Ÿงช Testing

The server includes comprehensive testing to ensure reliability and performance.

Test Suite Features

  • 100% test coverage of critical functionality
  • Performance benchmarks with detailed metrics
  • Visual test reports with interactive charts
  • Automated CI/CD via GitHub Actions

Running Tests

# Run full test suite
npm test

# Watch mode for development
npm run test:watch

# Generate coverage report
npm run test:coverage

# Run performance benchmark
npm run test:perf

# Verify installation
npm run test:verify

Test Reports

Test results are automatically generated in multiple formats:

  • JSON: Detailed results for analysis (test-results/latest.json)
  • Markdown: Human-readable reports (test-results/latest.md)
  • HTML: Interactive visual reports (test-results/latest.html)

View the latest test results:

๐Ÿงช Development

# Development mode with hot reload
npm run dev

# Build for production
npm run build

# Start production server
npm start

๐Ÿค Contributing

We welcome contributions! See for guidelines.

Priority Areas

  1. Search Improvements

    • Implement fuzzy search
    • Add search result ranking
    • Support for regex patterns
  2. Performance Optimization

    • Implement connection pooling
    • Add request batching
    • Optimize cache strategies
  3. UI/Visualization

    • Web interface for browsing
    • Prompt preview tool
    • Usage analytics dashboard

๐Ÿ“„ License

MIT License - see file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


Made with โค๏ธ for the MCP community