axon-emcp 0.2.0

axon-emcp — the official ℰMCP (Epistemic Model Context Protocol) server for AXON. A stdio JSON-RPC 2.0 MCP server that exposes the AXON language to AI coding agents (Claude Code, Codex, Cursor, …): every primitive's grammar + semantic constraints + idiomatic examples, plus live validation via the same `axon-frontend` lexer/parser/type-checker the `axon` CLI uses. Hydrated from a diff-reviewable markdown knowledge base under `src/knowledge/`.
Documentation
axon-emcp-0.2.0 has been yanked.

axon-emcp

The official ℰMCP (Epistemic Model Context Protocol) server for AXON — a stdio JSON-RPC 2.0 Model Context Protocol server that exposes the AXON language to AI coding agents (Claude Code, Codex, Cursor, Continue, Cline, …).

crates.io docs.rs License: MIT

What it does

Any MCP-compatible coding agent that launches axon-emcp as a subprocess gets:

  • 5 tools — axon.primitives, axon.primitive_doc, axon.check, axon.parse, axon.compose. Live language reference + structured validation through the same axon-frontend lexer/parser/type-checker the axon CLI uses (byte-identical diagnostics).
  • 14+ resources under axon:// — full primitive references (primitives/{name}), grammar maps (grammar/{top_level|composition|ebnf}), composition logic (logic/{flow_composition|session_duality}), and per-framework compliance maps (compliance/{hipaa|gdpr|pci_dss|sox|soc2|fedramp|gxp|fisma|nist_800_53}).
  • 3 prompts — flow_design, shield_design, session_design. Host-surfaced design recipes that drive the agent through a structured workflow (axon.compose → axon.primitive_doc → axon.check).

The result: a developer talks to their AI coding agent in natural language; the agent writes AXON that passes axon check on first try, with the right compliance shields by construction.

Install

cargo install axon-emcp

The installed binary is fully self-contained — the knowledge corpus (45 primitive docs + 33 templates + grammar/logic/compliance references) is baked into the executable via include_dir! at compile time. No share/ directory, no env vars, no post-install steps.

axon-emcp --help

Configure your agent

Point the agent's MCP config at the installed binary:

// Claude Code:    ~/.config/claude-code/mcp.json
// Cursor:         ~/.cursor/mcp.json
// Codex:          ~/.codex/mcp.json
// Continue:       ~/.continue/config.json (under "mcp.servers")
{
  "mcpServers": {
    "axon": {
      "command": "axon-emcp"
    }
  }
}

Restart the agent. The 5 tools, 14+ resources, and 3 prompts now appear in the agent's surface — the agent will quote them when you ask it to write AXON.

Closed-domain composition

You: write me a healthcare flow that handles PHI.

Agent: [calls axon.compose(intent: "healthcare flow PHI")]
       ✓ Scaffold returned (axon_check_verdict: well-formed)
       ✓ Domain: healthcare (matched: patient, phi, hipaa, …)
       ✓ Compliance applied: HIPAA, GDPR, GxP, SOC2
       ✓ Primitives used: type, persona, shield, flow, axonendpoint

       Here is your scaffold: …

The classifier picks from a closed 33-domain catalogue spanning verticals (healthcare, banking, government, legal, legaltech, fintech, pharmatech, medic_research), agent patterns (chat_research, chat_tools, chat_skills, whatsapp, voice, dev, sales_consultive, sales_widget), and application patterns (workflow_automation, business_intelligence, corporate_integration, self_learning, document_analysis, ticket_triage, content_moderation, knowledge_extraction, compliance_monitoring, recruitment, education, financial_advisor, data_pipeline). Every template proven to compile through the live axon-frontend pipeline.

Contributor surface

Beyond the MCP server mode (no arguments), axon-emcp ships two contributor-facing subcommands:

# Scaffold a new primitive doc with frontmatter pre-populated from the
# canonical PRIMITIVE_REGISTRY.
axon-emcp scaffold-primitive <name>

# Aggregate a JSONL telemetry log into a structured snapshot.
axon-emcp telemetry summarize <file>

Telemetry (privacy-first)

Opt-in only — no network egress without an explicit env var:

Env var Effect
AXON_EMCP_TELEMETRY_FILE Append JSONL events to this path (default: disabled)
AXON_EMCP_DEPLOYMENT_ID Correlation tag stamped on every event
AXON_EMCP_TELEMETRY_MAX_SAMPLES Latency histogram window per tool (default: 1000)

Five privacy invariants are enforced by construction:

  1. AXON source content is never recorded.
  2. axon.compose intent strings are never recorded.
  3. Tool error messages are never recorded.
  4. No remote egress without explicit opt-in.
  5. Deployment ID is operator-supplied (default: empty).

The JSONL is OTLP-data-model compatible — downstream pipelines (Vector / Fluent Bit / otel-collector with the filelog receiver) ingest it and forward as OTLP wire.

License

MIT. See the repository for the full sources, the knowledge corpus under src/knowledge/, and the contributor guide.