🏎️ 🏠 🪟️ 🐧 🍎 - Manage and serve dynamic prompt templates using a text template engine
MCP Prompt Engine
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Control Protocol (MCP) server for managing and serving dynamic prompt templates using elegant and powerful text template engine.
Create reusable, logic-driven prompts with variables, partials, and conditionals that can be served to any compatible MCP client like Claude Code, Claude Desktop, Gemini CLI, VSCode with Copilot, etc.
Key Features
- **MCP Compatible**: Works out-of-the-box with any MCP client that supports prompts.
- **Powerful Go Templates**: Utilizes the full power of Go text/template syntax, including variables, conditionals, loops, and more.
- **Reusable Partials**: Define common components in partial templates (e.g., _header.tmpl) and reuse them across your prompts.
- **Prompt Arguments**: All template variables are automatically exposed as MCP prompt arguments, allowing dynamic input from clients.
- **Hot-Reload**: Automatically detects changes to your prompt files and reloads them without restarting the server.
- **Rich CLI**: A modern command-line interface to list, validate, and render templates for easy development and testing.
- **Smart Argument Handling**:
- Automatically parses JSON arguments (booleans, numbers, arrays, objects).
- Injects environment variables as fallbacks for template arguments.
- **Containerized**: Full Docker support for easy deployment and integration.
Hosted deployment
A hosted deployment is available on Fronteir AI.
Getting Started
1. Installation
Install using Go:
(For other methods like Docker or pre-built binaries, see the Installation section below.)
2. Create a Prompt
Create a prompts directory and add a template file. Let's create a prompt to help write a Git commit message.
First, create a reusable partial named prompts/_git_commit_role.tmpl:
: A brief, imperative-tense summary of changes
[Optional longer description, explaining the "why" of the change. Use dash points for clarity.]
Now, create a main prompt prompts/git_stage_commit.tmpl that uses this partial:
3. Validate Your Prompt
Validate your prompt to ensure it has no syntax errors:
4. Connect MCP Server to Your Client
Add MCP Server to your MCP client. See Connecting to Clients for configuration examples.
5. Use Your Prompt
Your git_stage_commit prompt will now be available in your client!
For example, in Claude Desktop, you can select the git_stage_commit prompt, provide the type MCP Prompt argument and get a generated prompt that will help you to do a commit with a perfect message.
In Claude Code or Gemini CLI, you can start typing /git_stage_commit and it will suggest the prompt with the provided arguments that will be executed after you select it.
---
Installation
Pre-built Binaries
Download the latest release for your OS from the GitHub Releases page.
Build from Source
Docker
A pre-built Docker image is available. Mount your local prompts and logs directories to the container.
You can also build the image locally with make docker-build.
---
Usage
Creating Prompt Templates
Create a directory to store your prompt templates. Each template should be a .tmpl file using Go's text/template syntax with the following format:
The first line comment ({{/* description */}}) is used as the prompt description, and the rest of the file is the prompt template.