kodegen_config_manager

Crates.iokodegen_config_manager
lib.rskodegen_config_manager
version0.10.10
created_at2025-11-10 14:58:58.224272+00
updated_at2026-01-02 15:03:14.07389+00
descriptionKODEGEN.ᴀɪ: Configuration management infrastructure for MCP tool servers.
homepagehttps://kodegen.ai
repositoryhttps://github.com/cyrup-ai/kodegen-config-manager
max_upload_size
id1925672
size4,119,391
David Maple (kloudsamurai)

documentation

README

Kodegen AI Banner

kodegen-tools-config

KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents.

License Rust

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:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Links


Built with ❤️ by KODEGEN.ᴀɪ

Commit count: 0

cargo fmt