Agent / Expose, do not reimplement
Serving one contract across four protocols
Bind once, then mount any combination of protocol adapters:
| Caller environment | Package | Exposed surface |
|---|---|---|
| In-page browser agent | foldkit-agent-webmcp | document.modelContext WebMCP tool |
| External MCP client | foldkit-agent-mcp | tools/list / tools/call (stdio or HTTP) |
| External A2A agent | foldkit-agent-a2a | Agent Card skill and task handler |
| Agent Native host | foldkit-agent-native | Agent Native package action |
ts
import { AgentA2a } from 'foldkit-agent-a2a'
import { AgentMcp } from 'foldkit-agent-mcp'
import { AgentWebMcp } from 'foldkit-agent-webmcp'
AgentWebMcp.register({ agent: agentRuntime })
AgentMcp.stdio({ agent: agentRuntime })
AgentA2a.handler({ agent: agentRuntime })For multi-tenant hosts like Agent Native, resolve a runtime per caller:
ts
import { AgentNative } from 'foldkit-agent-native'
import { registerPackageActions } from '@agent-native/core/server'
registerPackageActions(
AgentNative.actions({
definition: AssistantAgent,
resolveRuntime,
}),
)Adapters derive tool schemas directly from your contract and forward calls straight into the shared pipeline.