Prompt Engine MCP server

Provides dynamic prompt template management with Go template engine support, file system watching for real-time updates, and CLI tooling for template rendering, validation, and listing with support for partials, environment variables, and automatic reloading.
Back to servers
Setup instructions
Provider
Vasily Tsybenko
Release date
Aug 20, 2025
Language
Go
Stats
14 stars

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.

Installation Options

Using Go

The simplest way to install is via Go:

go install github.com/vasayxtx/mcp-prompt-engine@latest

Pre-built Binaries

Download the latest release for your operating system from the GitHub Releases page.

Using Docker

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

Building from Source

git clone https://github.com/vasayxtx/mcp-prompt-engine.git
cd mcp-prompt-engine
make build

Creating Prompt Templates

Basic Template Structure

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.

Creating Reusable Partials

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:

: A brief, imperative-tense summary of changes

[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.

Template Syntax Features

  • Variables: {{.variable_name}} - Access template variables
  • Built-in variables: {{.date}} - Current date and time
  • Conditionals: {{if .condition}}...{{end}}, {{if .condition}}...{{else}}...{{end}}
  • Logical operators: {{if and .condition1 .condition2}}...{{end}}
  • Loops: {{range .items}}...{{end}}
  • Template inclusion: {{template "partial_name" .}}

Using the Command Line Interface

Listing Templates

# Simple list of available prompts
mcp-prompt-engine list

# Detailed view with descriptions and variables
mcp-prompt-engine list --verbose

Validating Templates

# Validate all templates
mcp-prompt-engine validate

# Validate a specific template
mcp-prompt-engine validate git_stage_commit

Rendering Templates

Test your templates by rendering them directly:

# Render with arguments
mcp-prompt-engine render git_stage_commit --arg type=feat

Starting the Server

# 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

Connecting to MCP Clients

Add the MCP server to your client's configuration.

Configuration Locations (MacOS)

  • Claude Code: ~/.claude.json (mcpServers section)
  • Claude Desktop: ~/Library/Application\ Support/Claude/claude_desktop_config.json (mcpServers section)
  • Gemini CLI: ~/.gemini/settings.json (mcpServers section)

Local Binary Configuration Example

{
  "prompts": {
    "command": "/path/to/your/mcp-prompt-engine",
    "args": [
      "--prompts", "/path/to/your/prompts",
      "serve",
      "--quiet"
    ]
  }
}

Docker Configuration Example

{
  "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"
    ]
  }
}

Advanced Features

JSON Argument Parsing

The server automatically parses argument values as JSON when possible:

  • Booleans: true, false → Go boolean values
  • Numbers: 42, 3.14 → Go numeric values
  • Arrays: ["item1", "item2"] → Go slices for use with {{range}}
  • Objects: {"key": "value"} → Go maps for structured data

To disable JSON parsing, use the --disable-json-args flag.

Hot-Reload

The server automatically detects changes to your prompt files and reloads them without requiring a restart.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. 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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later