Skip to content
Konstera
Docs · Build agents
Konstera documentation.

Getting started, SDK quickstart, manifest reference, kernel MCP services, deploy guide and FAQ — everything you need to build and run agents on Konstera.

Why MCP

Konstera agents reach back to the kernel over the Model Context Protocol (MCP). This is unusual — most agent platforms use a bespoke RPC — and it was a deliberate choice. Here's what we got for it.

SequenceAgent ↔ kernel over MCP: one protocol boundary, one choke point
Your agentKonstera SDKKernel (MCP server)1tools/list2available kernel services3ctx.llm.complete(...)thin wrapper per language4tool call: llm_complete5scope · meter cost · audit6streamed result (SSE)7reply

The alternatives we rejected#

A: bespoke gRPCB: REST + OpenAPIC: MCP chosen
ClientsOne generated client per languageAnything that speaks HTTPAny language with an MCP client library
Calling a methodGenerated stubs; custom authEvery call is a hand-crafted requestThe kernel exposes its services as MCP tools
Streaming (LLM completions)Custom streamingClunkyNative, via MCP's SSE/streamable transport
Discovery (what tools exist?)—Read the OpenAPI doc out-of-bandBuilt-in tools/list
Familiar to agent authorsNothing they can inspect or tool without us publishing SDKs for their languageGeneric HTTPThe same protocol they already use for Claude Desktop, Cursor's agent mode, OpenAI's Agents SDK

Option A: bespoke gRPC. One generated client per language, custom auth, custom streaming. Fine engineering; nothing an agent author can inspect or tool without us publishing SDKs for their language.

Option B: REST + OpenAPI. Agent authors can call anything that speaks HTTP. But every method call becomes a hand-crafted request; streaming (for LLM completions) is clunky; discovery (what tools exist?) requires reading the OpenAPI doc out-of-band.

Option C: MCP. Agent authors use the same protocol they already use for Claude Desktop, Cursor's agent mode, OpenAI's Agents SDK. The kernel exposes its services as MCP tools. Any language with an MCP client library can author Konstera agents.

What MCP gives us#

A protocol that's already everywhere#

MCP ships in Claude Desktop, Cursor, Windsurf, Codex, Claude Code, OpenAI's Responses API, and increasingly third-party agent frameworks. Konstera's agent-to-kernel interface is not a new protocol you have to learn — it's one you probably already know.

Concretely: a user writing a Konstera agent in Cursor can expose the kernel callback as an MCP server to Cursor's chat panel too, letting the LLM inside Cursor call the same log_info / llm_complete / vector_query tools your agent calls at runtime. Same debugging surface, same mental model.

Discoverability#

MCP has tools/list built in. An agent can enumerate what kernel services are available at runtime without hardcoding a list — important for forward compatibility as the kernel grows services (M7, M10, M13, …).

Streaming for free#

MCP's SSE/streamable transport handles streaming LLM responses natively. We don't maintain a bespoke chunked-transfer encoding; we lean on the protocol.

Audit + metering at the choke point#

Every kernel-side side effect (log, LLM call, state write, credential fetch) goes through a tool invocation. The kernel scopes each by caller instance (ADR-M8 multi-tenancy), meters cost (per-tenant, per-model), writes audit rows. The agent SDK is a thin wrapper — the heavy lifting is kernel-side on a protocol boundary we fully control.

ArchitectureWhere the heavy lifting lives Interactive — click a block

If the agent SDK had direct Python/.NET/TS bindings into the kernel, each language's binding would have to re-implement the metering + scoping. With MCP, there's one choke point.

Language neutrality#

The MCP protocol has clients in Python, TypeScript, .NET, Go, Rust, Java, and others. Konstera's SDK is a thin wrapper per language, so adding support for a new language is weeks not months.

More importantly: an agent author can write a Konstera agent in a language Konstera hasn't shipped an SDK for yet — any MCP-speaking server + a Dockerfile + a manifest is enough. We've seen this pattern used for konstera agent in Go even though we don't publish Konstera.Sdk.Go.

A Konstera agent in a language without an SDK
  • An MCP-speaking server
  • A Dockerfile
  • A manifest

What MCP doesn't give us#

Not a free lunch:

Trade-offWhat it meansHow it's handled
OverheadMCP's JSON-RPC framing is heavier than a direct function call.For latency-sensitive hot paths, the kernel may inline certain services (ADR-005 explored this; we chose consistency over 100µs savings).
Binary dataMCP tool results are JSON — binary (images, PDFs, model weights) has to go through base64.For small blobs (≤25 MB) this is fine; for larger streams, use ctx.artifact.*, which handles the encoding internally.
DebuggingMCP transport over streamable HTTP is harder to debug than plain gRPC in a Wireshark view.The kernel exposes an MCP inspector endpoint for local dev that renders calls in a readable form.

See also#