mcp-prompts-library

MuLIAICHI/mcp-prompts-library

3.2

If you are the rightful owner of mcp-prompts-library 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 Model Context Protocol (MCP) server provides a library of reusable, high-quality prompt templates for various tasks, compatible with Claude Desktop and other MCP clients.

šŸš€ Prompt Library MCP Server

A comprehensive Model Context Protocol (MCP) server providing reusable, high-quality prompt templates for various development, writing, and analysis tasks. Use these prompts directly in Claude Desktop or any MCP-compatible client.

šŸ“‹ Table of Contents


✨ Features

  • 20+ Professional Prompts across multiple categories
  • Modular Architecture - Easy to extend and customize
  • Comprehensive Responses - Detailed, structured outputs
  • Flexible Arguments - Customize prompts for your specific needs
  • MCP Compatible - Works with Claude Desktop, Cursor, and other MCP clients

šŸ› ļø Installation

Prerequisites

  • Python 3.8 or higher
  • Claude Desktop (or another MCP-compatible client)

Step 1: Clone or Download

# Create project directory
mkdir prompt-library-mcp
cd prompt-library-mcp

Step 2: Set Up Virtual Environment

# Create virtual environment
python -m venv venv

# Activate it
# On Mac/Linux:
source venv/bin/activate

# On Windows:
venv\Scripts\activate

Step 3: Install Dependencies

# Create requirements.txt with:
echo "mcp>=1.0.0" > requirements.txt

# Install
pip install -r requirements.txt

Step 4: Create Project Structure

prompt-library-mcp/
ā”œā”€ā”€ prompts/
│   ā”œā”€ā”€ __init__.py
│   ā”œā”€ā”€ code_prompts.py
│   ā”œā”€ā”€ writing_prompts.py
│   └── analysis_prompts.py
ā”œā”€ā”€ server.py
ā”œā”€ā”€ requirements.txt
└── README.md

Copy all the provided files into their respective locations.


āš™ļø Configuration

Connect to Claude Desktop

  1. Locate your config file:

    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Edit the config file (create if it doesn't exist):

{
  "mcpServers": {
    "prompt-library": {
      "command": "python",
      "args": ["/absolute/path/to/your/prompt-library-mcp/server.py"]
    }
  }
}

Important: Replace the path with your actual absolute path!

Mac/Linux example:

"args": ["/Users/yourname/prompt-library-mcp/server.py"]

Windows example:

"args": ["C:\\Users\\YourName\\prompt-library-mcp\\server.py"]
  1. Restart Claude Desktop completely

šŸ“š Available Prompts

šŸ’» Code Prompts (10 prompts)

Prompt NameDescriptionKey Arguments
code-reviewComprehensive code review with best practicescode, language, focus
debug-helperDebug code and find solutionscode, error
refactor-codeRefactor for better qualitycode, goal
add-testsGenerate unit testscode, framework
explain-codeExplain code clearlycode, level
api-designDesign or review APIsrequirements, style
optimize-performancePerformance optimizationcode, bottleneck
security-auditSecurity vulnerability analysiscode, context
database-schemaDatabase design and reviewrequirements, database
git-commit-messageGenerate commit messageschanges, style

āœļø Writing Prompts (4 prompts)

Prompt NameDescriptionKey Arguments
blog-postGenerate engaging blog poststopic, tone, length
email-writerCraft professional emailspurpose, recipient, key_points
documentationCreate technical documentationsubject, audience
social-mediaSocial media contentplatform, topic, style

šŸ“Š Analysis Prompts (4 prompts)

Prompt NameDescriptionKey Arguments
data-analysisAnalyze data and provide insightsdata_description, goal
competitive-analysisCompetitor and market analysisindustry, competitors
swot-analysisPerform SWOT analysissubject, context
bug-report-analysisAnalyze and prioritize bugsbug_report

šŸŽÆ Usage

In Claude Desktop

  1. Open Claude Desktop
  2. Click the šŸ“Ž attachment icon in the chat input
  3. Select "Attach from MCP"
  4. Choose "prompt-library"
  5. Select your desired prompt (e.g., "code-review")
  6. Fill in the required arguments:
    • code: Paste your code
    • language: (optional) e.g., "python"
    • focus: (optional) e.g., "security"
  7. Click Submit
  8. Send your message or just hit enter to use the prompt

Example Usage

Code Review Example
1. Attach from MCP → prompt-library → code-review
2. Fill in:
   - code: [paste your Python function]
   - language: python
   - focus: performance
3. Submit
4. Send message (or just hit enter)

Claude will then perform a comprehensive code review focused on performance!

Blog Post Example
1. Attach from MCP → prompt-library → blog-post
2. Fill in:
   - topic: "Getting Started with Machine Learning"
   - tone: friendly
   - length: medium
3. Submit and send

Testing the Server

To test if the server is working:

# Activate virtual environment
source venv/bin/activate  # or venv\Scripts\activate on Windows

# Run the server
python server.py

If no errors appear, it's working! Press Ctrl+C to stop.


šŸ”§ Adding Custom Prompts

Step 1: Define Your Prompt

Add to the appropriate file (e.g., prompts/code_prompts.py):

"your-prompt-name": {
    "name": "your-prompt-name",
    "description": "What your prompt does",
    "arguments": [
        {
            "name": "input",
            "description": "Input description",
            "required": True
        },
        {
            "name": "optional_param",
            "description": "Optional parameter",
            "required": False
        }
    ]
}

Step 2: Add Generation Logic

In the same file, add to the generate_code_prompt() function:

elif name == "your-prompt-name":
    input_text = args.get("input", "")
    optional = args.get("optional_param", "default_value")
    
    return f"""Your detailed prompt template here:

**Input:** {input_text}
**Parameter:** {optional}

Please provide:
1. First section
2. Second section
3. Third section
"""

Step 3: Restart the Server

Restart Claude Desktop to load the new prompt.


šŸ› Troubleshooting

Server Not Showing Up in Claude

Solution:

  1. Check the config file path is correct
  2. Use absolute paths, not relative
  3. Verify Python is in your PATH
  4. Restart Claude Desktop completely (quit and reopen)

"Command not found" Error

Solution:

  • Use the full path to Python:
    "command": "/usr/bin/python3"
    
    or
    "command": "C:\\Python39\\python.exe"
    

Prompts Not Loading

Solution:

  1. Test the server directly:
    python server.py
    
  2. Check for Python errors
  3. Verify all files are in place
  4. Make sure virtual environment is activated when testing

Virtual Environment Issues

Mac/Linux:

source venv/bin/activate
python server.py

Windows:

venv\Scripts\activate
python server.py

Check Claude Logs

Mac:

tail -f ~/Library/Logs/Claude/mcp*.log

Windows:

type %APPDATA%\Claude\logs\mcp*.log

šŸš€ Advanced Configuration

Using Specific Python Version

{
  "mcpServers": {
    "prompt-library": {
      "command": "/usr/local/bin/python3.11",
      "args": ["/path/to/server.py"]
    }
  }
}

Multiple MCP Servers

{
  "mcpServers": {
    "prompt-library": {
      "command": "python",
      "args": ["/path/to/prompt-library-mcp/server.py"]
    },
    "other-server": {
      "command": "node",
      "args": ["/path/to/other-server/index.js"]
    }
  }
}

šŸ“– Prompt Categories Explained

Code Prompts

Perfect for developers who need assistance with:

  • Code reviews and quality checks
  • Debugging and error resolution
  • Refactoring and optimization
  • Test generation
  • API and database design

Writing Prompts

Ideal for content creators needing:

  • Blog posts and articles
  • Professional emails
  • Technical documentation
  • Social media content

Analysis Prompts

Great for strategic work like:

  • Data insights and analysis
  • Competitive research
  • SWOT analysis
  • Bug triage and prioritization

šŸ¤ Contributing

Want to add your own prompts or improve existing ones?

  1. Fork the repository
  2. Add your prompts following the existing structure
  3. Test thoroughly
  4. Submit a pull request with:
    • Description of new prompts
    • Example usage
    • Any new dependencies

šŸ“ Best Practices

Writing Good Prompts

  1. Be Specific: Clear, detailed instructions
  2. Structure Output: Use numbered lists and sections
  3. Provide Examples: Show what good output looks like
  4. Allow Flexibility: Optional parameters for customization
  5. Think User-First: What would help the user most?

Organizing Prompts

  • Group by category (code, writing, analysis)
  • Use clear naming (verb-noun format)
  • Write good descriptions (users see these in Claude)
  • Document arguments (explain what each does)

šŸ†˜ Support

  • Issues? Check the troubleshooting section
  • Questions? Review the usage examples
  • Not working? Check Claude Desktop logs
  • Need help? Check the MCP documentation at https://modelcontextprotocol.io

šŸŽ‰ Happy Prompting!

Start using your prompt library and boost your productivity with Claude Desktop. Customize, extend, and make it your own!

Pro Tip: Try combining multiple prompts in a conversation for complex workflows. For example:

  1. Use api-design to design an API
  2. Then use add-tests to create tests for it
  3. Finally use documentation to document everything!