MCP Prompt Explorer Server

MCP Prompt Explorer Server

A demonstration MCP server for exploring MCP prompts with 10 reusable development prompts.

Category
Visit Server

README

MCP Prompt Explorer Server ๐Ÿš€

A comprehensive Model Context Protocol (MCP) server that demonstrates the prompt feature with 10 different development-focused prompts. This server is perfect for exploring how MCP prompts work and can be integrated into LLM applications like Claude Desktop.

๐Ÿ“‹ What are MCP Prompts?

MCP prompts are pre-configured, reusable templates that LLM applications can use. They:

  • Standardize common tasks: Create consistent workflows
  • Accept arguments: Dynamic prompts that adapt to your needs
  • Provide structure: Well-formatted prompts for better results
  • Save time: No need to craft prompts from scratch

โœจ Features

This server includes 10 powerful prompts:

  1. ๐Ÿ” code-review - Comprehensive code review with focus areas
  2. ๐Ÿ“š explain-concept - Technical concept explanation with examples
  3. ๐Ÿ› debug-assistant - Debug code with error analysis
  4. ๐Ÿ“– api-documentation - Generate API documentation
  5. โ™ป๏ธ refactor-suggestion - Code refactoring recommendations
  6. ๐Ÿงช test-generator - Generate unit tests
  7. ๐Ÿ—๏ธ architecture-review - System architecture analysis
  8. ๐Ÿ’ฌ git-commit-message - Generate commit messages
  9. โšก sql-optimizer - SQL query optimization
  10. ๐ŸŽ“ learning-path - Personalized learning paths

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10 or higher
  • pip or uv package manager

Installation

Option 1: Using UV (Recommended)

# Install UV if you haven't already
pip install uv

# Create and activate virtual environment
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
uv pip install mcp

Option 2: Using pip

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install mcp

Running the Server

uv run server.py

๐Ÿ”ง Integration with Claude Desktop

To use this server with Claude Desktop, add it to your configuration:

macOS/Linux Configuration

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "prompt-explorer": {
      "command": "python",
      "args": ["/absolute/path/to/mcp_prompt_explorer_server.py"],
      "env": {}
    }
  }
}

Windows Configuration

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "prompt-explorer": {
      "command": "python",
      "args": ["C:\\absolute\\path\\to\\mcp_prompt_explorer_server.py"],
      "env": {}
    }
  }
}

Important: Replace /absolute/path/to/ with the actual path where you saved the server file.

Using with UV (Alternative)

If using UV, you can configure it like this:

{
  "mcpServers": {
    "prompt-explorer": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp",
        "python",
        "/absolute/path/to/mcp_prompt_explorer_server.py"
      ]
    }
  }
}

๐Ÿ“– Usage Examples

Once integrated with Claude Desktop, you can use prompts like this:

Example 1: Code Review

Use the code-review prompt with this Python code:

def calculate(a, b):
    return a + b

The prompt will automatically format a comprehensive code review request.

Example 2: Explain a Concept

Use the explain-concept prompt to explain "async/await in Python" 
for a beginner audience with code examples

Example 3: Debug Assistance

Use the debug-assistant prompt with this error:
"TypeError: unsupported operand type(s) for +: 'int' and 'str'"

And this code:
x = 5
y = "10"
result = x + y

Example 4: Generate Tests

Use the test-generator prompt with comprehensive coverage 
for this function:

def factorial(n):
    if n <= 1:
        return 1
    return n * factorial(n - 1)

๐ŸŽฏ Understanding Prompt Arguments

Each prompt has specific arguments:

Required Arguments

These must be provided for the prompt to work.

Optional Arguments

These customize the prompt behavior but have defaults.

Example from the code-review prompt:

  • code (required) - The code to review
  • language (optional) - Programming language
  • focus (optional) - Specific focus area

๐Ÿ” Exploring the Code

Key Components

  1. list_prompts() - Returns all available prompts

    • Called when client queries available prompts
    • Returns prompt metadata including arguments
  2. get_prompt() - Returns a specific prompt with arguments filled in

    • Takes prompt name and argument values
    • Returns formatted prompt message
  3. Prompt Structure:

    Prompt(
        name="prompt-name",
        description="What this prompt does",
        arguments=[
            PromptArgument(
                name="arg_name",
                description="What this argument is for",
                required=True/False,
            ),
        ],
    )
    

๐Ÿ› ๏ธ Customizing Prompts

Want to add your own prompts? Here's how:

  1. Add to list_prompts():

    Prompt(
        name="my-custom-prompt",
        description="My awesome prompt",
        arguments=[
            PromptArgument(
                name="input",
                description="Input data",
                required=True,
            ),
        ],
    )
    
  2. Add handler in get_prompt():

    elif name == "my-custom-prompt":
        input_data = arguments.get("input", "")
        return GetPromptResult(
            description="Custom prompt result",
            messages=[
                PromptMessage(
                    role="user",
                    content=TextContent(
                        type="text",
                        text=f"Process this: {input_data}"
                    ),
                ),
            ],
        )
    

๐Ÿ“š Learning Resources

๐ŸŽจ Prompt Best Practices

Based on this server's implementation:

  1. Clear Structure: Use numbered lists and headers
  2. Specific Instructions: Be explicit about what you want
  3. Examples: Provide examples when helpful
  4. Formatting: Use XML tags or markdown for clarity
  5. Flexibility: Support optional arguments with sensible defaults

๐Ÿ› Troubleshooting

Server Not Showing Up in Claude Desktop

  1. Check configuration file syntax (valid JSON)
  2. Verify absolute path to server file
  3. Ensure Python/UV is in PATH
  4. Restart Claude Desktop after configuration changes
  5. Check Claude Desktop logs

Import Errors

# Make sure mcp is installed
pip install mcp
# or
uv add mcp

Python Version Issues

Ensure you're using Python 3.10+:

python --version

๐Ÿ’ก Tips for Using Prompts

  1. Start Simple: Try prompts with just required arguments
  2. Add Details: Use optional arguments to refine results
  3. Iterate: Adjust arguments based on results
  4. Combine: Use multiple prompts for complex tasks

๐Ÿ”„ What's Next?

Try these exercises to learn more about MCP prompts:

  1. Modify an existing prompt template
  2. Add a new prompt for your specific use case
  3. Combine prompts in workflows
  4. Create argument validation logic
  5. Add multi-turn conversation prompts

๐Ÿ“ License

This is a demonstration project for learning about MCP prompts. Feel free to use, modify, and extend it!

๐Ÿค Contributing

This is a learning project! Feel free to:

  • Add new prompts
  • Improve existing templates
  • Add features (resources, tools)
  • Share your customizations

Happy Prompting! ๐ŸŽ‰

Need help? The code is heavily commented to help you understand how everything works.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured