The MCP Prompt Engine is a server that implements the Model Control Protocol (MCP) for managing and serving dynamic prompt templates. It allows you to create reusable, logic-driven prompts with variables and conditionals that work with any compatible MCP client like Claude Code, Claude Desktop, or Gemini CLI.
The simplest way to install is via Go:
go install github.com/vasayxtx/mcp-prompt-engine@latest
Download the latest release for your operating system from the GitHub Releases page.
Run the pre-built Docker image by mounting your local directories:
docker run -i --rm \
-v /path/to/your/prompts:/app/prompts:ro \
-v /path/to/your/logs:/app/logs \
ghcr.io/vasayxtx/mcp-prompt-engine
git clone https://github.com/vasayxtx/mcp-prompt-engine.git
cd mcp-prompt-engine
make build
Create a directory to store your prompt templates. Each template should be a .tmpl file using Go's text/template syntax:
{{/* Brief description of the prompt */}}
Your prompt text here with {{.template_variable}} placeholders.
The first line comment is used as the prompt description, and the rest is the prompt template.
Partial templates should be prefixed with an underscore (e.g., _header.tmpl) and can be included in other templates.
For example, create a partial named prompts/_git_commit_role.tmpl:
{{ define "_git_commit_role" }}
You are an expert programmer specializing in writing clear, concise, and conventional Git commit messages.
Commit message must strictly follow the Conventional Commits specification.
The final commit message you generate must be formatted exactly as follows:
[Optional longer description, explaining the "why" of the change. Use dash points for clarity.]
{{ if .type -}}
Use {{.type}} as a type.
{{ end }}
{{ end }}
Then use it in a main prompt prompts/git_stage_commit.tmpl:
{{- /* Commit currently staged changes */ -}}
{{- template "_git_commit_role" . -}}
Your task is to commit all currently staged changes.
To understand the context, analyze the staged code using the command: `git diff --staged`
Based on that analysis, commit staged changes using a suitable commit message.
{{.variable_name}} - Access template variables{{.date}} - Current date and time{{if .condition}}...{{end}}, {{if .condition}}...{{else}}...{{end}}{{if and .condition1 .condition2}}...{{end}}{{range .items}}...{{end}}{{template "partial_name" .}}# Simple list of available prompts
mcp-prompt-engine list
# Detailed view with descriptions and variables
mcp-prompt-engine list --verbose
# Validate all templates
mcp-prompt-engine validate
# Validate a specific template
mcp-prompt-engine validate git_stage_commit
Test your templates by rendering them directly:
# Render with arguments
mcp-prompt-engine render git_stage_commit --arg type=feat
# Run with default settings (looks for ./prompts)
mcp-prompt-engine serve
# Specify a different prompts directory and log file
mcp-prompt-engine --prompts /path/to/prompts serve --log-file ./server.log
Add the MCP server to your client's configuration.
~/.claude.json (mcpServers section)~/Library/Application\ Support/Claude/claude_desktop_config.json (mcpServers section)~/.gemini/settings.json (mcpServers section){
"prompts": {
"command": "/path/to/your/mcp-prompt-engine",
"args": [
"--prompts", "/path/to/your/prompts",
"serve",
"--quiet"
]
}
}
{
"mcp-prompt-engine-docker": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/path/to/your/prompts:/app/prompts:ro",
"-v", "/path/to/your/logs:/app/logs",
"ghcr.io/vasayxtx/mcp-prompt-engine"
]
}
}
The server automatically parses argument values as JSON when possible:
true, false → Go boolean values42, 3.14 → Go numeric values["item1", "item2"] → Go slices for use with {{range}}{"key": "value"} → Go maps for structured dataTo disable JSON parsing, use the --disable-json-args flag.
The server automatically detects changes to your prompt files and reloads them without requiring a restart.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "prompts" '{"command":"mcp-prompt-engine","args":["--prompts","/path/to/your/prompts","serve","--quiet"]}'
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": {
"command": "mcp-prompt-engine",
"args": [
"--prompts",
"/path/to/your/prompts",
"serve",
"--quiet"
]
}
}
}
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.json2. Add this to your configuration file:
{
"mcpServers": {
"prompts": {
"command": "mcp-prompt-engine",
"args": [
"--prompts",
"/path/to/your/prompts",
"serve",
"--quiet"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect