The Prompts MCP Server provides a convenient way to manage and retrieve prompt templates through the Model Context Protocol (MCP). This server stores prompts as markdown files with YAML frontmatter and offers tools for adding, retrieving, listing, and deleting prompts.
npm install -g prompts-mcp-server
After installation, you need to configure your MCP client to use the server.
# Clone the repository
git clone https://github.com/tanker327/prompts-mcp-server.git
cd prompts-mcp-server
# Install dependencies
npm install
# Build the TypeScript code
npm run build
Test that the server works correctly:
# Start the server
npm start
# Or test with MCP Inspector
npx @modelcontextprotocol/inspector prompts-mcp-server
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"prompts-mcp-server": {
"command": "prompts-mcp-server",
"env": {
"PROMPTS_FOLDER_PATH": "/path/to/your/prompts/directory"
}
}
}
}
{
"cline.mcp.servers": {
"prompts-mcp-server": {
"command": "prompts-mcp-server",
"env": {
"PROMPTS_FOLDER_PATH": "/path/to/your/prompts/directory"
}
}
}
}
In your ~/.continue/config.json
:
{
"mcpServers": [
{
"name": "prompts-mcp-server",
"command": "prompts-mcp-server",
"env": {
"PROMPTS_FOLDER_PATH": "/path/to/your/prompts/directory"
}
}
]
}
In your Zed settings (~/.config/zed/settings.json
):
{
"assistant": {
"mcp_servers": {
"prompts-mcp-server": {
"command": "prompts-mcp-server",
"env": {
"PROMPTS_DIR": "/path/to/your/prompts/directory"
}
}
}
}
}
add_prompt
Add a new prompt to the collection. If no YAML frontmatter is provided, default metadata will be automatically added.
create_structured_prompt
Create a new prompt with guided metadata structure and validation.
get_prompt
Retrieve a prompt by name.
list_prompts
List all available prompts with metadata preview. No parameters required.
delete_prompt
Delete a prompt by name.
// Add a prompt without frontmatter - metadata will be added automatically
add_prompt({
name: "debug_helper",
content: `# Debug Helper
Help me debug this issue by:
1. Analyzing the error message
2. Suggesting potential causes
3. Recommending debugging steps`
})
// This automatically adds default frontmatter with title "Debug Helper", category "general", etc.
// Create a prompt with explicit metadata using the structured tool
create_structured_prompt({
name: "code_review",
title: "Code Review Assistant",
description: "Helps review code for best practices and potential issues",
category: "development",
tags: ["code", "review", "quality"],
difficulty: "intermediate",
author: "Development Team",
content: `# Code Review Prompt
Please review the following code for:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security vulnerabilities
## Code to Review
[Insert code here]`
})
// Add a prompt with existing frontmatter - no changes made
add_prompt({
name: "custom_prompt",
content: `---
title: "Custom Assistant"
category: "specialized"
tags: ["custom", "specific"]
difficulty: "advanced"
---
# Custom Prompt Content
Your specific prompt here...`
})
// Get a prompt
get_prompt({ name: "code_review" })
// List all prompts (shows metadata preview)
list_prompts({})
// Delete a prompt
delete_prompt({ name: "old_prompt" })
The server automatically creates the prompts/
directory if it doesn't exist. Prompt files are stored with sanitized filenames, and file changes are monitored in real-time to update the cache automatically.
Variable | Description | Default |
---|---|---|
PROMPTS_FOLDER_PATH |
Custom directory to store prompt files | ./prompts |
NODE_ENV |
Environment mode | production |
# Ensure TypeScript is built
npm run build
# Check that dist/ directory exists and contains .js files
ls dist/
npm start
node --version
npx @modelcontextprotocol/inspector prompts-mcp-server
# Ensure the prompts directory is writable
mkdir -p ./prompts
chmod 755 ./prompts
Enable debug logging by setting environment variables:
# Enable debug mode
DEBUG=* node dist/index.js
# Or with specific debug namespace
DEBUG=prompts-mcp:* node dist/index.js
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "prompts-mcp-server" '{"command":"prompts-mcp-server"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"prompts-mcp-server": {
"command": "prompts-mcp-server"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"prompts-mcp-server": {
"command": "prompts-mcp-server"
}
}
}
3. Restart Claude Desktop for the changes to take effect