Certified by MCP Review
This project is officially certified by MCP Review.
MCP (Model Context Protocol) Prompt Manager is a server that enables AI models like Claude to access local prompt files. It provides functionality for creating, retrieving, updating, and deleting prompts, allowing efficient management of frequently used prompts.
- List all prompts
- Retrieve specific prompt content
- Create new prompts
- Update prompt content
- Delete prompts
- Intelligent Search: Advanced fuzzy search with multiple algorithms (Levenshtein, Jaro-Winkler, n-gram similarity)
- Category & Tag System: Organize prompts with categories and tags
- Template Processing: Use variable substitution with
{{variable}}syntax and advanced conditionals - Template Library: Built-in template library with 12 professional templates across 5 categories
- Favorites Management: Mark frequently used prompts as favorites
- Metadata Management: Automatic metadata tracking for enhanced organization
- Version Management: Complete version control with history tracking, diff comparison, and rollback capabilities
- Import/Export System: Backup and restore prompts with JSON format, including metadata and version history
- Security & Validation: Comprehensive input sanitization, rate limiting, and error handling
- Caching System: Intelligent caching for improved performance
- Structured Logging: Advanced logging with multiple levels and file output
- Node.js v18 or higher
- npm
-
Clone the repository
git clone https://github.com/Tae4an/mcp-prompt-manager.git cd mcp-prompt-manager -
Install dependencies
npm install
-
Grant execution permissions
chmod +x server.js
docker build -t mcp-prompt-manager:local .
docker run --rm \
-e NODE_ENV=production \
-e LOG_DIR=/var/log/mcp \
-e PROMPTS_DIR=/data/prompts \
-v $(pwd)/prompts:/data/prompts \
-v $(pwd)/logs:/var/log/mcp \
mcp-prompt-manager:localdocker compose up -d --build- PROMPTS_DIR: Directory to store prompts (default: project
prompts) - LOG_DIR: Directory for file logging (default:
./logs) - Cache TTL/size:
- FILE_CACHE_TTL, FILE_CACHE_MAX_SIZE
- SEARCH_CACHE_TTL, SEARCH_CACHE_MAX_SIZE
- METADATA_CACHE_TTL, METADATA_CACHE_MAX_SIZE
- TEMPLATE_CACHE_TTL, TEMPLATE_CACHE_MAX_SIZE
- Rate limit presets:
- RATE_LIMIT_STANDARD_WINDOW_MS, RATE_LIMIT_STANDARD_MAX
- RATE_LIMIT_STRICT_WINDOW_MS, RATE_LIMIT_STRICT_MAX
- RATE_LIMIT_LENIENT_WINDOW_MS, RATE_LIMIT_LENIENT_MAX
- RATE_LIMIT_UPLOAD_WINDOW_MS, RATE_LIMIT_UPLOAD_MAX
- Policy/permissions:
- READ_ONLY (true/false): disable write operations
- DISABLE_IMPORT (true/false): block import
- DISABLE_EXPORT (true/false): block export
- DISABLE_VERSION_ROLLBACK (true/false): block rollback
-
Install Claude Desktop (if not already installed)
-
Open Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the following content to the configuration file:
{ "mcpServers": { "promptManager": { "command": "node", "args": ["absolute_path_to_cloned_repository/server.js"] } } }Example:
{ "mcpServers": { "promptManager": { "command": "node", "args": ["/Users/username/projects/mcp-prompt-manager/server.js"] } } } -
Restart Claude Desktop
In Claude Desktop, click the tools icon (🛠️) to access the following MCP tools:
Retrieves a list of all prompts.
- Parameters: None
Retrieves the content of a specific prompt.
- Parameters:
filename- Name of the prompt file to retrieve
Creates a new prompt.
- Parameters:
filename- Name of the prompt file to create (e.g., my-prompt.txt)content- Prompt content
Updates the content of an existing prompt.
- Parameters:
filename- Name of the prompt file to updatecontent- New prompt content
Deletes a prompt (automatically removes associated metadata).
- Parameters:
filename- Name of the prompt file to delete
Advanced fuzzy search prompts by filename or content with intelligent ranking.
- Parameters:
query- Search query stringsearchInContent- (Optional) Boolean to search within prompt content (default: false)limit- (Optional) Maximum number of results to return (default: 10)threshold- (Optional) Minimum similarity threshold (0.0-1.0, default: 0.3)
Add tags to a prompt for better organization.
- Parameters:
filename- Name of the prompt file to tagtags- Array of tag strings
Set a category for a prompt.
- Parameters:
filename- Name of the prompt file to categorizecategory- Category name string
List prompts organized by category.
- Parameters:
category- (Optional) Specific category to filter by
Process a prompt template with variable substitution.
- Parameters:
filename- Name of the template prompt filevariables- Object with variable names as keys and replacement values as values
- Note: Use
{{variable}}format in templates
List all variables found in a template prompt.
- Parameters:
filename- Name of the template prompt file to analyze
Add or remove a prompt from favorites.
- Parameters:
filename- Name of the prompt fileaction- Either "add" or "remove"
List all favorite prompts with detailed information.
- Parameters: None
List all versions of a specific prompt with timestamps and actions.
- Parameters:
filename- Name of the prompt file to get version history for
Compare two versions of a prompt and show detailed differences.
- Parameters:
filename- Name of the prompt file to comparefromVersion- Source version number to compare fromtoVersion- Target version number to compare to
Rollback a prompt to a specific previous version.
- Parameters:
filename- Name of the prompt file to rollbackversion- Version number to rollback to
Get the content of a specific version of a prompt.
- Parameters:
filename- Name of the prompt fileversion- Version number to retrieve
Get statistics about a prompt's version history including total versions, actions breakdown, and size history.
- Parameters:
filename- Name of the prompt file to get statistics for
The built-in template library includes 12 professional templates across 5 categories:
- 🖥️ Coding & Development (3 templates): Code review, debugging help, API documentation
- 🌐 Translation & Language (2 templates): Text translation, grammar checking
- 📝 Document Writing (2 templates): Document summarization, meeting minutes
- 📊 Analysis & Research (2 templates): SWOT analysis, competitive analysis
- 🎓 Education & Learning (3 templates): Lesson plans, quiz generation
List all available template categories with descriptions and template counts.
- Parameters: None
List all templates in a specific category.
- Parameters:
categoryId- Category ID to list templates from
Get detailed information about a specific template including variables and usage.
- Parameters:
templateId- Template ID (format: category.template-name)
Search through the template library using fuzzy matching.
- Parameters:
query- Search query stringcategory- (Optional) Filter by specific categorytags- (Optional) Array of tags to filter bylimit- (Optional) Maximum number of results (default: 10)
Render a template with provided variables and get the processed content.
- Parameters:
templateId- Template ID to rendervariables- Object with variable names and valuessanitizeOutput- (Optional) Enable output sanitization (default: true)
Validate template syntax and check for potential issues.
- Parameters:
templateId- Template ID to validate
Get list of most popular templates based on usage patterns.
- Parameters:
limit- (Optional) Number of templates to return (default: 5)
Get templates related to a specific template based on tags and categories.
- Parameters:
templateId- Template ID to find related templates forlimit- (Optional) Number of related templates (default: 3)
Get comprehensive statistics about the template library.
- Parameters: None
Create a new prompt file using a template with variable substitution.
- Parameters:
templateId- Template ID to usefilename- Name for the new prompt filevariables- Object with template variablesaddMetadata- (Optional) Add template metadata to file (default: true)
Export prompts to JSON format for backup or sharing.
- Parameters:
format- (Optional) Export format: "json" (default: json)includeMetadata- (Optional) Include metadata in export (default: true)includeVersionHistory- (Optional) Include version history (default: false)filterByTags- (Optional) Array of tags to filter promptsfilterByCategory- (Optional) Category to filter promptscompress- (Optional) Compress export data (default: false)
Import prompts from JSON format with validation and conflict resolution.
- Parameters:
importData- Import data object in export formatoverwriteExisting- (Optional) Overwrite existing files (default: false)skipDuplicates- (Optional) Skip duplicate files (default: true)validateChecksums- (Optional) Validate file checksums (default: true)createBackup- (Optional) Create backup before import (default: true)mergeMetadata- (Optional) Merge with existing metadata (default: true)
Get import/export system status and capabilities.
- Parameters: None
Get process/server runtime stats (uptime, memory, policy flags, cache info).
- Parameters: None
Get current policy/permission flags derived from environment variables.
- Parameters: None
Read cache statistics for files/metadata/search/templates (size, hit/miss, memory usage).
- Parameters: None
Get current rate limiter stats for standard/strict/upload presets.
- Parameters: None
- Input Sanitization: Comprehensive XSS and injection attack prevention
- Rate Limiting: Configurable rate limiting with sliding window algorithm
- Caching System: Multi-level LRU caching with TTL support for improved performance
- Error Handling: Advanced error recovery and logging system
- File Validation: SHA-256 checksums and integrity verification
- Conditional Logic: Support for
{{#if}},{{#unless}},{{#each}}constructs - Loop Processing: Iterate over arrays and objects in templates
- Function Calls: Built-in helper functions for formatting and processing
- Nested Variables: Support for complex object structures
- Error Recovery: Graceful handling of missing variables and malformed templates
- Levenshtein Distance: Character-based similarity matching
- Jaro-Winkler Distance: Optimized for prefix matching
- N-gram Similarity: Substring pattern matching
- Intelligent Ranking: Multi-factor scoring with customizable thresholds
- Highlighting: Search result highlighting for better user experience
- Version Control: Complete history tracking with diff comparison
- Metadata System: Automatic tagging, categorization, and favorites
- Backup System: Automated backup creation during import operations
- Export Formats: JSON with optional compression and filtering
- File Organization: Structured storage with hidden metadata directories
By default, prompts are stored in the prompts folder in the directory where the server file is located. You can change the path using environment variables:
PROMPTS_DIR=/desired/path node server.jsOr set environment variables in claude_desktop_config.json:
{
"mcpServers": {
"promptManager": {
"command": "node",
"args": ["/absolute/path/mcp-prompt-manager/server.js"],
"env": {
"PROMPTS_DIR": "/desired/path"
}
}
}
}-
Creating a new prompt:
- Tool:
create-prompt - Filename:
greeting.txt - Content:
You are a friendly and helpful AI assistant. Please respond politely to user questions.
- Tool:
-
Listing prompts:
- Tool:
list-prompts
- Tool:
-
Retrieving prompt content:
- Tool:
get-prompt - Filename:
greeting.txt
- Tool:
-
Creating a template prompt:
- Tool:
create-prompt - Filename:
email-template.txt - Content:
Dear {{name}}, Thank you for your interest in {{product}}. Best regards, {{sender}}
- Tool:
-
Processing a template:
- Tool:
process-template - Filename:
email-template.txt - Variables:
{"name": "John", "product": "MCP Server", "sender": "Support Team"}
- Tool:
-
Organizing prompts:
-
Tool:
categorize-prompt -
Filename:
greeting.txt -
Category:
customer-service -
Tool:
tag-prompt -
Filename:
greeting.txt -
Tags:
["polite", "professional", "greeting"]
-
-
Searching prompts:
- Tool:
search-prompts - Query:
assistant - SearchInContent:
true
- Tool:
-
Managing favorites:
- Tool:
favorite-prompt - Filename:
greeting.txt - Action:
add
- Tool:
-
Viewing version history:
- Tool:
list-prompt-versions - Filename:
greeting.txt
- Tool:
-
Comparing versions:
- Tool:
compare-prompt-versions - Filename:
greeting.txt - FromVersion:
1 - ToVersion:
3
- Tool:
-
Rolling back to a previous version:
- Tool:
rollback-prompt - Filename:
greeting.txt - Version:
2
- Tool:
-
Getting version statistics:
- Tool:
get-prompt-version-stats - Filename:
greeting.txt
- Tool:
-
Browsing template categories:
- Tool:
list-template-categories
- Tool:
-
Using a template:
- Tool:
render-template - TemplateId:
coding.code-review - Variables:
{"code": "function hello() { console.log('Hello'); }", "language": "javascript"}
- Tool:
-
Creating prompt from template:
- Tool:
create-prompt-from-template - TemplateId:
writing.meeting-minutes - Filename:
weekly-standup.txt - Variables:
{"meeting_title": "Weekly Standup", "date": "2024-08-04", "attendees": "Team Alpha"}
- Tool:
-
Searching templates:
- Tool:
search-templates - Query:
code review - Category:
coding
- Tool:
-
Exporting prompts for backup:
- Tool:
export-prompts - IncludeMetadata:
true - IncludeVersionHistory:
false - FilterByTags:
["important", "production"]
- Tool:
-
Importing prompts from backup:
- Tool:
import-prompts - ImportData:
{exported data object} - CreateBackup:
true - OverwriteExisting:
false
- Tool:
-
Checking import/export status:
- Tool:
get-import-export-status
- Tool:
- Fuzzy search with parameters:
- Tool:
search-prompts - Query:
custmer servce(intentional typos) - SearchInContent:
true - Threshold:
0.6 - Limit:
15
- Tool:
- Verify that the server file path is correct
- Check that the server has execution permissions
- Ensure Node.js version is v18 or higher
- Try restarting Claude Desktop
- Verify that the
claude_desktop_config.jsonfile is configured correctly
- Ensure you have read/write permissions for the prompts directory
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on the GitHub repository.