prompthub-mcp-adapter
v2.6.0
Published
MCP adapter for connecting AI clients (Cursor, Claude Desktop) to PromptHub server with advanced semantic search and natural language understanding
Maintainers
Readme
PromptHub MCP Adapter
🚀 下一代智能提示词管理的MCP适配器 - 连接AI客户端(Cursor、Claude Desktop等)与PromptHub服务器
✨ 核心特性
- 🧠 Context Engineering - 智能上下文适配,动态调整提示词内容以匹配用户需求
- 🔍 语义搜索引擎 - 多维度相关性计算,精确匹配最相关的提示词
- 📄 完美结果展示 - 提示词内容完整显示,支持一键复制使用
- 📝 统一存储接口 - AI智能分析并存储提示词
- 🎯 提示词优化 - 为第三方AI客户端提供结构化优化指导
- ⚡ 多种处理模式 - 支持 default、fast、deep 三种处理流水线
- 🔧 零配置安装 - 使用npx一键安装,无需复杂配置
- 🌐 跨平台兼容 - 支持所有主流AI客户端和操作系统
🚀 Quick Start
Install and Run with npx (Recommended)
npx prompthub-mcp-adapterInstall Globally
npm install -g prompthub-mcp-adapter
prompthub-mcp-adapter📋 Prerequisites
- Node.js 16.0.0 or higher
- PromptHub API key (get one at prompt-hub.cc)
🔧 Configuration
Environment Variables
| Variable | Description | Default | Required |
|----------|-------------|---------|----------|
| API_KEY | Your PromptHub API key | - | ✅ |
| MCP_SERVER_URL | PromptHub MCP server URL | https://mcp.prompt-hub.cc | ❌ |
| MCP_TIMEOUT | Request timeout in milliseconds | 60000 | ❌ |
Cursor Configuration
Add to your Cursor settings:
{
"mcpServers": {
"prompthub": {
"command": "npx",
"args": ["prompthub-mcp-adapter"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}Claude Desktop Configuration
Add to ~/.claude_desktop_config.json:
{
"mcpServers": {
"prompthub": {
"command": "npx",
"args": ["prompthub-mcp-adapter"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}Local Development
For local PromptHub server:
{
"env": {
"MCP_SERVER_URL": "http://localhost:9010",
"API_KEY": "your-local-api-key"
}
}🛠️ Available Tools
🚀 核心搜索工具 (推荐)
unified_search- 统一搜索引擎 - 语义理解,智能搜索,完美结果展示 ⭐⭐⭐⭐⭐
📝 提示词管理
get_categories- 获取所有提示词分类get_tags- 获取所有提示词标签get_prompt_names- 获取所有可用的提示词名称get_prompt_details- 获取特定提示词详情create_prompt- 创建新提示词update_prompt- 更新现有提示词
🧠 智能功能
context_engineering- Context Engineering - 智能上下文适配,动态调整提示词内容 🆕⭐⭐⭐⭐⭐unified_store- 统一存储 - AI智能分析并存储提示词 ⭐⭐⭐⭐⭐prompt_optimizer- 提示词优化器 - 为第三方AI客户端提供结构化优化指导(仅提供建议,不自动保存) ⭐⭐⭐⭐⭐
🔍 Usage Examples
In Cursor
Once configured, you can use PromptHub tools directly in Cursor:
- "Search for code optimization prompts"
- "Create a new prompt for email writing"
- "Optimize this prompt for better results"
Programmatic Usage
// The adapter handles MCP protocol automatically
// Tools are called through the AI client interface🔍 Troubleshooting
Common Issues
"API_KEY not set"
- Ensure API key is properly configured in environment variables
"Connection failed"
- Check network connectivity
- Verify server URL is correct
- Confirm API key is valid
"Tool not found"
- Tool name might be incorrect
- Use
tools/listto see available tools
Debug Mode
The adapter outputs detailed logs to stderr:
[PromptHub MCP] Initializing...
[PromptHub MCP] Server: https://mcp.prompt-hub.cc
[PromptHub MCP] API Key: Set
[PromptHub MCP] Server connection: OK
[PromptHub MCP] Discovered 24 tools
[PromptHub MCP] Ready for MCP messages...🔒 Security
- Never hardcode API keys in configuration files
- Use environment variables for sensitive data
- Ensure HTTPS is used for production servers
📚 Documentation
🤝 Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
Made with ❤️ by the PromptHub Team
