Modules & sharing

Installing modules with AI (MCP)

Use the MCP server to discover, inspect, and install modules with reduced command context.

@damatjs/mcp is a Model Context Protocol server that lets an AI assistant (Claude Code, Claude Desktop, Cursor, …) discover and install modules for you. It wraps the registry and the damat module add flow in safe tools — the assistant can never do more than the CLI would let you do.

Wire it up

Add the server to your assistant's MCP config (e.g. .mcp.json in your app):

{
  "mcpServers": {
    "damat-modules": {
      "command": "bunx",
      "args": ["damat-mcp"],
      "env": {
        "DAMAT_MODULE_REGISTRY": "https://registry.damatjs.com/index.json",
        "DAMAT_APP_DIR": ".",
        "DAMAT_CLI": "damat"
      }
    }
  }
}

The three env vars:

VariableMeaningDefault
DAMAT_MODULE_REGISTRYRegistry index — a URL, a registry.json path, or a directory(unset — discovery tools report no registry)
DAMAT_APP_DIRThe app the assistant installs intocurrent directory
DAMAT_CLIHow to invoke the CLIdamat

The tools

ToolPurposeKey inputs
list_modulesList everything in the registry
search_modulesFind modules by keywordquery
module_infoInspect one module — versions, owner, verificationref
list_installedWhat's already in the app
add_moduleInstall (runs damat module add)source, plus optional name, dir, force, allowUnverified, allowScripts

add_module honors the same trust gate as the CLI: unverified path/git sources need an explicit allowUnverified: true, and registry verification follows your DAMAT_MODULE_VERIFY policy (see Installing modules).

list_installed reads damat.lock.json, which remains authoritative even when a source module's routes, jobs, events, and pipelines are distributed across the backend.

module_info accepts a bare name even when the registry stores only namespaced keys, provided exactly one key or entry name matches. If two publishers expose the same name, use the canonical namespace from the ambiguity response.

Using it

Just ask: "Find a Damat auth module and install it." The assistant chains search_modules → module_info → add_module, reports what changed (copied capabilities, packages, and backend-owned integration instructions), and reminds you to review the wiring and apply migrations:

bun run db:migrate

To extend the server with your own tools, see the MCP internals.