Skip to content

Add a kizen mcp-servers command group - #100

Merged
2 commits merged into
mainfrom
feat/mcp-servers-command-group
Oct 27, 2026
Merged

2 commits merged into
mainfrom
feat/mcp-servers-command-group

Conversation

@jbedient-kizen

@jbedient-kizen jbedient-kizen commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An MCP server is the set of Kizen tools a Call LLM step or an outside MCP client can call. Builds had no way to make or change one from the CLI, so wiring tools into an automation meant clicking through Settings.

Solution

A new kizen mcp-servers group: list, get <server>, tools (the catalogue), history <server>, and spec-driven create, update <server> and delete <server>, with --dry-run, saved plans and kizen apply. A spec sets name, api_name, description, tool_names, is_enabled, is_default_for_business and sharing_settings. It follows the dashboards surface, one op per server.

Tool names are checked against the live catalogue at plan time, because Kizen rejects the whole request for one unknown tool. Tools compare as a set and sharing compares after normalising both sides, so get --raw output sent back unchanged plans a skip. The plan refuses what Kizen would accept and then drop or ignore silently: an api_name change (a 400) and a service_accounts sharing bucket (a 200, then dropped). Kizen-managed servers are refused, except for setting one back as the business default. Kizen keeps one default per business, so the preview names the server that loses it and how to restore it. kizen docs show mcp-server documents the spec.

Testing

Local checks after merging main: lint, format, typecheck, pytest (2881 passed, 4 skipped, 1 xfailed) and the CLI-tree diff, passed: lint format typecheck test extra_checks.

Live on a test tenant, on two scratch servers: create; get --raw → update (skip); reordered tools (skip); tools, disable and sharing changes applied and read back; the refusals for an unknown tool (no POST), an api_name change, a managed-server update and delete, and a service_accounts bucket; history; delete through a saved plan and kizen apply. Server count and the business default were the same before and after. The MCP drift contracts pass; the drift schema test still fails, but only on diffs from the 2026-10-26 release that also fail on main. The round-trip drift tier wasn't run.

Design notes / tradeoffs

Rejected: wrapping POST /api/mcp/{config_slug}, the JSON-RPC endpoint. That's what MCP clients call at run time, not configuration; get prints the server's endpoint_url for wiring one up.

Overlaps: #101 (the service-accounts command group) adds a second command group and touches the same shared files: the CLI command registry (cli/__init__.py), the docs lists (commands.md, reference.md, specs/README.md), scripts/cli-tree-baseline.txt, tests/drift/contracts.py, tests/drift/schema_snapshot.json, tools/plans.py, CONTRIBUTING.md and CHANGELOG.md. Whichever merges second should need a small conflict fix. #96 (the loops fix) also changes the CLI-tree baseline. The merge from main also refreshes that baseline for #92's new kizen upgrade --check help text, which main's baseline lacks; every PR in this set carries that same line.

An MCP server is the set of Kizen tools a Call LLM step or an outside
MCP client can call, and builds had no way to make or change one from
the CLI. The new group lists, creates, updates and deletes servers from
a spec, and shows a server's tools and change history.

Tool names are checked against the live catalogue, because Kizen
rejects the whole request for one unknown tool. Tools compare as a set
and sharing compares after normalising both sides, so get --raw output
sent back unchanged plans a skip. Kizen-managed servers are refused,
except for setting one back as the business default. Kizen keeps one
default per business, so the preview names the server that loses it and
how to restore it.
@jbedient-kizen

Copy link
Copy Markdown
Contributor Author

Included in the 0.4.0 release PR #102; merge that instead.

@sangyeT sangyeT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the api module, MCPServerDef/sharing models, the read tools and the planner (tool names checked against the live catalogue before any request, system-managed servers refused except the default-flag takeover, get --raw accepted as a spec with read-only keys dropped and listed, set-wise compare so a re-sent raw plans a skip). Dispatch in plans.py and the drift contracts are updated. Approving.

@jbedient-kizen jbedient-kizen closed this pull request by merging all changes into main in 39beea1 Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants