A Model Context Protocol server that gives an AI agent the whole Kamiwaza platform through a tool surface whose size never changes.
The pinned platform client exposes 439 callable operations and grows every release. Publishing one tool per operation would spend thousands of tokens of every agent's context before it did any work, and tool-selection accuracy falls as the list grows. This server publishes 21 tools — four discovery tools plus 17 workflow tools — holds the operation index server-side, and reaches the other 405 published operations by search.
Any standards-conformant host can connect. There is no Kamiwaza SDK to install on the client, no custom transport, no private header, and no bespoke handshake.
One process serves two revisions, and each is a separate claim. A statement proved for one revision is not a statement about the other: the two arms negotiate differently, so a conformance result for either has to be read as that revision's result alone.
Both are in SERVED_REVISIONS (src/kamiwaza_mcp/protocol/revisions.py), and SERVED_MODERN_REVISIONS is the modern subset server/discover advertises. Any other revision is refused on every method by revision_gate (src/kamiwaza_mcp/protocol/refusals.py), and the refusal names this server's served set rather than every revision the library can speak. An import-time check in revisions.py fails the process if the served set is not one revision from each era, so the two arms cannot silently become one.
Conformance is asserted per revision, not once for both: tests/conformance/test_dual_revision.py drives both arms of a single application, tests/conformance/test_capabilities.py probes each advertised capability per revision against the method that implements it, and tests/conformance/test_revision_refusals.py asserts the refusal for everything else.
The topologies differ in exactly one thing — who established the caller. Both then build the same protocol server from the same factory (server/app.py build_server), which is what makes the published surface identical.
Hosted, behind the platform edge (transport/http.py hosted_deployment): the edge authenticates the member and forwards the context, so this server terminates no public edge and holds no edge certificate.
from kamiwaza_mcp.transport.http import hosted_deployment, serve_http app = serve_http( hosted_deployment(platform_base_url="https://kamiwaza.example.com/api"), host="0.0.0.0", port=8080, ) Which infrastructure installed it is not this server's business. The same image runs under the platform operator, under the legacy deploy infrastructure, and under plain Compose, because the hosted topology depends on the forwarded-envelope contract and not on what produced it: the member, the workroom and the caller's token, parsed by kamiwaza_extensions_lib.identity.extract_identity — the platform's own parser, shared with every other extension — rather than by header names invented here (FR-034, tests/conformance/test_implementation_neutrality.py).
The one place the two planes genuinely disagree is the tenant. The platform's signed ForwardAuth payload carries no tenant header at all, while the platform's own services do send x-tenant-id. So the tenant is read from the forwarded credential's claims, which the authorization server signed, and x-tenant-id is only a fallback for a deployment whose tokens carry no tenant claim — a request with neither is refused, because its isolation scope is unknown.
Measured against one live cluster, all three ways: through the operator's edge with the extension installed, through Compose with the header-less envelope, and in-process with and without x-tenant-id (tests/integration/test_hosted_live.py). The published listing is byte-identical to the standalone one in every case.
Standalone, as its own protected resource (transport/http.py standalone_deployment): no edge sits in front, so this server validates the bearer credential itself. The credential verifier is required with no default, because a standalone deployment that admitted callers without verifying them would be an open endpoint.
from kamiwaza_mcp.authority.resource_server import ( PlatformCredentialVerifier, ProtectedResource, ) from kamiwaza_mcp.transport.http import serve_http, standalone_deployment resource = ProtectedResource( resource="https://mcp.kamiwaza.example.com/mcp", authorization_servers=("https://auth.kamiwaza.example.com",), scopes_supported=("kamiwaza.read",), resource_name="Kamiwaza platform", ) app = serve_http( standalone_deployment( PlatformCredentialVerifier( resource=resource, issuer="https://auth.kamiwaza.example.com", resolve_signing_key=fetch_signing_key, # your key-set lookup tenant_claim="tenant", # required, never guessed ), platform_base_url="https://kamiwaza.example.com/api", resource=resource, ), host="0.0.0.0", port=8080, ) A host-launched local process (cli.py, over transport/stdio.py): standalone, never hosted. A pipe carries no per-request credential, so the member is established once — by asking the cluster whose credential the process was started with — and every call runs as that member. LocalCredentialAdmission refuses a second identity rather than serving it under the first, and refuses to run with no credential at all.
Installing the package leaves a command behind, which is what a host's launch configuration names:
kz-ext login https://kamiwaza.example.com/api # once; stores a connection kamiwaza-mcp # stdio, the default kamiwaza-mcp --connection staging # a stored connection other than the active one kamiwaza-mcp --transport http --port 8080 # a loopback listener instead With neither KAMIWAZA_API_URL nor KAMIWAZA_MCP_CREDENTIAL in the environment, the process serves the connection kz-ext login made active, read through the descriptor package's own connection store. --connection NAME serves that stored connection and overrides both variables. Otherwise, setting both variables serves exactly what they name, which is what a host without a kz-ext sign-in does:
export KAMIWAZA_API_URL=https://kamiwaza.example.com/api export KAMIWAZA_MCP_CREDENTIAL=' ' kamiwaza-mcp Setting only one of the two, or setting either to an empty value, is refused rather than completed from a stored connection, because one cluster's address with another's credential is the mistake that refusal exists to stop. Nothing is defaulted: a default cluster address would be one cluster's address in every other deployment, and this server has no identity of its own to fall back on. Certificate verification stays on regardless of a stored connection's verify_ssl setting; trust a private CA with REQUESTS_CA_BUNDLE and SSL_CERT_FILE. The credential is never read from an argument, because a credential in argv is readable by every process on the machine. Who the process serves is not configuration either — the credential is presented to the platform's own auth/users/me at startup, so a stale credential fails immediately instead of misattributing calls to a member somebody typed.
Hosted plus stdio is refused when the deployment is constructed (Deployment.__post_init__): there is no edge in front of a process reading standard input, so a forwarded context arriving there would be one nothing produced.
--transport http is the local listener of FR-032e: it binds 127.0.0.1 only, switches on the origin check the library leaves off by default (transport/local_guard.py), and still requires a credential per request. Measured against a live cluster: a request from an unrecognised origin is refused with 403 and one carrying no credential with 401.
Two, and only two — the Transport enum in authority/admission.py has no third member:
The deprecated HTTP-with-SSE transport is not served. It is deprecated in both targeted revisions, so it is neither the default nor a way to reach anything: nothing mounts it, and the only HTTP application this repository builds is the Streamable HTTP one.
Standalone challenges, per RFC 6750 §3.1 (server/metadata.py, authority/resource_server.py):
The 401/403 split is load-bearing rather than cosmetic: a host retries a 401 by authorizing, and a 403 by authorizing for more. A 401 for insufficient scope would send it round the same flow to arrive at the same refusal.
The discovery path is built by metadata_path, which inserts the well-known segment before the resource's own path, so a host asking about /mcp is answered about /mcp.
No caller credential is forwarded onward, and this server holds no workload identity of its own: inbound it validates a platform credential, outbound it uses the caller's own authority. It refuses rather than escalating.
io.modelcontextprotocol/tasks — optional, and advertised only when it is registered. The library derives capabilities.extensions from the extensions the server was constructed with (server/app.py passes deployment.extensions through), so the capability map cannot claim an extension whose methods are unreachable. Its three methods are bound only at the modern revision.
A client that did not declare the extension and calls a task method is refused with the specification's -32021 and a requiredCapabilities payload naming what to declare (protocol/tasks.py, via the library's require_client_extension). A host that never negotiates it is not locked out of slow work: a workflow call gets a wait bounded at 45 seconds (workflows/wait.py) and an expired_wait outcome carrying the identifier of whatever already exists, so the correct response is to resume rather than to start a second one. call_operation has no wait budget of its own at this version (surface/call_operation.py), so a slow single operation is bounded by the host's own patience and not by this server.
A task handle is a sealed reference to the platform's own record, not a row in this server's memory, so it survives a disconnect and a restart.
docs answers six topics — overview (the default), entitlement, slow-work, failures, shapes, withheld (surface/docs.py).
Seventeen, always published, from the pinned descriptor package (workflows/publish.py published_workflows; descriptions are asserted against the package's own docstrings by tests/conformance/test_description_provenance.py):
Each names at most one polling step, bundles at most one approval-bearing step, and states whether it is idempotent. Sixteen of the seventeen declare an approval step — every one but diagnose_deployment, counted from the pinned descriptors — and each of those names the change a member is consenting to. Single destructive acts are deliberately not wrapped: deleting something, rotating a credential, or uninstalling a package stays one explicit call.
Entitlement is never marked at discovery: the platform authorizes by relation on an object, and discovery has no object. Two callers receive byte-identical listing, search and shape answers (tests/conformance/test_listing_invariance.py). There is no persona — not as a parameter, not as a tool set, not as a deployment (tests/conformance/test_persona_neutrality.py).
One posture changes the listing, and no request can reach it: the deployment's own read-only posture. Deployment.read_only withholds every write and every credential-returning read, taking the published set from 21 tools to 5.
The posture is set by the deployment's own KAMIWAZA_MCP_READ_ONLY — declared in docker-compose.yml and defaulted off in kamiwaza.json, so an install that says nothing serves the full surface. With it on, a withheld operation is absent from find_operations, reported as unknown by describe_operation, refused by call_operation even when a caller guesses its identifier, and the workflows that change something are not published at all. A value that is neither on nor off stops the container at startup rather than being read as off.
A gated act is answered by asking, and the question is the caller's own "do you want to run this?" rather than a second person's approval. It goes out by whichever mechanism the connection's revision defines, and it is the same question either way:
A client that declared no elicitation is refused rather than served unasked: "the host could not be asked" is not a reason to proceed. A client that did declare it but connected without a channel back gets a refusal naming the channel, because it has already done what a capability refusal would ask of it. FR-037c records the third carriage — URL mode elicitation, for a client that can render no prompt at all — as deferred.
A read-only deployment withholds every gated act along with the writes: an approval marks a privileged result (FR-020), so those acts are absent from discovery and refused on call.
Thirty-four of the 439 callable operations are withheld, each with a stated reason. A withheld identifier is refused by name and reason rather than reported as unknown, because "unknown" invites another guess (tests/conformance/test_unpublished_set.py).
Asserted, not estimated — tests/contract/test_listing_budget.py measures the published surface with cl100k_base:
The workflow half got 1,632 tokens cheaper by declaring one thing once: all 17 return the same result envelope, and each was publishing an identical 96-token outputSchema to say so. The shape is published once as a resource now (kamiwaza://shapes/workflow-result), where resources/read is a separate call and a host that never validates never pays for it. The four discovery tools still declare their own, because theirs differ — for comparison, Neon publishes none across 113 tools and GitHub none across 45.
A host that wants the whole catalog anyway — one running its own code mode — asks for it deliberately on GET /mcp?codemode=false, narrowable by category and q, and the answer states its own measured token cost (server/catalog.py). It is never the default, and it is behind the same admission as everything else.
detail decides how much of each entry comes back, which is a different question from which entries come back:
Five failure kinds, each with a distinct next step, produced in one place (envelope/outcomes.py). Two kinds sharing a next step fails at import, because two kinds an agent cannot tell apart are one kind.
Every tool carries the protocol's advisory annotations — readOnlyHint, destructiveHint, idempotentHint, openWorldHint — derived from the operation's own effect rather than from an HTTP verb. Hints are advisory; enforcement is server-side, and a host that ignores every hint is still refused.
The knowledge resource kamiwaza://docs/using-this-surface carries the same six topics as one Markdown document, assembled by surface/docs.py as_document and committed at docs/using-this-surface.md in the repository. tests/contract/test_resources.py asserts the committed copy matches what the server serves, and its failure message carries the regeneration command. Tool descriptions state only what a tool does and returns, so behavioural rules live in exactly one place.
The prompt primitive is served and empty. Served, because an unserved method reads to a host as a gap in the server; empty, because prompts would become a second home for behavioural policy. No completion capability is advertised, since completion completes the arguments of a prompt or a resource template and this server publishes neither.
Shutdown drains in-flight work before terminating. One replica is fully functional alone, and a second needs no leader election, sticky routing or inter-instance messaging: the transport is stateless and task state is the platform's.
Blocking SDK calls, workflows, and task-status reads run in worker threads, so an in-flight platform request does not prevent /healthz from responding. The SDK exposes no per-call timeout; shutting down still waits for accepted work.
pip install kamiwaza-mcp # or run it directly: uvx kamiwaza-mcp kamiwaza-sdk is pinned exactly, because this server's whole surface is derived from its kamiwaza_sdk.agent_tools layer; both it and kamiwaza-extensions-lib resolve from PyPI. tests/contract/test_exact_pin.py fails if the pin becomes a range or the lock resolves the descriptor package from anywhere but the index.
Two standalone packages are built and checked on every change:
.github/workflows/release-packages.yml publishes both, with trusted publishing, for a vX.Y.Z tag on main once scripts/check_publishable.py passes and the PUBLISH_PACKAGES repository variable is true. CI runs the same check on every change, so a dependency that only resolves from a private source fails the change that adds it rather than the release. The repository is internal, and npm does not generate provenance for a package published from a non-public repository.
The same server runs as a platform extension, built to the platform's own kz-ext contract rather than a packaging scheme invented here: kamiwaza.json (type tool), docker-compose.yml, and a Dockerfile that builds non-root and runs with a read-only root filesystem. kz-ext validate passes.
kz-ext dev writes local deployment state under .kz-ext/. That directory is excluded from Git and the Docker build context. The image build installs every dependency from the lockfile with hashes, from the public index, so it needs no credential.
kz-ext validate # the platform's own three validators kz-ext dev # build, push, install into a cluster kz-ext status # the installed instance and its phase The extension is the same server: its entry point, python -m kamiwaza_mcp, goes through the one application factory and selects the hosted topology, because an extension runs behind the platform's edge and receives exactly the forwarded context that topology reads. The install asks for nothing. It prefers KAMIWAZA_API_URL; otherwise it derives the API root from platform-injected KAMIWAZA_INTERNAL_ORIGIN, KAMIWAZA_PUBLIC_API_URL, KAMIWAZA_ORIGIN, or the origin of KAMIWAZA_APP_URL. It uses KAMIWAZA_PLATFORM_GATEWAY_URL only as the last fallback because an internal gateway hostname might not match the platform certificate. No hostname, port, container engine, or registry address is compiled into this choice. An extension given no platform fact fails its rollout rather than starting against the wrong cluster.
Each was measured against a live cluster, and each is a place where the kz-ext tool template disagrees with what the platform accepts or with what this server can serve.
The transport. The template's src/server.py imports mcp.server.fastmcp.FastMCP and runs transport="sse". FastMCP does not exist in the protocol library this server pins, and HTTP-with-SSE is deprecated in both revisions it serves. The extension serves Streamable HTTP at /mcp.
The probe. Following from that, the platform's payload builder gives a primary tool an httpGet probe on /sse — an endpoint this server does not have, so the pod would never report ready. The descriptor package documents the escape hatch for exactly this case, and kamiwaza.json uses it: a services.tool.healthCheck override probing /healthz.
The verification switch. The template declares KAMIWAZA_VERIFY_SSL. With it present the platform refuses the install outright — "egress verification is not weakenable by tenant intent, extension artifact content, a model requester, a carried pod template, or workload environment". The platform is right, and the variable is absent here: whether egress certificates are verified is the platform's decision, not a value an extension carries.
Use the container engine and registry selected by local kz-ext configuration; this repository does not require a specific engine, registry implementation, hostname, or port.
The target may require immutable image references. kz-ext dev must resolve those references through its configured build and registry workflow. If the installed SDK sends tag-only images or fields the target rejects, stop and use a compatible SDK instead of hand-authoring a deployment payload.
The platform merges a re-installed extension's service environment rather than replacing it, so a payload corrected after a failed install can still carry the field that failed. Delete the extension and install again rather than reinstalling over it.
Three ways to reach the same tool surface, and the configuration each takes. The key name differs between clients — mcpServers here is the spelling Claude Desktop, Cursor and VS Code use; claude mcp add and Codex write the same fields under their own key.
Standalone over stdio, where the client launches the process. Nothing listens on a port, and with a kz-ext login sign-in the client configuration holds no credential and no cluster address at all:
{ "mcpServers": { "kamiwaza": { "command": "uvx", "args": ["kamiwaza-mcp==0.2.1"] } } } Add "--connection", "NAME" to args to pin a stored connection other than the active one. Without a sign-in, put KAMIWAZA_API_URL and KAMIWAZA_MCP_CREDENTIAL in the entry's env; the credential is read from the environment and never from argv, where every process on the machine could read it.
Standalone over HTTP, for a client that attaches to a running server. Start it with kamiwaza-mcp --transport http --port 8080; it binds loopback only:
{ "mcpServers": { "kamiwaza": { "type": "http", "url": "http://127.0.0.1:8080/mcp", "headers": { "Authorization": "Bearer " } } } } A client that implements RFC 9728 needs no headers block: it reads /.well-known/oauth-protected-resource/mcp, which this server publishes unauthenticated, and authorizes from there. A client that does not gets a 401 carrying the same pointer in WWW-Authenticate.
As a Kamiwaza extension, where the server runs in the cluster behind the platform edge and the client is remote. The URL is the platform host, the runtime prefix, and the instance name kz-ext status reports:
One thing a client can trip over in every mode. The two revisions served are 2026-07-28, declared per request in MCP-Protocol-Version, and 2025-11-25, negotiated once in initialize — so a client that opens with initialize is answered about the second alone. Measured against a running server, a client pinned to 2025-06-18 gets:
{"code": -32022, "message": "Unsupported protocol version", "data": {"supported": ["2025-11-25"], "requested": "2025-06-18"}} 2026-07-28 is absent from that list because it is not negotiated there, not because it is unavailable: the same server answers tools/list with all 21 tools over that revision, given the header and the _meta envelope it requires. Either way the refusal is explicit rather than a silent downgrade.
uv sync # install, including dev dependencies .venv/bin/python -m pytest # unit, contract, integration, conformance .venv/bin/python -m pytest -m conformance # one marker at a time .venv/bin/python -m ruff check . .venv/bin/python -m mypy .venv/bin/python -m uat.runner # the declared acceptance criteria .venv/bin/python -m uat.selfcheck # verify the harness itself The four pytest markers are unit, contract, integration and conformance (pyproject.toml). uat.runner takes --area, --criterion and --json; a declared criterion with no registered case reports NOT_EXERCISED rather than being skipped, so missing coverage is visible in the report instead of absent from it.
This repository is developed with spec-kit, and the specification is the source of truth:
Changes to behaviour start in the specification, not in the code. See AGENTS.md in the repository for the working rules.
Report a suspected vulnerability privately to the Kamiwaza security contact rather than in a public issue.
The source code and the Python and npm packages are licensed under the Apache License 2.0. See the LICENSE and NOTICE files, which ship in every package. The container image is distributed under the Kamiwaza EULA and carries its third-party notices under /licenses.
Both files in this release have provenance metadata.
mcp model-context-protocol kamiwaza ai-agents
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 20, 2026 2 release files Full provenance
Nov 17, 2026 2 release files Full provenance




