Skip to main content
Glama
CapNexus

ao-config-mcp

by CapNexus
README.md
# ao-config-mcp

MCP server for Aptos ONE configuration management. Provides tools for schema intelligence, change set management, distribution workflows, and cross-environment comparison.

## Tools

### Session Management
- `set_domain` — Set active AO domain for the session
- `get_domain` — Get current active domain

### Schema Intelligence (local, no auth)
- `search_blocks` — Fuzzy search block definitions from scp-schema-configuration
- `explain_config` — Look up a property in schemas + grep TS consumer repos for usage
- `sync_schema_repo` — Git pull scp-schema-configuration (for teammates with repo access)

### Block Operations
- `block_list` — List blocks in a live environment
- `block_fetch` — Fetch a block definition from a live environment
- `block_validate_data` — Validate JSON data against a block's schema

### Settings
- `settings_fetch` — Fetch current settings from a live environment

### Change Sets
- `change_set_create` — Create changeset template from current settings
- `change_set_fetch` — Fetch existing changeset by UUID
- `change_set_list` — List changesets (filterable)
- `change_set_post` — Post changeset to environment
- `change_set_publish` — Publish a changeset
- `change_set_put` — Update existing changeset

### Distributions
- `distribution_create` — Create distribution JSON
- `distribution_fetch` — Fetch distribution by UUID
- `distribution_list` — List distributions
- `distribution_post` — Post distribution to environment
- `distribution_cancel` — Cancel pending distribution

### Migrations
- `migration_validate` — Validate migration file locally
- `migration_post` — Post migration to environment

### Comparison
- `compare_config` — Compare settings across two domains with structured diff

## Setup

```bash
npm install
```

### Tiers

The server works in two tiers depending on what's configured:

**CLI-only tier** (minimum setup — no schema repo needed):
- Change set tools (create, fetch, list, post, publish, put)
- Distribution tools (create, fetch, list, post, cancel)
- Migration tools (validate, post)
- Settings fetch
- Block list/fetch from live environments
- Compare config across environments
- Requires: `ao-config` CLI available (either globally or via the schema repo)

**Full tier** (with schema repo):
- Everything in CLI-only tier, plus:
- `search_blocks` — local schema search
- `explain_config` — property lookup in schemas + code search
- `sync_schema_repo` — keep schemas up to date
- `block_validate_data` — local JSON validation against schemas
- Requires: local clone of `scp-schema-configuration`

### Environment Variables

All optional. Configure what you have access to:

```env
# Full tier: point to your local scp-schema-configuration clone
SCHEMA_REPO_PATH=/path/to/scp-schema-configuration

# For explain_config code search (optional, enhances full tier)
CONSUMER_REPOS=/path/to/repo1,/path/to/repo2,/path/to/repo3

# Where generated changeset/distribution files go (defaults to ~/Config)
OUTPUT_DIR=~/Config

# Auto-pull schema repo on startup (for teammates with git access)
AUTO_SYNC=false

# Default domain to avoid passing it on every call
DEFAULT_DOMAIN=
```

### MCP Config (in ~/.kiro/settings/mcp.json)

```json
{
  "ao-config": {
    "command": "/path/to/ao-config-mcp/node_modules/.bin/tsx",
    "args": ["/path/to/ao-config-mcp/src/index.ts"],
    "env": {
      "SCHEMA_REPO_PATH": "/path/to/scp-schema-configuration",
      "CONSUMER_REPOS": "/path/to/repo1,/path/to/repo2",
      "OUTPUT_DIR": "~/Config",
      "AUTO_SYNC": "false",
      "DEFAULT_DOMAIN": ""
    }
  }
}
```

## Auth

The `ao-config` CLI handles authentication via Keycloak browser login. First run requires a browser-based login, after which tokens are cached and subsequent calls are non-interactive.

## For Teammates with scp-schema-configuration Access

Set `AUTO_SYNC=true` to automatically pull latest schemas on server startup, or use the `sync_schema_repo` tool on-demand.