Use the MCP server

The Unyform MCP server lets your coding agent โ€” Claude Code, Codex, or any MCP client โ€” pull blueprints, conventions, and policy decisions straight from your org while it works. Where the gateway injects context automatically on every model request, the MCP server gives the agent tools it can call on demand: "search the blueprints," "validate this file," "is this action allowed?"

Note

This is distinct from the gateway's own managed tools (the _gw_* family). Those are injected into model requests by the gateway and never surface to you. The MCP server is a standalone process you register with your editor and its tools (search_blueprints, check_policy, โ€ฆ) appear in your agent's tool list.

What it gives you

The server exposes 12 tools in four groups, each backed by the Unyform API:

  • Blueprints โ€” search_blueprints, get_blueprint, get_conventions
  • Policy โ€” check_policy, validate_output, get_policies
  • Steering โ€” request_approval, report_action, get_guidance
  • Context โ€” get_ecosystem_context, get_architecture, get_recent_decisions

Several context tools are stubs today and return a "not yet available" message โ€” see the usage tour below for what's live.

Install

The server ships as the unyform-mcp binary:

cargo install unyform-mcp-server unyform mcp status โœ“ unyform-mcp found at ~/.cargo/bin/unyform-mcp

unyform mcp status checks that the binary is on your PATH โ€” your MCP client launches it by name.

Register it

The server speaks stdio by default (JSON-RPC over stdin/stdout), which is what every MCP client expects. Pass your org with --org-id.

Register the server with the Claude Code CLI:

claude mcp add unyform -- unyform-mcp --org-id <org-id>

Or add it to your project's .claude/settings.json directly:

{
  "mcpServers": {
    "unyform": {
      "command": "unyform-mcp",
      "args": ["--org-id", "<org-id>"]
    }
  }
}

For Codex, add to codex.toml:

[mcp_servers.unyform]
command = "unyform-mcp"
args = ["--org-id", "<org-id>"]

Tip

Run unyform mcp config in a project that has a .unyform/config.yml and it prints these exact blocks pre-filled with your org id, detecting whichever agents it finds.

Configure

The server resolves three things from flags, environment, or project config โ€” in that order:

SettingFlagEnvironmentFalls back to
Org--org-idUNYFORM_ORG_IDorg_id in .unyform/config.yml
API URL--api-urlUNYFORM_API_URLhttps://api.unyform.ai
Authโ€”UNYFORM_API_KEY~/.unyform/credentials.json

Authenticate once with unyform login to write the credentials file, or set UNYFORM_API_KEY in the environment your client launches the server in. The key is sent as a bearer token; the server never embeds it in the config you paste into your editor.

Warning

If you launch without --org-id and there's no .unyform/config.yml to walk up to, the server exits with an error. Either pass the flag or run unyform init in the project first.

Usage tour

Once registered, ask your agent to use the tools by name or by intent. A few that are live end to end:

  • search_blueprints โ€” "What blueprints cover error handling?" Returns the blueprints (id, name, description) whose name or description matches your query, scoped to your org.
  • get_blueprint โ€” "Show me the naming section of blueprint <id>." Fetches the full blueprint by id, or just one named section when you pass it.
  • get_conventions โ€” "What are our conventions for this file?" Returns your org's conventions compiled to markdown โ€” naming, structure, testing, style.
  • check_policy โ€” "Can I add this dependency?" Submits an action and content and returns an ALLOW / BLOCK decision with the reason and the policy names that matched.
  • validate_output โ€” "Does this file pass?" Validates a file_path + content against your blueprints and policies, returning pass/fail with each violation's rule, message, severity, and suggestion.

The blueprints these tools read come from your repo analysis โ€” see Codegraph for how that graph is built and what the blueprints capture.

Tip

Add --debug to the args to log every tool call to stderr (stdout stays reserved for the MCP protocol) when you're troubleshooting a registration.

Edit this page on GitHub