DDD.MCP.Registry (vicander v0.1.1)

Copy Markdown View Source

What an MCP server exposes, checked once when the server is built.

build!/2 turns the options of use DDD.MCP.Server into tools (commands and queries) and resources (aggregates). It raises ArgumentError for anything that would reach a client broken: an exposed module without a description, two tools with the same name, an entity with no repository.

Summary

Types

entity()

@type entity() :: %{
  name: String.t(),
  aggregate: module(),
  port: module(),
  description: String.t(),
  lookups: [[atom()]]
}

t()

@type t() :: %DDD.MCP.Registry{
  authorize: term(),
  instructions: term(),
  name: term(),
  read_only: term(),
  repos: term(),
  tools: term(),
  version: term()
}

tool()

@type tool() :: %{
  name: String.t(),
  module: module(),
  kind: :command | :query,
  description: String.t(),
  input_schema: map(),
  params: [String.t()]
}

Functions

build!(server, opts)

@spec build!(module(), keyword()) :: t()