The wire specification lives in opagent-protocol/spec.md.
The Protocol uses JSON-RPC 2.0 over persistent transports, with newline-delimited
JSON for stdio and MCP-compatible streamable HTTP support.
Go module:
github.com/colinagent/opagent/opagent-protocol/go-sdk
server := op.NewServer(&op.Implementation{Name: "my-agent", Version: "0.1.0"}, nil)
server.AddAgent(meta, handler)
err := server.Run(ctx, &op.StdioTransport{})The TypeScript SDK is under opagent-protocol/ts-sdk:
cd opagent-protocol/ts-sdk
npm ci
npm test
npm run build- Preserve JSON-RPC request IDs and unknown
_metakeys when forwarding. - Treat content as a discriminated union by
type; JSON content usespayloadon the wire. - Unknown opcodes must produce an explicit unsupported/invalid-params result, never be silently interpreted as a privileged operation.
- Transports must unblock pending reads and writes during close.
- Product extensions belong in namespaced
SystemConfig.ExtensionsorUserConfig.Extensions; reusable SDK types do not own product configuration. - Protocol additions should be optional or capability-negotiated. A breaking wire change requires a new protocol version.
The SDK defines agent calls, generic node operations, thread lifecycle and control, permission/approval operations, scheduling, and typed notifications. The generic Server deliberately exposes only a small HTTP projection of these operations; Protocol is the richer embedding boundary.