AI Agents & MCP

Serve project knowledge to AI coding agents over the Model Context Protocol.

RustaSea's predictable structure and conventions make it a good fit for AI coding agents. Every project can expose its knowledge surface over the Model Context Protocol:

bash
cargo artisan mcp:serve

This is gated behind the ai-mcp (or mcp) cargo feature on the rustasea crate. A build without that feature does not register the command.

What the server exposes

The MCP server advertises tools and resources rather than raw file access.

ToolPurpose
route:listThe live route table
model:showModel introspection (attributes, casts, relations)
make:planScaffold planning before generation
migrate:statusMigration state
ResourceContents
rustasea://docs/{name}Project documentation
rustasea://config/{name}Configuration (values redacted)
rustasea://routesRoute surface
rustasea://commandsRegistered console commands

Safety boundaries

Agentic development loop

sequenceDiagram
    participant Agent as Coding agent
    participant MCP as rustasea mcp:serve
    participant App as Booted application
    Agent->>MCP: route:list
    MCP->>App: inspect live route table
    App-->>MCP: Method, URI, Name, Action, Middleware, Binding
    MCP-->>Agent: route metadata
    Agent->>MCP: make:plan
    MCP-->>Agent: scaffold plan
    Agent->>App: generate controller, model, migration

Agent-facing scaffolds live in the same CLI:

bash
cargo artisan make:agent {name}
cargo artisan make:tool {name}

Last updated Sep 22, 2026