loading…
Search for a command to run...
loading…
Provides AI-powered selection and generation of specialized system prompts from a database of over 66 templates for Claude Code. It uses semantic search to find
Provides AI-powered selection and generation of specialized system prompts from a database of over 66 templates for Claude Code. It uses semantic search to find the best matching template and can adapt it to fit specific user tasks and contexts.
AI-powered prompt template selection and generation for Claude Code
Installation • Quick Start • Usage • API • Examples
MCP server that automatically selects and generates specialized prompts from a knowledge base of 66+ Claude Code system prompts. Uses LLM-powered semantic search to find the best matching template and adapts it to your specific task.
# Clone the repository
git clone https://github.com/YOUR_USERNAME/mcp-prompt-tool.git
cd mcp-prompt-tool
# Install dependencies
bun install
# Configure API key
echo "ANTHROPIC_API_KEY=your-api-key-here" > .env
Add MCP server to Claude Code via command line:
claude mcp add --transport stdio prompt-template-selector -- bun run /path/to/mcp-prompt-tool/src/index.ts
Verify connection:
claude mcp list
Then in Claude Code use /mcp to see available tools.
bun run start:http
# Server runs at http://localhost:3000
Once connected, you have 4 tools available in Claude Code:
list_templatesBrowse available templates:
list_templates category:agent
list_templates search:"code review"
select_templateFind best matching template for your task:
select_template task_description:"I need to review GitHub PRs"
generate_promptGenerate a ready-to-use prompt:
generate_prompt task_description:"Agent for Python code refactoring" context:"Django, async migration"
sync_templatesUpdate templates from GitHub:
sync_templates force_reindex:true
Request:
{
"task_description": "Агент для code review Pull Request на GitHub",
"prompt_type": "agent"
}
Result: Returns the original agent-prompt-review-pr-slash-command template as-is, since it's a perfect match.
You are an expert code reviewer. Follow these steps:
1. If no PR number is provided in the args, use ${BASH_TOOL_OBJECT.name}("gh pr list") to show open PRs
2. If a PR number is provided, use ${BASH_TOOL_OBJECT.name}("gh pr view <number>") to get PR details
3. Use ${BASH_TOOL_OBJECT.name}("gh pr diff <number>") to get the diff
4. Analyze the changes and provide a thorough code review...
Request:
{
"task_description": "Agent for legacy Python code analysis and migration to Python 3.12 async/await",
"prompt_type": "agent",
"context": "Django project with synchronous callbacks"
}
Result: Adapts the agent-prompt-plan-mode-enhanced template with Django/async specifics:
You are a Python code modernization specialist for legacy Django projects.
Your role is to analyze and plan refactoring of synchronous callback-based
code with migration to Python 3.12 and async/await patterns.
=== CRITICAL: READ-ONLY MODE ===
...
## Your Process
1. **Understand Requirements**: Focus on the legacy code patterns...
2. **Explore Thoroughly**: Find callback-based patterns and synchronous code...
3. **Design Solution**: Plan async context manager and async generator migrations...
Request:
{
"category": "agent",
"search": "security"
}
Result:
{
"total_count": 2,
"templates": [
{
"name": "agent-prompt-security-review-slash",
"purpose": "Conduct focused security reviews of code changes",
"complexity": "complex"
},
{
"name": "agent-prompt-bash-command-prefix-detection",
"purpose": "Detecting command injection attacks",
"complexity": "complex"
}
]
}
| Category | Count | Examples |
|---|---|---|
agent |
28 | PR review, code exploration, security audit |
system |
10 | Base behavior, plan mode, configuration |
tool |
19 | Bash, Read, Edit, Grep tool descriptions |
reminder |
3 | Plan mode reminders |
skill |
5 | GitHub integration, specialized skills |
Add your own templates to custom-templates/ directory:
custom-templates/
├── my-agent.md # Your custom prompt
└── metadata.json # Optional: category, tags, priority
metadata.json:
{
"templates": {
"my-agent": {
"category": "agent",
"tags": ["custom", "specialized"],
"priority": 10
}
}
}
Custom templates are prioritized over built-in ones during selection.
| Tool | Description | Required Params |
|---|---|---|
list_templates |
List/search templates | — |
select_template |
Find matching templates | task_description |
generate_prompt |
Generate customized prompt | task_description |
sync_templates |
Sync from GitHub | — |
list_templates:
category: agent | system | tool | reminder | skill | anysearch: Text search queryinclude_custom: Include custom templates (default: true)select_template / generate_prompt:
task_description: What you need the prompt forprompt_type: Filter by categorycontext: Additional context for adaptationtarget_llm: Target model (default: Claude)max_results: Max templates to consider (default: 3)sync_templates:
force_reindex: Re-index all templates (default: false)| Variable | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY |
Anthropic API key | — |
PORT |
HTTP server port | 3000 |
Global config (~/.claude.json):
{
"mcpServers": {
"prompt-template-selector": {
"command": "bun",
"args": ["run", "/path/to/mcp-prompt-tool/src/index.ts"]
}
}
}
Project config (.mcp.json in project root):
{
"mcpServers": {
"prompt-template-selector": {
"type": "stdio",
"command": "bun",
"args": ["run", "/path/to/mcp-prompt-tool/src/index.ts"]
}
}
}
# Run in stdio mode (default)
bun run start
# Run as HTTP server
bun run start:http
# Development with watch
bun run dev
# Run tests
bun test
# Type check
bun run typecheck
mcp-prompt-tool/
├── src/
│ ├── index.ts # Entry point (stdio/http)
│ ├── tools/ # MCP tool implementations
│ │ ├── list-templates.ts
│ │ ├── select-template.ts
│ │ ├── generate-prompt.ts
│ │ └── sync-templates.ts
│ ├── services/ # Business logic
│ │ ├── template-loader.ts # GitHub repo sync
│ │ ├── template-indexer.ts # LLM-powered indexing
│ │ ├── prompt-generator.ts # Selection & generation
│ │ └── custom-templates.ts # User templates
│ └── types/
│ └── index.ts
├── templates/ # Cached template index
├── custom-templates/ # User custom templates
├── tests/
├── .env # API key (git-ignored)
└── package.json
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-prompt-template-selector": {
"command": "npx",
"args": []
}
}
}