| Crates.io | kodegen_tools_prompt |
| lib.rs | kodegen_tools_prompt |
| version | 0.10.9 |
| created_at | 2025-10-29 03:25:40.147272+00 |
| updated_at | 2026-01-02 15:04:46.261219+00 |
| description | KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents. |
| homepage | https://kodegen.ai |
| repository | https://github.com/cyrup-ai/kodegen-tools-prompt |
| max_upload_size | |
| id | 1906011 |
| size | 4,119,019 |
Memory-efficient, blazing-fast MCP tools for prompt template management in code generation agents.
kodegen-tools-prompt is a Rust-based Model Context Protocol (MCP) server that provides AI agents with powerful prompt template management capabilities. It enables creating, editing, retrieving, and rendering Jinja2-templated prompts with YAML frontmatter metadata.
Part of the KODEGEN.ai ecosystem, this server runs as an HTTP service managed by the kodegend daemon.
git clone https://github.com/cyrup-ai/kodegen-tools-prompt.git
cd kodegen-tools-prompt
cargo build --release
The binary will be available at target/release/kodegen-prompt.
cargo run --bin kodegen-prompt
The server typically runs on port 30438 when managed by kodegend.
The server provides four MCP tools:
prompt_add - Create New Prompt{
"name": "my_workflow",
"content": "---\ntitle: \"My Workflow\"\ndescription: \"Custom workflow\"\ncategories: [\"custom\"]\nauthor: \"your-name\"\nparameters:\n - name: \"project_path\"\n description: \"Project directory\"\n required: false\n default: \".\"\n---\n\n# My Workflow\n\nProject: {{ project_path }}\nUser: {{ env.USER }}"
}
prompt_get - Retrieve and Render PromptsList all categories:
{
"action": "list_categories"
}
List prompts by category:
{
"action": "list_prompts",
"category": "onboarding"
}
Get prompt metadata and content:
{
"action": "get",
"name": "getting_started"
}
Render prompt with parameters:
{
"action": "render",
"name": "analyze_project",
"parameters": {
"project_path": "/path/to/project"
}
}
prompt_edit - Update Existing Prompt{
"name": "my_workflow",
"content": "---\ntitle: \"Updated Workflow\"\n..."
}
prompt_delete - Remove Prompt{
"name": "my_workflow"
}
Prompts are stored as .j2.md files with YAML frontmatter:
---
title: "Prompt Title"
description: "What this prompt does"
categories: ["category1", "category2"]
author: "your-name"
verified: true
parameters:
- name: "param_name"
description: "Parameter description"
param_type: "string" # string | number | boolean | array
required: false
default: "default_value"
---
# Template Content
Use {{ param_name }} for parameters.
Access environment variables: {{ env.USER }}, {{ env.HOME }}
## Jinja2 Syntax Support
{% if condition %}
Conditional content
{% endif %}
{% for item in items %}
- {{ item }}
{% endfor %}
Apply filters: {{ value | upper }}
{{ variable_name }}{% if condition %}...{% endif %}{% for item in items %}...{% endfor %}{{ value | filter_name }}{{ env.USER }}, {{ env.HOME }}, {{ env.SHELL }}, etc.Prompts are stored in: ~/.kodegen/prompts/
# Build the project
cargo build
# Run tests
cargo test
# Run with logging
RUST_LOG=info cargo run --bin kodegen-prompt
# Format code
cargo fmt
# Lint
cargo clippy -- -D warnings
The repository includes integration test examples:
# Run the prompt demo (tests all CRUD operations)
cargo run --example prompt_demo
This example:
src/
├── lib.rs # Public API exports
├── main.rs # HTTP server binary
├── manager.rs # PromptManager core logic
├── template.rs # Jinja2 parsing/rendering
├── metadata.rs # Data structures
├── validation.rs # Security validation
├── add_prompt.rs # AddPromptTool
├── edit_prompt.rs # EditPromptTool
├── delete_prompt.rs # DeletePromptTool
├── get_prompt.rs # GetPromptTool
└── defaults.rs # Embedded default prompts
data/default_prompts/ # Default templates
examples/ # Integration examples
{% include %}, {% extends %}, {% import %}See CLAUDE.md for detailed architecture documentation.
The server ships with curated default prompts:
Default prompts are automatically installed on first run if the prompts directory is empty.
Contributions are welcome! Please ensure:
cargo fmtcargo testcargo clippy -- -D warningsLicensed under either of:
at your option.
Built with ❤️ by the KODEGEN.ai team