MCP Prompt Engine is a server based on the Model Control Protocol (MCP), designed to manage and serve dynamic prompt templates through an elegant and powerful text template engine. It creates reusable, logic-driven prompts that support variables, partial templates, and conditional statements, and can serve any prompt-capable MCP-compatible client, such as Claude Code, Claude Desktop, Gemini CLI, VSCode, and Copilot, among others.
Key Capabilities
- MCP Compatible: Works out of the box and supports any prompt-capable MCP client.
- Powerful Go Templates: Leverages the full Go text/template syntax, including variables, conditionals, loops, and more.
- Reusable Partial Templates: Define common components in partial templates (such as _header.tmpl) and reuse them in prompts.
- Prompt Parameters: All template variables are automatically exposed as MCP prompt parameters, allowing clients to provide dynamic input.
- Hot Reload: Automatically detects changes to prompt files and reloads them without restarting the server.
- Rich CLI: A modern command-line interface that can list, validate, and render templates, making development and testing easier.
- Smart Parameter Handling: Automatically parses JSON parameters (booleans, numbers, arrays, objects) and injects environment variables as fallback template parameters.
- Containerization: Full Docker support for easy deployment and integration.
Usage
- Installation: Can be installed via Go, or by downloading a prebuilt binary, or by using a Docker image.
- Create Prompts: Create .tmpl template files in the prompts directory, using Go template syntax. The comment on the first line of the file is used as the prompt description, and the rest is the template content. Partial templates are named with a _ prefix and can be included via {{template "partial_name" .}}.
- Validate Prompts: Use the CLI to validate template syntax.
- Connect the MCP Server: Add the MCP server to the MCP client configuration, such as Claude Code's ~/.claude.json, Claude Desktop's configuration file, or Gemini CLI's settings file.
- Use Prompts: Select or enter the prompt name in the client and provide the parametersto generate the prompt.
Use Cases
- Create and manage dynamic prompt templates for MCP clients
- Reuse common prompt components to improve efficiency
- Develop prompts that require logical judgment and dynamic input
- Integrate into tools such as Claude Code, Claude Desktop, Gemini CLI, and others
Limitations
- Requires a client compatible with the MCP protocol
- Depends on Go template syntax, so users need to be familiar with the basic syntax
- Managed deployment is available on Fronteir AI, but specific information is not yet provided
- The project uses the MIT license
For more details, please refer to the project's GitHub page.