Getting started
Start the server
Method overview
| Method | Category | Description |
|---|---|---|
initialize | Handshake | Returns server capabilities |
session/create | Session | Create session and run first turn |
session/list | Session | List active sessions |
session/read | Session | Get session state |
session/archive | Session | Remove session from runtime |
turn/start | Turn | Start a new turn on existing session |
turn/interrupt | Turn | Cancel in-flight turn |
capabilities/get | Capabilities | Runtime capability report |
config/get | Config | Read current config |
config/set | Config | Replace config |
config/patch | Config | Merge-patch config (RFC 7396) |
Protocol
Standard JSON-RPC 2.0 with"jsonrpc": "2.0" on every message. Three message types:
- Request (client -> server): has
id,method,params - Response (server -> client): has
id,resultorerror - Notification (server -> client): has
method,params, noid
Full lifecycle diagram
Full lifecycle diagram
Session methods
initialize
Handshake. Returns server capabilities.Server name.
Server version.
Protocol contract version.
List of supported method names.
session/create
Create a new session and run the first turn.prompt is required. All other fields are optional and fall back to config defaults. During execution, session/event notifications are emitted (see Notifications).
Parameter reference
The user prompt to send to the agent.
Model name (e.g.
"claude-opus-4-6", "gpt-5.2").Provider name:
"anthropic", "openai", "gemini", "other".Max tokens per turn.
Override system prompt.
JSON schema for structured output extraction (wrapper or raw schema).
Max retries for structured output validation.
Run-scoped hook overrides (entries to add, hook IDs to disable).
Enable built-in tools (task management, etc.).
Enable shell tool (requires
enable_builtins).Enable sub-agent tools (fork, spawn).
Enable semantic memory (
memory_search tool + compaction indexing).Run in host mode for inter-agent comms (requires
comms_name).Agent name for inter-agent communication.
Provider-specific parameters (e.g., thinking config, reasoning effort).
Response fields
UUID of the created session.
The agent’s response text.
Number of LLM calls made.
Number of tool calls executed.
Token usage breakdown.
Parsed structured output.
Schema compatibility warnings.
session/list
List active sessions.session/read
Get session state.Session ID to read.
session/archive
Remove a session from the runtime.Session ID to archive.
Turn methods
turn/start
Start a new turn on an existing session.session/create. Fails with error code -32001 (SESSION_BUSY) if a turn is already in progress.
Session ID to continue.
The follow-up prompt.
turn/interrupt
Cancel an in-flight turn. No-op if the session is idle.Session ID to interrupt.
Capabilities
capabilities/get
Return runtime capabilities with status resolved against config. This lists every capability known to Meerkat with its current status (available, disabled by policy, not compiled, etc.).status values:
| Status | Shape | Meaning |
|---|---|---|
Available | "Available" | Compiled in, config-enabled, protocol supports it |
DisabledByPolicy | {"DisabledByPolicy": {"description": "..."}} | Compiled in but disabled by policy |
NotCompiled | {"NotCompiled": {"feature": "..."}} | Feature flag absent at compile time |
NotSupportedByProtocol | {"NotSupportedByProtocol": {"reason": "..."}} | This protocol surface does not support it |
Config methods
config/get
Read current config.config/set
Replace the config.config/patch
Merge-patch the config (RFC 7396).Notifications
During turn execution, the server emitssession/event notifications containing serialized AgentEvent payloads:
AgentEvent enum in meerkat-core:
| Event | Description |
|---|---|
run_started | Turn execution began |
text_delta | Streaming text chunk from LLM |
text_complete | Full text for this turn |
tool_call_requested | LLM wants to call a tool |
tool_execution_started | Tool dispatch began |
tool_execution_completed | Tool returned a result |
turn_started | New LLM call within the turn |
turn_completed | LLM call finished |
run_completed | Turn execution finished successfully |
run_failed | Turn execution failed |
budget_warning | Approaching resource limits |
retrying | Retrying after transient error |
Error codes
Standard JSON-RPC codes plus Meerkat-specific application codes:| Code | Name | Description |
|---|---|---|
| -32700 | Parse error | Invalid JSON |
| -32600 | Invalid request | Not a valid JSON-RPC request |
| -32601 | Method not found | Unknown method |
| -32602 | Invalid params | Missing or invalid parameters |
| -32603 | Internal error | Server error |
| -32000 | Session not found | Session ID does not exist |
| -32001 | Session busy | Turn already in progress |
| -32002 | Provider error | LLM provider issue (missing key, auth) |
| -32003 | Budget exhausted | Resource limits reached |
| -32004 | Hook denied | Hook blocked the operation |
Architecture
The RPC server is stateful: agents stay alive between turns. This is the key difference from REST (stateless per-request) and MCP (callback pattern).Agent. This solves the cancel(&mut self) requirement without mutex. Commands (StartTurn, Interrupt, Shutdown) are sent via channels.
Backpressure: The notification channel is bounded. When the client reads slowly, the agent naturally slows down.
Comparison with other surfaces
| CLI | REST | MCP | RPC | |
|---|---|---|---|---|
| Stateful | No | No | No | Yes |
| Streaming | stderr | SSE | Optional | JSONL notifications |
| Multi-session | No | No | No | Yes |
| Cancellation | Ctrl+C | N/A | N/A | turn/interrupt |
| Bidirectional | No | No (SSE one-way) | Partial | Yes |
