# Config Tools

> MCP tools for loading, saving, and validating claude-flow configuration with path traversal protection and schema validation

- Skill: `jrennie99-glitch/config-tools` (Agent Skill)
- Install (CLI): `npx skillmds add jrennie99-glitch/config-tools`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jrennie99-glitch/config-tools/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: jrennie99-glitch (https://skillmd.com/u/jrennie99-glitch)
- Updated: 2026-08-19
- Page: https://skillmd.com/skills/jrennie99-glitch/config-tools

---


# Config Tools — Configuration Management via MCP

V3 MCP tool suite for managing claude-flow configuration files. Supports loading with scope-based resolution, saving with automatic backups, and validation with auto-fix capabilities. Includes path traversal protection.

## Purpose

Provides a safe, validated interface for managing claude-flow configuration across global, project, and user scopes. Handles merging with defaults, creating backups before writes, and validating all configuration sections against known schemas.

## Source Location

`/tmp/ruflo/v3/mcp/tools/config-tools.ts`

## MCP Tools

### config/load

Load configuration from a file, optionally merged with defaults.

```
Input: {
  path?: string           // Default: ./claude-flow.config.json
  scope: "global" | "project" | "user"  // Default: project
  merge: boolean          // Merge with defaults (default: true)
  includeDefaults: boolean // Include default values in response (default: false)
}
Output: {
  config: Configuration,
  source: string,
  scope: string,
  loadedAt: string,       // ISO 8601
  defaults?: Configuration
}
```

### config/save

Save configuration to a file with optional merge and backup.

```
Input: {
  config: Record<string, unknown>  // Configuration object
  path?: string           // Default: ./claude-flow.config.json
  scope: "global" | "project" | "user"  // Default: project
  merge: boolean          // Merge with existing (default: true)
  createBackup: boolean   // Backup existing file (default: true)
}
Output: {
  saved: boolean,
  path: string,
  scope: string,
  savedAt: string,
  backupPath?: string     // Path to backup file (timestamp-suffixed)
}
```

### config/validate

Validate a configuration object against the schema with optional auto-fix.

```
Input: {
  config: Record<string, unknown>  // Configuration to validate
  strict: boolean         // Fail on unknown fields (default: true)
  fixIssues: boolean      // Auto-fix issues (default: false)
}
Output: {
  valid: boolean,
  issues: ValidationIssue[],
  fixed?: boolean,
  fixedConfig?: Configuration
}
```

## Configuration Schema

The full configuration covers seven sections:

### agents
```typescript
{
  maxConcurrent: number,    // 1-1000, default: 15
  defaultPriority: "low" | "normal" | "high" | "critical",
  timeout: number,          // >= 1000ms, default: 300000
  retryAttempts: number     // default: 3
}
```

### swarm
```typescript
{
  topology: "hierarchical" | "mesh" | "adaptive" | "collective" | "hierarchical-mesh",
  maxAgents: number,        // 1-1000, default: 15
  communicationProtocol: "direct" | "message-bus" | "pubsub",
  consensusMechanism: "majority" | "unanimous" | "weighted" | "none"
}
```

### memory
```typescript
{
  backend: "agentdb" | "sqlite" | "hybrid",
  maxSize: number,          // default: 1000000
  cacheEnabled: boolean,    // default: true
  cacheTTL: number,         // default: 300000
  vectorDimensions: number  // 1-4096, default: 1536
}
```

### mcp
```typescript
{
  transport: "stdio" | "http" | "websocket" | "in-process",
  host: string,             // default: localhost
  port: number,             // default: 3000
  enableMetrics: boolean,   // default: true
  enableCaching: boolean    // default: true
}
```

### performance
```typescript
{
  flashAttention: boolean,  // default: true
  gnnEnhanced: boolean,     // default: true
  quantization: boolean,    // default: false
  optimization: "speed" | "memory" | "balanced"
}
```

### security
```typescript
{
  enableAuth: boolean,      // default: false
  strictMode: boolean,      // default: true
  validateInputs: boolean,  // default: true
  rateLimiting: boolean     // default: true
}
```

### logging
```typescript
{
  level: "debug" | "info" | "warn" | "error",
  format: "json" | "text",
  destination: "console" | "file" | "both"
}
```

## Path Traversal Protection

The `validateConfigPath()` function prevents path traversal attacks:

1. Normalizes path to resolve `..` and `.`
2. Blocks absolute paths (starting with `/` or `\`)
3. Rejects paths containing `..`
4. Only allows `.json` and `.config.*` file extensions
5. Resolves to absolute path within CWD and verifies containment

## Validation Rules

- `agents.maxConcurrent`: Must be 1-1000 (severity: error)
- `agents.timeout`: Should be >= 1000ms (severity: warning)
- `swarm.maxAgents`: Must be 1-1000 (severity: error)
- `memory.vectorDimensions`: Must be 1-4096 (severity: error)

Each issue includes field path, description, severity (`error`/`warning`/`info`), and a suggestion string.

## Default Configuration

The default config file is `./claude-flow.config.json`. Defaults use:
- Hierarchical-mesh topology with 15 max agents
- Hybrid memory backend with 1536-dimension vectors
- stdio MCP transport on localhost:3000
- Flash attention and GNN enhancement enabled
- JSON logging to console at info level

