The Claude Custom Prompts Server implements the Model Context Protocol (MCP) for Claude AI models, allowing you to create and use custom prompt templates with a modular, category-based organization system. It supports features like prompt arguments, conversation history access, and multi-step prompt chains.
# Clone the repository
git clone https://github.com/yourusername/claude-prompts.git
cd claude-prompts
# Install dependencies and build the server
cd server
npm install
npm run build
# Start the server
npm start
To connect the MCP server to Claude Desktop:
Locate your Claude Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the MCP server configuration:
"mcp_servers": {
"claude-prompts": {
"command": "node",
"args": [
"C:\\path\\to\\claude-prompts\\server\\dist\\index.js",
"--transport=stdio"
],
"cwd": "C:\\path\\to\\claude-prompts\\server",
"env": {
"PORT": "9090"
}
}
}
Important: Replace the paths with absolute paths to your server directory. For Windows, use double backslashes (\\
).
Once configured, you can use your custom prompts in Claude by typing:
>>command_name argument1=value1 argument2=value2
For example:
>>friendly_greeting name=John
For chain prompts:
>>content_analysis_chain text="Your content here" focus="clarity"
To see all available commands:
>>listprompts
The server uses two main configuration files:
{
"server": {
"name": "Claude Custom Prompts",
"version": "1.0.0",
"port": 9090
},
"prompts": {
"file": "promptsConfig.json",
"registrationMode": "name"
},
"transports": {
"default": "stdio",
"sse": { "enabled": false },
"stdio": { "enabled": true }
}
}
This file defines prompt categories and imports category-specific prompt files:
{
"categories": [
{
"id": "general",
"name": "General",
"description": "General-purpose prompts for everyday tasks"
},
{
"id": "code",
"name": "Code",
"description": "Prompts related to programming and software development"
}
],
"imports": [
"prompts/general/prompts.json",
"prompts/code/prompts.json"
]
}
prompts/general/my_prompt.md
)Example category-specific prompt file (prompts/general/prompts.json
):
{
"prompts": [
{
"id": "friendly_greeting",
"name": "Friendly Greeting",
"category": "general",
"description": "A warm, personalized greeting.",
"file": "friendly_greeting.md",
"arguments": [
{
"name": "name",
"description": "The name of the person to greet",
"required": false
}
]
}
]
}
prompts
directory (e.g., prompts/mycategory/
)prompts.json
file in the new folder with an empty "prompts" arraycategories
array in promptsConfig.json
imports
arrayYou can use {{previous_message}}
in your prompt templates to reference the previous message in the conversation context.
Prompt chains execute a sequence of prompts, with each prompt using results from previous prompts. To create a chain prompt:
# My Chain Prompt
## Description
Description of what this chain does.
## User Message Template
Initial message template with {{variables}}.
## Chain Steps
1. promptId: first_prompt_id
stepName: Step 1: Description of first step
inputMapping:
prompt_input: chain_input
outputMapping:
prompt_output: chain_variable
2. promptId: second_prompt_id
stepName: Step 2: Description of second step
inputMapping:
input1: chain_input
input2: chain_variable
outputMapping:
output: final_result
## Output Format
Description of the expected final output format.
cwd
parameter points to the correct server directorycwd
parameter if files are not being foundcwd
parameter to avoid confusionserver.log
in the server directorycd path/to/claude-prompts/server
node dist/index.js
The server provides several API endpoints for prompt management:
GET /api/v1/tools/listprompts
curl -X POST http://localhost:9090/api/v1/tools/reload_prompts
curl -X POST http://localhost:9090/api/v1/tools/update_prompt \
-H "Content-Type: application/json" \
-d '{
"id": "example_prompt",
"name": "Example Prompt",
"category": "general",
"description": "An example prompt template",
"userMessageTemplate": "This is an example with {{variable}}",
"arguments": [
{
"name": "variable",
"description": "Example variable",
"required": true
}
]
}'
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.