MCP Prompt Explorer Server
A demonstration MCP server for exploring MCP prompts with 10 reusable development prompts.
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:
- 🔍 code-review - Comprehensive code review with focus areas
- 📚 explain-concept - Technical concept explanation with examples
- 🐛 debug-assistant - Debug code with error analysis
- 📖 api-documentation - Generate API documentation
- ♻️ refactor-suggestion - Code refactoring recommendations
- 🧪 test-generator - Generate unit tests
- 🏗️ architecture-review - System architecture analysis
- 💬 git-commit-message - Generate commit messages
- ⚡ sql-optimizer - SQL query optimization
- 🎓 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 reviewlanguage(optional) - Programming languagefocus(optional) - Specific focus area
🔍 Exploring the Code
Key Components
-
list_prompts()- Returns all available prompts- Called when client queries available prompts
- Returns prompt metadata including arguments
-
get_prompt()- Returns a specific prompt with arguments filled in- Takes prompt name and argument values
- Returns formatted prompt message
-
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:
-
Add to
list_prompts():Prompt( name="my-custom-prompt", description="My awesome prompt", arguments=[ PromptArgument( name="input", description="Input data", required=True, ), ], ) -
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:
- Clear Structure: Use numbered lists and headers
- Specific Instructions: Be explicit about what you want
- Examples: Provide examples when helpful
- Formatting: Use XML tags or markdown for clarity
- Flexibility: Support optional arguments with sensible defaults
🐛 Troubleshooting
Server Not Showing Up in Claude Desktop
- Check configuration file syntax (valid JSON)
- Verify absolute path to server file
- Ensure Python/UV is in PATH
- Restart Claude Desktop after configuration changes
- 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
- Start Simple: Try prompts with just required arguments
- Add Details: Use optional arguments to refine results
- Iterate: Adjust arguments based on results
- Combine: Use multiple prompts for complex tasks
🔄 What's Next?
Try these exercises to learn more about MCP prompts:
- Modify an existing prompt template
- Add a new prompt for your specific use case
- Combine prompts in workflows
- Create argument validation logic
- 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.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。