15 unstable releases (3 breaking)
Uses new Rust 2024
| 0.10.9 | Jan 2, 2026 |
|---|---|
| 0.10.8 | Dec 26, 2025 |
| 0.8.0 | Dec 6, 2025 |
| 0.5.0 |
|
#2496 in Development tools
Used in 4 crates
(3 directly)
4MB
218 lines
kodegen-tools-config
KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents.
Configuration management MCP server for AI code generation agents. Part of the KODEGEN.ᴀɪ ecosystem.
Features
- 🔧 Dynamic Configuration Management - Get and set server configuration via MCP tools
- 🔒 Security Controls - Manage blocked commands, allowed/denied directories
- 📊 System Diagnostics - Real-time system information (CPU, memory, platform)
- 🚀 HTTP/HTTPS Support - Flexible transport with optional TLS
- 🎯 Client Tracking - Track and manage MCP client connections
- ⚡ Debounced Persistence - Efficient config writes with 300ms debouncing
Installation
From Source
git clone https://github.com/cyrup-ai/kodegen-tools-config.git
cd kodegen-tools-config
cargo build --release
The compiled binary will be at target/release/kodegen-config.
Prerequisites
- Rust nightly toolchain
- Cargo
Usage
Starting the Server
HTTP (default):
kodegen-config --http 127.0.0.1:3100
HTTPS with TLS:
kodegen-config --http 127.0.0.1:3100 \
--tls-cert path/to/cert.pem \
--tls-key path/to/key.pem
Environment Variables
Override security-critical settings via environment variables:
Unix/macOS:
export KODEGEN_ALLOWED_DIRS="/home/user/projects:/home/user/workspace"
export KODEGEN_DENIED_DIRS="/home/user/secrets:/etc"
Windows:
$env:KODEGEN_ALLOWED_DIRS="C:\Users\user\projects;C:\Users\user\workspace"
$env:KODEGEN_DENIED_DIRS="C:\Users\user\secrets;C:\Windows"
MCP Tools
get_config
Retrieve complete server configuration including security settings, resource limits, and system diagnostics.
Example Request:
{
"name": "get_config",
"arguments": {}
}
Example Response:
{
"blocked_commands": ["rm", "sudo", "format"],
"default_shell": "/bin/sh",
"allowed_directories": [],
"denied_directories": [],
"file_read_line_limit": 1000,
"file_write_line_limit": 50,
"fuzzy_search_threshold": 0.7,
"http_connection_timeout_secs": 5,
"system_info": {
"platform": "macos",
"arch": "aarch64",
"os_version": "14.0",
"hostname": "macbook",
"cpu_count": 8,
"memory": {
"total_mb": 16384,
"available_mb": 8192,
"used_mb": 8192
}
}
}
set_config_value
Update a specific configuration value.
Example Requests:
// Change file read limit
{
"name": "set_config_value",
"arguments": {
"key": "file_read_line_limit",
"value": 2500
}
}
// Update blocked commands
{
"name": "set_config_value",
"arguments": {
"key": "blocked_commands",
"value": ["rm", "sudo", "dd", "format", "shutdown"]
}
}
// Set allowed directories (empty array = full access)
{
"name": "set_config_value",
"arguments": {
"key": "allowed_directories",
"value": ["/home/user/projects"]
}
}
// Adjust fuzzy search threshold (0-100)
{
"name": "set_config_value",
"arguments": {
"key": "fuzzy_search_threshold",
"value": 85
}
}
Configuration Keys
| Key | Type | Description | Default |
|---|---|---|---|
blocked_commands |
Array | Commands that cannot be executed | ["rm", "sudo", "format", ...] |
default_shell |
String | Shell for command execution | /bin/sh (Unix) or powershell.exe (Windows) |
allowed_directories |
Array | Directories server can access (empty = full access) | [] |
denied_directories |
Array | Directories server cannot access | [] |
file_read_line_limit |
Number | Max lines for file read operations | 1000 |
file_write_line_limit |
Number | Max lines per file write operation | 50 |
fuzzy_search_threshold |
Number (0-100) | Minimum similarity for fuzzy search | 70 |
http_connection_timeout_secs |
Number | HTTP connection timeout | 5 |
Configuration File
Configuration is persisted to ~/.kodegen/config.json with automatic debounced writes (300ms).
Example config.json:
{
"blocked_commands": ["rm", "sudo"],
"default_shell": "/bin/bash",
"allowed_directories": ["/home/user/projects"],
"denied_directories": [],
"file_read_line_limit": 2000,
"file_write_line_limit": 100,
"fuzzy_search_threshold": 0.75,
"http_connection_timeout_secs": 10,
"client_history": [
{
"client_info": {
"name": "claude-desktop",
"version": "1.0.0"
},
"connected_at": "2025-01-15T10:30:00Z",
"last_seen": "2025-01-15T12:45:00Z"
}
]
}
Development
Build
cargo build
Run Tests
# All tests
cargo test
# Specific test
cargo test test_name
# Integration example
cargo run --example config_demo
Code Quality
# Format
cargo fmt
# Lint
cargo clippy
# Check
cargo check
Architecture
This package implements its own HTTP server because it cannot depend on kodegen_server_http (which depends on this package's ConfigManager - circular dependency).
Key Components:
- ConfigManager: Thread-safe configuration with debounced persistence
- GetConfigTool: Retrieves configuration and live system diagnostics
- SetConfigValueTool: Updates configuration with validation
- HTTP Server: Axum-based MCP transport with CORS and TLS support
License
Dual-licensed under your choice of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Links
Built with ❤️ by KODEGEN.ᴀɪ
Dependencies
~60–100MB
~1.5M SLoC