Model Context Protocol & IPC Socket
Complete specification for connecting Claude Code, Antigravity, and local LLMs to StatCraft.
MCP 1.0 JSON-RPC SpecificationCrates: statcraft_bridge / tokio async socket
1. Local IPC Architecture#
When StatCraft is launched, the statcraft_bridge module spins up an asynchronous JSON-RPC 2.0 server bound to localhost port 18492. This allows local AI assistants to establish a secure, zero-cloud connection to the running dataset session without exposing sensitive patient or research data over the public internet.
2. MCP Toolset Specification#
External agents utilize the standard Model Context Protocol (MCP) to interact with StatCraft:
statcraft_get_dataset_summary: Returns row/column dimensions, column names, storage types, and missing value counts.statcraft_audit_variables: Returns variable dictionary metadata (Measurement scale, labels, categorical value-label mappings).statcraft_execute_syntax: Submits SPSS.spssyntax to the engine'sCommandBus.statcraft_get_procedure_results: Retrieves generated Pivot Tables in JSON or LaTeX format.statcraft_insert_output: Appends APA-formatted interpretations and tables directly into the desktop Output tree.
3. Direct Output Injection#
Unlike generic chatbots where analytical results remain trapped in the chat sidebar, StatCraft AI integrations write directly into the official scientific report tree, creating persistent, printable, and exportable research artifacts.
Canonical SPSS Syntax Example
SPSS SYNTAX (.SPS)
| 1 | { |
| 2 | "method": "statcraft.procedure.execute", |
| 3 | "params": { |
| 4 | "command": "DESCRIPTIVES VARIABLES=salary age /STATISTICS=MEAN STDDEV MIN MAX." |
| 5 | } |
| 6 | } |