Skip to content

MCP interface — expose the domain to AI agents as choreography participants #44

@matt-beanland

Description

@matt-beanland

Description

Add a Model Context Protocol (MCP) interface to diffo_example so AI agents (Claude, GPT, local models) can read from and act on the domain directly — and, more interestingly, participate in the choreography we've been yarning about.

The standard story for MCP is "AI as a query layer" — let the assistant fetch data and call tools. That's table stakes. The deeper story is AI as a Party — declaring its preferences (or its principal's), bringing up its own value characteristics, yarning with other parties to align on best, taking one for the team when the ledger asks.

Three layers of MCP integration

1. Read surface — the domain as queryable.
MCP resources/tools that wrap the natural domain reads: list instances, get by id, run feasibility queries (#38, #39), find by note relevance (#43). The aspect-family answers (#41) and the value-with-collapse-function shape (#42) translate naturally to MCP responses — the AI can ask the simple form or the rich form depending on what it needs to reason about.

2. Write surface — the domain as actionable.
MCP tools that wrap the action surface: build/define/relate/assign. With the actor-based multi-tenancy from RSP (#36), the AI inherits the principal's authority — it can do what its principal can do, no more.

3. Participation surface — the AI as a Party in choreography.
This is the interesting one. The AI is a Party with its own (or its principal's) preferences. It brings up its value functions like any other party. It receives feasible sets, computes its preferred options under its worldview, yarns with other parties (via natural-language back-and-forth that becomes Notes on the relevant instances per #43), defers when the ledger asks, advocates when it's its turn. The choreography stays the same; the AI is just another dancer.

Why it matters

MCP is the standard way to give AI agents domain access today. Without it, every consumer rebuilds the same wrapper. With it, diffo_example demonstrates not just "AI can query our domain" but "AI participates in the same choreography as any other party — with the same agency, the same constraints, the same honest answers (aspect family), the same ledger."

It also tests the agency story honestly. If the domain primitives — bring up, expect, align, yarn — are real and well-shaped, AI should be able to use them as cleanly as any human-driven consumer. If we have to bolt on AI-specific affordances, the primitives weren't quite right.

And the worldview-as-configuration dream (#40, #41, #42) gets a real test: can an AI agent be configured with a worldview at session start, then make consistent decisions across an interaction? Can two AI agents with different worldviews yarn to a settlement? Honest test of whether the structural ethics actually operate.

A possible direction

Ash has emerging MCP affordances (or close enough) that we can plug into. Two layers of work:

  • Mechanical wrapping of the existing read/write actions as MCP tools. Probably mostly generated from the code_interface declarations and action signatures. Should be small once the patterns are settled.
  • Choreography-shaped tools — higher-level tools that compose the primitives in choreography form: propose_option, defer_for_team, record_yarn_note, align_preferences. These are the AI-as-participant surface, and shape themselves into the same primitives the rest of the domain uses.

The exemplar work would be:

  1. Wire one Access action through MCP (probably qualify_dsl since it's the natural entry point) to prove the round-trip.
  2. Then add the semantic-note search (#43) as an MCP tool — natural language → relevant instances is the canonical AI query.
  3. Then prototype an AI-as-Party scenario — two parties with different worldview configurations yarn to settle on an option, and the yarn itself lands as Notes on the relevant instances.

Related:

  • Everything else open — MCP is the surface through which all of it becomes accessible to AI agents. It's the integration layer that proves the dream is real.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions