Prompts in ClojureMCP allow you to define reusable templates that guide LLM interactions. They support Mustache templating for dynamic content and can be configured through the .clojure-mcp/config.edn file.
Prompts are configured under the :prompts key in your config file. Each prompt is a map entry with the prompt name as the key.
:prompts {"prompt-name" {:description "What this prompt does"
:args [{:name "param1"
:description "Description of param1"
:required? true}]
:content "Template content with {{param1}}"}}:description- A clear description of what the prompt does. This is shown to the LLM when listing available prompts.
-
:args- A vector of argument definitions. Each argument has::name- The parameter name (used in templates):description- What this parameter is for:required?- Boolean indicating if required (defaults to false)
-
:content- Inline template content (use this OR:file-path) -
:file-path- Path to a template file (use this OR:content)
Prompts use Mustache templating via the Pogonos library:
Hello {{name}}, welcome to {{project}}!{{#error}}
Error occurred: {{error}}
{{/error}}
{{^error}}
No errors!
{{/error}}Files to review:
{{#files}}
- {{.}}
{{/files}}:prompts {"greeting" {:description "Generate a personalized greeting"
:args [{:name "name" :description "User's name" :required? true}]
:content "Hello {{name}}! How can I help you today?"}}:prompts {"code-review" {:description "Generate a code review for specified file"
:args [{:name "file" :description "File path to review" :required? true}
{:name "focus" :description "Review focus areas" :required? false}]
:content "Please perform a thorough code review of: {{file}}
{{#focus}}
Focus areas: {{focus}}
{{/focus}}
Analyze:
1. Code style and idioms
2. Performance
3. Error handling
4. Testing needs"}}Create a file at .clojure-mcp/prompts/debug-help.md:
I need help debugging an issue in {{namespace}}.
{{#error}}
The error message is:{{error}}
{{/error}}
{{#context}}
Additional context:
{{context}}
{{/context}}
Please help me:
1. Understand the root cause
2. Suggest a fix
3. Verify the solution
Then reference it in config:
:prompts {"debug-help" {:description "Help debug issues in Clojure namespaces"
:args [{:name "namespace" :description "Namespace with issue" :required? true}
{:name "error" :description "Error message" :required? false}
{:name "context" :description "Additional context" :required? false}]
:file-path ".clojure-mcp/prompts/debug-help.md"}}If a template references a variable that isn't provided, it renders as an empty string:
- Template:
"Hello {{name}}, age: {{age}}" - With only
{:name "Alice"}→"Hello Alice, age: "
Arguments provided but not used in the template are simply ignored - no errors occur.
You can override built-in prompts by using the same name in your configuration:
:prompts {"clojure_repl_system_prompt" {:description "Custom system prompt"
:args []
:content "My custom system instructions..."}}Control which prompts are available using enable/disable lists:
;; Only enable specific prompts
:enable-prompts ["code-review" "debug-help"]
;; Or disable specific prompts
:disable-prompts ["chat-session-summarize" "plan-and-execute"]- Relative paths are resolved from the
nrepl-user-dir(typically your project root) - Absolute paths are used as-is
- File paths can reference any readable file in allowed directories
-
Clear Descriptions - Write descriptions that help users understand when to use each prompt
-
Optional Parameters - Use
required? falsefor parameters that enhance but aren't essential -
Conditional Sections - Use
{{#param}}...{{/param}}to handle optional parameters gracefully -
File-Based for Complex Templates - Use separate files for long or complex templates to keep config clean
-
Meaningful Names - Use descriptive prompt names that indicate their purpose
-
Documentation in Templates - Include instructions within the template to guide the LLM
ClojureMCP includes several built-in prompts:
clojure_repl_system_prompt- System instructions for Clojure developmentcreate-update-project-summary- Generate project documentationchat-session-summarize- Summarize conversation for contextchat-session-resume- Resume from previous sessionplan-and-execute- Planning with scratch padACT/add-dir- Add directory to allowed pathsACT/scratch_pad_load- Load scratch pad from fileACT/scratch_pad_save_as- Save scratch pad to file
These can all be overridden or disabled through configuration.