Skip to main content
Glama

Agent Config Companion MCP Server

Companion MCP runtime for cross-harness host inspection, profile persistence, and execution configuration.

Overview

agent-config is an independent Model Context Protocol (MCP) server that acts as the companion runtime for the agent-config Skill.

Architectural Separation

The system uses a strict two-repository architecture:

skills/agent-config (Skill)
       │  (Reasoning & Policy)
       │  • Task shape assessment (single-pass vs decomposed)
       │  • Work-item difficulty assessment (routine / moderate / demanding / critical)
       │  • Execution tier selection (routine / standard / high / review)
       │  • Execution topology selection (single session / controller-workers)
       ▼
agent-config (Companion MCP Server)
       │  (Runtime & Persistence)
       ├─ inspect_host: Inspect host capabilities & available models
       ├─ get_profile / save_profile: Atomic, host-scoped profile persistence
       ├─ preview_configuration: Generates preview diff & hash
       ├─ apply_configuration: Mutates host configuration via Adapter
       └─ validate_configuration: Confirms applied state matches expected
       ▼
Host Adapters
       ├─ Native (10): Codex, Claude Code, Antigravity / agy, DeepSeek Harness (DSH), OpenCode, ZCode, Cursor, Grok Build, Hermes, Pi
       └─ Generic Adapter (plan-only fallback)

Related MCP server: ol-ops-mcp

Installation

Clone and install globally:

git clone https://github.com/light-cheng/agent-config.git
cd agent-config
npm ci
npm run build
npm install -g .

Verify that the CLI is available and can probe the environment:

agent-config setup --check

(Note: setup --check returns non-zero exit code when the companion is not yet registered or configured for the current workspace. This confirms the CLI is functional.)

Companion MCP Registration

To preview and apply companion MCP registration into your current agent host configuration:

# Preview registration diff (read-only)
agent-config setup --preview

# Apply registration with explicit approval
agent-config setup --apply --yes

# Validate health after registration
agent-config setup --check

Relationship with light-cheng/skills

  • Skill (agent-config): Installed from light-cheng/skills:

    npx skills add light-cheng/skills --skill agent-config
  • Companion MCP Runtime (this repository): Provides optional host inspection, profile persistence, configuration preview/apply, and health verification. Without the companion, the Skill remains fully functional in session-local, plan-only mode.

Core Principles

  1. Cross-Harness by Design: Designed from the start for seamless operation across different agent hosts (Codex, OpenCode, Claude Code, Cursor, generic).

  2. Single-Model as a First-Class Citizen: Single-model mode is NOT a degraded fallback; it is a primary operating mode with full topology, concurrency, thread dispatch, and effort controls.

  3. Strict Separation of Evidence and Tier Mappings:

    • Host inspection reports factual model availability and supported discrete effort values.

    • Capability tiers (routine, standard, high, review) are exclusively mapped by the user during setup.

    • No model intelligence guessing: The runtime forbids static ranking fields (routing_rank) or heuristic guessing based on model names.

  4. Abstract Effort Policies vs. Host Discrete Values:

    • Profiles and plans can specify abstract policies (e.g. highest-supported, default, lowest-supported).

    • Adapters resolve policies into the concrete discrete string values actually supported by the host (e.g. high).

  5. Safe Mutation Gate: Configuration changes always require explicit preview generation before application (preview_configuration → apply_configuration), followed by post-mutation validation (validate_configuration).

Standard MCP Tool Surface

Tool

Purpose

get_setup_status

Returns whether the current host/workspace has a configured profile, its version, and stale status.

inspect_host

Queries the active Host Adapter for available models, supported effort values, and concurrency/subagent capabilities.

get_profile

Retrieves the stored, user-confirmed profile for the current host and workspace scope.

save_profile

Validates against schema and host inventory, then atomically persists the profile.

preview_configuration

Previews configuration changes and produces a verifiable preview hash/ID.

apply_configuration

Applies a previously previewed configuration via the corresponding Host Adapter.

validate_configuration

Compares host state with a canonical expected_config or a known workspace/host-bound preview_id; rejects missing or invalid baselines.

reset_profile

Clears stored profile configuration for the current host and workspace.

Canonical Schemas

Schemas are defined under schemas/ and canonical contracts under src/contracts/:

  • schemas/profile.schema.json: User-confirmed profile schema (host+workspace scoped, single/multi modes, tier mapping, abstract effort policies).

  • schemas/host-capabilities.schema.json: Host capability evidence schema (models inventory, discrete effort values, concurrency, subagents/threads).

  • schemas/execution-config.schema.json: Resolved execution configuration schema (topology, controller/worker models and resolved discrete effort values).

  • schemas/preview.schema.json: Canonical configuration preview schema (preview_id, preview_hash, diff, expires_at, target, baseline_hash).

  • schemas/apply.schema.json: Canonical apply mutation result schema (preview_id, applied_targets, target, baseline_hash, message).

  • schemas/validation.schema.json: Canonical post-apply host validation schema (valid, workspace, message, details).

  • schemas/companion-contract.schema.json: Canonical companion MCP contract specification covering protocol version 1, all 8 tools, request/response schemas, and error format.

Harness Support Matrix

Harness

Tier

Scope

Configuration Path

MCP Registration

Codex CLI

Native

Project / User

.codex/config.toml (or $CODEX_HOME/config.toml)

.codex/config.toml ([mcp_servers.agent-config])

Claude Code

Native

Project / User

.mcp.json / ~/.claude.json

.mcp.json (project) / ~/.claude.json (user)

Antigravity / agy

Native

Project / User

.gemini/config.json

.gemini/config.json

DeepSeek Harness (DSH)

Native

Project / User

cordis.patch.yml / $DSH_HOME/profiles/<name>/cordis.patch.yml

@deepseek-ai/dsh-mcp-client in cordis.patch.yml

OpenCode

Native

Project / User

opencode.json / opencode.jsonc

opencode.json / opencode.jsonc

ZCode

Native

Project / User

<workspace>/.zcode/config.json / ~/.zcode/cli/config.json

.zcode/config.json (mcp.servers["agent-config"])

Cursor

Native

Project / User

.cursor/settings.json

.cursor/mcp.json

Grok Build

Native

Project / User

.grok/config.toml

.grok/config.toml

Hermes

Native

User / Project

~/.hermes/config.json

~/.hermes/config.json

Pi Coding Agent

Native settings; MCP extension required

Project / User

.pi/settings.json / ~/.pi/agent/settings.json

.pi/mcp.json (project) / ~/.pi/agent/mcp.json (user)

Generic / Fallback

Fallback

Plan-only

N/A (read-only execution plan)

Manual export

Pi MCP registration requires an installed and enabled npm:pi-mcp-adapter package and a Pi restart/reload. Project settings additionally require Pi project trust. The adapter verifies model/provider pairs and model-specific thinking evidence; extension dispatch capabilities remain unknown until evidenced. See Pi adapter.

Setup CLI & Companion Health Verification

The companion provides a standalone CLI runner for safe host registration and health verification:

  • agent-config setup --check: Executes a live MCP protocol and contract probe.

    • Exit semantics: Exits with code 0 only when the Companion is healthy and ready; exits non-zero (1) if unregistered, unreachable, or unhealthy.

    • Strict state separation: Distinguishes Registered, Configured, Reachable, and Healthy (registration != reachability != health).

    • Canonical health definition: Requires syntactically valid registration, live process reachability, compatible MCP transport protocol, exact Agent Config Companion contract version match (protocol_version === 1), and all 8 canonical tools with compatible input and output schemas.

  • agent-config setup --preview: Read-only inspection generating a unified diff and mutation ownership block.

  • agent-config setup --apply --yes: Atomically applies host configuration mutations. Requires explicit approval (--yes). Full setup completion requires post-mutation health probe verification; registration mutation success alone does not mean setup completion.

Development

# Install dependencies
npm install

# Type-check
npm run check:types

# Build TypeScript to dist/
npm run build

# Run test suite
npm test

License

MIT License. See LICENSE for details.

Available Tools

8 tools
apply_configurationA

Apply a previously previewed configuration using a valid preview ID.

Inputs: preview_id (required), workspace. Returns: target, message, success, preview_id, +2 more

get_profileB

Retrieve the stored, user-confirmed Agent Config profile for the specified host and workspace.

Inputs: scope, host_id, workspace. Returns: found, message, profile

get_setup_statusC

Query setup and configuration readiness status for the current host and workspace.

Inputs: scope, host_id, workspace. Returns: scope, stale, host_id, adapter_id, +5 more

inspect_hostA

Inspect host runtime capabilities, available models, supported effort values, and execution topology.

Inputs: host_id, workspace. Returns: host_id, platform, workspace, adapter_id, +5 more

preview_configurationA

Generate a configuration preview (diff and mutation targets) before applying any changes.

Inputs: config (required), host_id, workspace. Returns: diff, target, expires_at, preview_id, +3 more

reset_profileA

Safely clear and remove the host-scoped profile for the specified workspace.

Inputs: scope, host_id, workspace. Returns: reset, scope, cleared, host_id, +2 more

save_profileB

Atomically validate and save a user-confirmed Agent Config profile.

Inputs: profile (required), workspace. Returns: message, profile, success

validate_configurationB

Verify that actual host configuration matches expected configuration after apply.

Inputs: host_id, workspace, preview_id, expected_config. Returns: valid, details, message, workspace

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools map cleanly to distinct actions (profile CRUD vs configuration preview/apply/validate), but get_setup_status and validate_configuration both touch configuration state, which could cause minor confusion. Overall, descriptions are clear enough to guide correct selection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern with specific verbs like get, save, reset, preview, apply, validate, and inspect. The naming style is uniform and predictable.

    Tool Count5/5

    Eight tools is well-scoped for an agent configuration server. Each tool serves a clear purpose without redundancy, covering status discovery, host inspection, profile management, and configuration lifecycle actions.

    Completeness5/5

    The tool set supports the full configuration workflow: check readiness, inspect the host, retrieve/save/reset profiles, preview changes, apply changes, and validate results. No critical operations appear to be missing for the stated purpose.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      Enables management of Proxmox VE infrastructure via its REST API and execution of commands inside LXC containers via SSH, with built-in trust layers for planning, audit, undo, and diagnosis.
      6
      443 PyPI
      93
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables secure SSH-based operations on Oracle Linux 8+ hosts through a curated, YAML-defined capability catalog, with typed parameters, two-phase confirmations for mutations, and full audit logging.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to list hosts, run commands, and orchestrate fleet automation over SSH, with per-host opt-in and approval-gated actions while keeping credentials secure.
      4
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables runtime registration and live updating of MCP tools through a NETCONF/YANG-inspired candidate/running datastore, with schema sanitization, rollback, audit logging, and drift detection.
      -