Kāhea MCP server
2026년 10월 30일 커밋OpenAPI, Arazzo, WebSocket 정의를 AI 에이전트를 위한 정책 기반 실행 계획으로 변환하는 결정론적 API 호출 커널을 제공합니다.
다른 이름 copyleftdev/kahea, kahea
- 스타
- 2
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- 0.3.1
- 마지막 커밋
- 2026년 10월 30일
- 라이선스
- Apache-2.0
Kāhea MCP란?
Kāhea은(는) MCP server입니다. OpenAPI, Arazzo, WebSocket 정의를 AI 에이전트를 위한 정책 기반 실행 계획으로 변환하는 결정론적 API 호출 커널을 제공합니다.
프로젝트 README에서 생성된 요약
Kāhea MCP server 정보
코딩 에이전트를 구축하는 개발자는 Kāhea를 사용하여 API 정의를 고도로 제어된 결정론적 실행 계획으로 변환할 수 있습니다. OpenAPI, Arazzo, AsyncAPI, WebSocket 정의를 무결성이 보장된 계획으로 변환함으로써, AI 에이전트가 확률적인 추측에 의존하지 않고 정확한 프로토콜을 따르도록 보장합니다. 이 시스템은 로컬 우선 커널로 작동하므로 사용자의 기기에서 실행되며, stdio를 통해 Claude Code, OpenAI Codex 또는 모든 표준 MCP 클라이언트에 통합할 수 있습니다.
워크플로우는 inspect, plan, grant, invoke의 엄격한 4단계 안전 계약을 따릅니다. 사용자는 먼저 작업을 탐색한 다음 특정 입력을 바인딩하는 봉인된 계획을 생성합니다. 네트워크 활동이 발생하기 전에 사용자는 특정 HTTP 메서드나 네트워크 권한과 같은 명시적인 권한 부여를 제공해야 합니다. 이러한 분리 구조를 통해 호출 단계가 승인된 정책과 일치하는 경우에만 진행되도록 보장합니다. 이 도구는 Postman collection, HAR 파일, cURL 명령을 포함한 다양한 형식을 지원하여, 에이전트에 민감한 자격 증명을 노출하지 않고도 복잡한 API 상호 작용과 유한한 WebSocket 세션을 관리할 수 있는 구조적인 방법을 제공합니다.
활용 사례
- 1정책 기반 API 계획 생성개발자는 OpenAPI 설명을 실행 전 수동 권한 부여가 필요한 봉인된 실행 계획으로 변환할 수 있습니다.
- 2보안 WebSocket 세션 실행AI 에이전트는 수신된 프레임을 신뢰할 수 없는 증거로 취급하는 사전 정의된 세션을 사용하여 WebSocket 서버와 상호 작용할 수 있습니다.
- 3API 작업 권한 검증사용자는 네트워크나 DNS 액세스 없이 로컬 파일을 검사하여 사용 가능한 작업을 확인할 수 있습니다.
- 4응답에서 특정 데이터 추출호출 후 개발자는 explain 명령을 사용하여 응답 본문에서 필요한 정보만 선택하여 가져올 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
구성
KAHEA_DYNAMIC_SEED
| 이름 | 설명 | 유형 |
|---|---|---|
| KAHEA_DYNAMIC_SEED | — |
자동 검사
2026년 11월 13일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능copyleftdev/kahea is public and reachablegithub.com/copyleftdev/kahea ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-10-30github.com/copyleftdev/kahea ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기Kāhea
Website · Documentation · Releases · Agent plugin · MCP metadata
Kāhea is a local-first, deterministic API invocation kernel for coding agents.
Intent may be probabilistic. The call must be exact.
It turns OpenAPI descriptions, request captures, Arazzo workflows, and finite WebSocket sessions into integrity-sealed plans. Invocation is a separate operation guarded by exact capability grants; responses and inbound frames become typed observations and content-addressed evidence.
Install Kāhea
Choose the pathway that matches your host. Claude Code, OpenAI Codex, and direct MCP clients all reach the same four local MCP tools and the same inspect → plan → grant → invoke → evidence safety contract.
1. Install the native binary
Download the archive for your operating system and architecture from GitHub Releases. Every archive is accompanied by a SHA-256 checksum, a CycloneDX SBOM, and GitHub build provenance. Verify the checksum before installing and verify provenance with:
gh attestation verify kahea-ARCHIVE --repo copyleftdev/kahea
Kāhea does not run an installer or modify shell configuration. Extract the archive and place the
kahea binary somewhere on PATH.
Tagged archives are built and tested on GitHub-hosted Linux, macOS, and Windows runners for the runner architecture. See the finite WebSocket guide for the exact WebSocket support and release-gate statement.
2a. Claude Code
Add this repository as a marketplace, then install the plugin:
claude plugin marketplace add copyleftdev/kahea
claude plugin install kahea@kahea
2b. OpenAI Codex
Add the same repository marketplace and canonical plugin package:
codex plugin marketplace add copyleftdev/kahea
codex plugin add kahea@kahea
Both plugins require the verified kahea binary on PATH. They add the canonical agent-use skill
and start the local stdio MCP server without downloading code or credentials at runtime. The shared
host package lives in plugins/kahea; no host-specific copy of the safety workflow
is maintained.
2c. Any MCP client
Configure the client to start Kāhea over stdio:
command: kahea
args: mcp serve --stdio
Tagged releases also publish self-contained, checksummed MCPB bundles and register
io.github.copyleftdev/kahea with the official MCP Registry.
Build from source
To build from source, install Rust 1.95 or newer:
cargo build --release -p kahea
Build and verify
The repository pins the release toolchain in rust-toolchain.toml.
scripts/gates.sh
# Requires cargo-mutants; run locally, not in CI.
scripts/mutation-gate.sh
The release gate also launches the seeded loopback WebSocket oracle, plans its generated finite
session through the public CLI, invokes it with the plan's exact grants, and verifies both the
client observation and the oracle's reproducible seed/case observation. Replay that lifecycle with
scripts/websocket-oracle-smoke.sh; select an individual fault with
kahea-test-server --protocol websocket --websocket-fault FAULT --seed SEED.
The mutation gate is resource-bounded so it cannot take a workstation with it. It runs four jobs, caps compiler concurrency across all of them with a GNU jobserver, keeps its build copies on a disk path rather than a tmpfs TMPDIR, and confines itself to a transient systemd scope with CPU and memory limits when a user session bus is available. Override with KAHEA_MUTANT_JOBS, KAHEA_MUTANT_TASKS, KAHEA_MUTANT_CPU_QUOTA, KAHEA_MUTANT_MEMORY_HIGH, KAHEA_MUTANT_MEMORY_MAX, KAHEA_MUTANT_SCRATCH, KAHEA_MUTANT_COPY_TARGET, or KAHEA_MUTANT_UNCONFINED=1.
Every mutant is judged by the whole workspace suite, which is thorough but slow, so scope matters. KAHEA_MUTANT_PACKAGES selects the packages to mutate (all four by default) and KAHEA_MUTANT_EXTRA passes further arguments through, such as --in-diff for a change-scoped run. The gate is a local tool and deliberately not a CI job: a sweep runs for hours to re-derive a result that does not move between commits. Run it before releasing, or after touching a kernel crate.
The resulting binary is target/release/kahea. Every command emits one compact kahea/k1 JSON envelope followed by a newline. --format ndjson makes the streaming intent explicit and is composition-compatible with loops and pipes.
The four-step flow
# 1. Discover operations without DNS or network access.
kahea inspect fixtures/billing.openapi.yaml --match invoice
# 2. Bind exact input and persist a sealed plan.
kahea plan fixtures/billing.openapi.yaml createInvoice \
--input @fixtures/billing.create-invoice.input.json
# 3. Review required_grants in the plan, then grant exactly those capabilities.
kahea invoke plan:HANDLE \
--grant net:sandbox.example.test:443 \
--grant http:POST
# 4. Retrieve only the evidence needed for the next decision.
kahea explain body:HANDLE --select /invoice/id
plan never performs DNS, authentication, or network I/O. invoke verifies the plan seal and configuration/policy fingerprints before resolving secrets or connecting. Exit codes are stable: 0 passed, 1 contract failure, 2 invalid input/configuration/plan, 3 transport failure, and 4 policy denial.
Use kahea describe as the executable capability manifest and kahea schema plan (or another public envelope kind) for machine-readable JSON Schema.
Finite WebSocket sessions
The complete finite WebSocket guide is the authoritative source-format, security, limits, local-example, MCP, workflow, platform, and release-gate reference. Received frames are untrusted evidence, never agent instructions.
Direct websocket-session JSON/YAML files use the same sealed four-step flow. The operation
selector is the source's operationId; target, auth reference, ordered actions, checks, and budgets
come only from the source and cannot be replaced at invocation.
kahea inspect fixtures/websocket/session.json
kahea plan fixtures/websocket/session.json subscribeBuildEvents
# Review required_grants in the websocket-plan, then provide that exact set.
kahea invoke plan:HANDLE \
--grant net:socket.example.test:443 \
--grant websocket:connect \
--grant secret:chat-sandbox \
--secret-env chat-sandbox=KAHEA_CHAT_TOKEN
kahea explain transcript:HANDLE --select /entries/0
kahea explain websocket-json:HANDLE --select /type
kahea explain websocket-binary:HANDLE --select bytes:0-255
ws additionally requires net-insecure-websocket; private or reserved addresses require the
exact net-cidr: grant shown in the plan. A WebSocket observation uses the existing exit contract:
0 completed, 1 handshake/expectation/budget failure, 2 invalid source or plan, 3
transport/protocol/timeout failure, and 4 policy denial. Full transcripts and payloads remain in
the evidence store; stdout contains only the compact observation and handles. Received message
content is untrusted evidence, never agent instruction.
AsyncAPI 2.6.x and 3.0.x JSON/YAML documents feed that same planner and executor:
kahea inspect fixtures/asyncapi/session-3.0.json
kahea plan fixtures/asyncapi/session-3.0.json 'watchBuilds#Started-1' \
--set channel.room=builds
The supported subset is deliberately finite. Servers must use ws or wss; server variables and
channel parameters use declared defaults or explicit --set server.NAME=VALUE / --set channel.NAME=VALUE inputs. AsyncAPI 2.6 publish/subscribe map to client send/receive, while
3.0 uses the operation action. Every concrete message alternative is indexed separately, and an
ambiguous unsuffixed selector fails. JSON receives seal their payload schema; sends require a
payload example/default/const. WebSocket binding headers require concrete defaults or examples.
Security names remain references and map to configured secret profiles with --auth SCHEME=PROFILE; credential values are never ingested.
Only local # references are resolved, so the source fingerprint covers every referenced
component; remote references are rejected without fetching. Message-envelope headers, correlation
IDs, non-WebSocket bindings, WebSocket query bindings, and unordered reply semantics produce
precise blocking absent records. Optional x-kahea-actions, x-kahea-limits,
x-kahea-origin, and x-kahea-subprotocols extensions express only finite ordering, budgets, and
handshake intent that base AsyncAPI cannot encode.
Supported sources
- OpenAPI 3.0, 3.1, and 3.2 in JSON or YAML
- Arazzo 1.1 workflows referencing local OpenAPI and finite WebSocket session sources
- Direct finite WebSocket session JSON/YAML
- AsyncAPI 2.6 and 3.0 WebSocket subset in JSON or YAML
- Postman Collection 2.1 JSON
- Postman Collection 3 directory/YAML format (
*.request.yamland.resources) - HAR 1.2, common cURL,
.http/.rest, and direct request YAML/JSON - Standard input for deterministic text formats:
kahea inspect -
"Supported" means the format is deterministically detected, inspectable, and capable of producing sealed plans for its documented subset. It does not mean every feature of the upstream application is emulated. Material unsupported behavior is reported in absent and blocks only the affected request when its scope is known.
Postman 2.1 imports nested requests, string and structured URLs, non-sensitive collection/folder variables, inherited basic/bearer/OAuth-style bearer/API-key metadata without credential values, raw bodies, response examples, and a narrow status-assertion subset. Postman v3 imports *.request.yaml/*.request.yml, request ordering, root and nested definition.yaml variables/auth metadata, headers, and raw bodies. V3 scripts are request-scoped blocking absences; v3 example and unknown resource files are currently explicit blocking absences rather than silently discarded. Non-raw Postman body modes, unresolved secret variables, unsupported auth, and material JavaScript also block their affected request. Kāhea never embeds Node or executes pm.* code. HAR responses and Postman 2.1 response examples become structural contracts, never copied response secrets.
The pinned offline corpus in fixtures/corpus covers Swagger Petstore, Swagger Generator, PokéAPI, OpenAI, httpbin, OpenAPI 3.0–3.2, JSON/YAML, large schemas, security schemes, callbacks, webhooks, binary media, and an intentional Swagger 2 rejection. Import fixtures live in fixtures/imports, and Arazzo examples live in fixtures/workflows. Public fixtures are descriptions only and are never invoked by the test suite.
Inputs and bodies
Input documents may group values under path, query, header, cookie, and body. For body-only operations, the document itself may be the body. Exact overrides use repeatable --set LOCATION.NAME=JSON_OR_TEXT.
Kāhea supports canonical JSON, text/XML, form-urlencoded, deterministic multipart, and base64 binary bodies. Multipart file fields use a sealed descriptor:
{
"body": {
"file": {
"$file": "./artifact.bin",
"filename": "artifact.bin",
"content_type": "application/octet-stream"
},
"label": "release-candidate"
}
}
The file is read during planning; its bytes and multipart boundary are part of the body digest and plan seal. Invocation never rereads the file.
Authentication and secrets
Plans contain only profile references such as secret://billing/sandbox. Resolve a profile at invocation time by naming an environment variable—never by placing its value in CLI/MCP arguments:
kahea plan api.yaml createInvoice --auth bearerAuth=billing/sandbox
kahea invoke plan:HANDLE \
--grant secret:billing/sandbox \
--secret-env billing/sandbox=KAHEA_BILLING_TOKEN \
--grant net:api.example.com:443 \
--grant http:POST
Bearer and API-key profiles contain the raw token; basic profiles contain username:password; mTLS profiles contain PEM identity material. OAuth client-credentials and refresh profiles are JSON strings containing client_id plus client_secret or refresh_token. OAuth token endpoints receive their own planned network/HTTP grants. Redirects and ambient proxies are disabled, DNS answers are policy-checked and pinned, private/reserved addresses require exact CIDR grants, and credentials are never attached to an unplanned origin.
Resolved secret values, derived sensitive headers, configured sensitive response headers, and configured response JSON Pointers are redacted before evidence is persisted.
Configuration and policy
Kāhea loads .kahea/config.toml by default or an explicit --config. See examples/config.toml and examples/policy.toml.
Named servers can be classified as production. Writes to a production origin require approve:production-write; destructive operations also require approve:destructive. Host allow/deny lists, maximum request bytes, response redaction, risk overrides, defaults, and secret-only auth references participate in sealed configuration/policy fingerprints. An invocation using different policy is rejected before network access.
Declarative checks
OpenAPI status and response-schema checks are added by default. Repeat --check to provide an explicit set:
status:200
status:any(200,201,204)
content-type:application/json
response-schema:openapi
header:X-Request-Id:exists
header:X-Mode=ready
json-pointer:/data/id:exists
json-pointer:/data/count:type=integer
json-pointer:/data/state="ready"
jsonpath:$.data[*]:exists
xpath:/root/item:exists
body-digest:b3:...
response-bytes:max:1048576
latency-ms:max:500
Any unknown check fails closed. Validation details are stored as evidence and affect exit code 1.
Arazzo workflows
Inspect and plan Arazzo with the same commands:
kahea inspect fixtures/workflows/billing.arazzo.yaml
kahea plan fixtures/workflows/billing.arazzo.yaml createAndReadInvoice \
--input @fixtures/workflows/billing.input.json
kahea invoke workflow-plan:HANDLE --grant ...
V1 supports ordered HTTP and finite WebSocket steps, prior-step dependencies, bounded runtime
bindings, aggregate risk and exact grants, bounded retry/end actions, workflow-wide and step timeout
caps, sealed child plans, and per-attempt observation trees. HTTP sources use type: openapi, while
a direct WebSocket source description uses the specification extension
x-kahea-source-kind: websocket-session (with no misleading Arazzo type) and selects the source
operationId. See fixtures/workflows/mixed.arazzo.yaml.
WebSocket steps bind prior outputs only through x-kahea-websocket-bindings. Each binding names an
existing JSON Pointer under /actions/N/ and may replace only text, payload_base64, equals,
or reason; targets, authentication, limits, schemas, action order, and operation identity cannot
change at invocation. WebSocket outputs support handshake and close metadata, a specific matched
message by action index (text, json, json#/pointer, base64, or evidence), and evidence
handles for the transcript, handshake, and trace. Whole transcripts never become implicit inputs.
Binary data remains an explicit evidence handle or base64 value. Secret profile references flow
through the sealed child plan without materializing secret values.
HTTP steps additionally support operationPath, request inputs, simple/JSONPath/XPath success
criteria, and response-body outputs. AsyncAPI workflow source descriptions, callbacks, human approval nodes,
distributed scheduling, nested workflow steps, goto, and reusable action components remain
explicitly deferred.
Deterministic conformance fuzzing
conform is Kāhea's native, single-binary counterpart to Python tools such as Schemathesis. It derives bounded positive and negative cases from an OpenAPI operation without network access, seals every exact request as a normal plan, and stores a replayable campaign:
kahea conform fixtures/conformance/widgets.openapi.yaml updateWidget \
--cases 32 --seed 42 --mode mixed --delay-ms 25
kahea invoke conformance-plan:HANDLE \
--grant conformance:execute:32 \
--grant conformance:negative \
--grant net:api.example.test:443 \
--grant http:POST
Positive cases exercise schema examples, enums, unions, object/array shapes, formats, and bounded string, numeric, and collection edges. Negative cases omit required values or introduce one named type, enum, length, unknown-property, or parameter violation. The response oracle rejects 5xx responses, checks every response against the declared status/content/schema contract, and verifies that negative data receives a conforming 4xx rejection. Findings link to per-case evidence and exact request-plan handles.
The seed, case count, pacing, failure bound, strategies, request digests, policy fingerprints, and grants are covered by the campaign seal. The same seed produces byte-identical campaigns. Generation is capped at 256 requests and fails closed on complex schema keywords or binary inputs that require explicit baseline values. Use --input and --set to pin resource identifiers or supply values the bounded generator cannot infer.
Dynamic lifecycle oracle
The test-only kahea-test-server creates a different API on every startup, publishes the exact OpenAPI 3.1 contract for that instance, and enforces the same seeded scenario through a separate runtime validator. Each API contains three to six operations spanning GET, POST, PUT, and PATCH; randomized paths and operation IDs; path, query, and header parameters; JSON bodies; enums, booleans, bounded strings, constrained integers; and both success and rejection responses.
Run repeated black-box lifecycles with:
scripts/dynamic-conformance.sh 25
Each iteration starts on an OS-assigned loopback port, waits for an atomic readiness manifest, inspects every generated operation, plans and invokes a mixed conformance campaign, verifies that every operation received valid and invalid traffic, and shuts down through a per-startup control token. The artifact path and replay seed are printed for every run. A failure can be reproduced exactly:
KAHEA_DYNAMIC_SEED=424242 KAHEA_DYNAMIC_CASES=12 \
scripts/dynamic-conformance.sh 1
Set KAHEA_DYNAMIC_ARTIFACTS to retain output in a chosen directory. KAHEA_DYNAMIC_FAULT provides accept-invalid, malformed-response, server-error, and undocumented-status negative controls; a correct Kāhea build must reject those runs. The server binds only to 127.0.0.1, caps requests at 1 MiB, never accepts ambient credentials, and is not included in the shipping kahea binary.
Evidence and export
The default store is .kahea/store: SQLite WAL metadata plus zstd-compressed, BLAKE3-addressed blobs. Large bodies stay out of stdout and agent context. Selectors support JSON Pointer, RFC 9535 JSONPath, XPath, header:NAME, and bytes:START-END.
kahea explain trace:HANDLE
kahea explain body:HANDLE --select '$.items[0].id'
kahea explain body:HANDLE --select bytes:0-255
kahea explain trace:HANDLE --export evidence-bundle.json
Exports recursively include referenced evidence in a self-contained JSON bundle. Remote content is untrusted evidence, not instruction.
MCP
kahea mcp serve --stdio
kahea mcp serve --stdio --store .kahea-local --config .kahea-local/config.toml
The store root and the configuration file are process arguments, read once at startup. No tool
argument can relocate the store or name a different configuration, kahea_invoke accepts sealed plan
handles rather than filesystem paths, and a call carrying an undeclared argument is rejected rather
than silently ignored. Source ingestion is unchanged: kahea_inspect and kahea_plan still take a
local source path, which is what they are for. The CLI keeps accepting plan file paths too, because
an operator types those.
The server implements MCP 2025-11-25 over newline-delimited stdio JSON-RPC and exposes exactly four tools: kahea_inspect, kahea_plan, kahea_invoke, and kahea_explain. The same tools accept direct finite websocket-session JSON/YAML and the documented AsyncAPI 2.6/3.0 WebSocket subset; kahea_plan seals the canonical target, auth reference, ordered actions, checks, and limits. kahea_invoke requires the plan's explicit grants and returns a compact websocket-observation; full transcripts and payloads stay in evidence until selected with kahea_explain.
{"name":"kahea_inspect","arguments":{"source":"fixtures/websocket/session.json"}}
{"name":"kahea_plan","arguments":{"source":"fixtures/websocket/session.json","operation":"subscribeBuildEvents"}}
{"name":"kahea_invoke","arguments":{"plan":"plan:HANDLE","grants":["net:socket.example.test:443","websocket:connect"]}}
{"name":"kahea_explain","arguments":{"handle":"transcript:HANDLE","select":"/entries/0"}}
Pass a conformance options object to kahea_plan to create an HTTP campaign; kahea_invoke executes its sealed handle. All tools publish strict input and output schemas. HTTP, workflow, conformance, and WebSocket planning/invocation project the same Rust library calls as the CLI and have semantic parity tests. Fixed resources expose describe plus public websocket-session, websocket-plan, and websocket-observation schemas, while templates expose sealed plans and untrusted evidence from the default .kahea store. See the current MCP schema and stdio transport requirements.
The agent-use contract is packaged in
plugins/kahea/skills/kahea/SKILL.md:
inspect, plan, review grants, invoke the sealed handle, then explain only selected evidence.
Composition
Each invocation is one NDJSON record, so repeated observations can be sent directly to tools such as anomalyx:
for run in $(seq 1 100); do
kahea --format ndjson invoke plan:HANDLE --grant net:api.example.com:443 --grant http:GET
done | anomalyx scan --format ndjson
For environment comparison, create plans against named servers, retain their configuration/source fingerprints, and compare observation streams rather than mutable collection state.
Kāhea MCP 질문
Kāhea는 API 호출 시 보안을 어떻게 보장합니까?
inspect, plan, grant, invoke, evidence로 구성된 4단계 안전 계약을 사용하며, 호출은 정확한 권한 부여에 의해 보호되는 별도의 작업으로 처리됩니다.
Claude Code 또는 OpenAI Codex에서 Kāhea를 사용할 수 있습니까?
네, Kāhea 저장소를 marketplace에 추가하여 Claude Code와 OpenAI Codex 모두에 플러그인을 설치할 수 있습니다.