CostAffective
Protocol Specs

Model Context Protocol

Understand how CostAffective integrates into the open standard designed by Anthropic.

The Stdio Handshake

When an assistant client starts CostAffective via the costaffective serve subprocess command, it initializes a bidirectional JSON-RPC channel over standard I/O (stdio).

Client sends initialization payloads containing client info and capabilities, and the server returns registered tool names, schemas, and descriptions.

// Request Initialization Handshake
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "initialize",
  "params": {
    "protocolVersion": "2024-11-05",
    "capabilities": {},
    "clientInfo": {
      "name": "claude-code",
      "version": "1.0.0"
    }
  }
}

Schema Mappings & Validation

CostAffective implements strict validation structures for incoming tool queries, ensuring data format matching.

JSON-RPC 2.0

Standard payload wrappers specifying request identifiers, execution methods, and status parameters.

Stdio Streams

No network sockets are opened. Inputs are loaded from stdin, and outputs are written to stdout, avoiding firewall complications.

Capabilities

Declares tools capabilities to clients, presenting relational queries statically to LLMs.