Expand description
Agent-operable administration via MCP (DW-112).
Expose the admin API as an MCP (Model Context Protocol) server with tools for route/service/policy CRUD, stats, and analytics queries. RBAC-scoped tool access – AI agents operate dwara.
§MCP tools
The MCP server exposes the following tools:
list_routes– list all routes in the current configget_route– get a single route by namecreate_route– create a new routeupdate_route– update an existing routedelete_route– delete a routelist_services– list all servicesget_stats– get gateway statsget_health– get gateway healthget_config– dump the current config
§RBAC
Tool access is RBAC-scoped: each tool requires a permission, and the MCP server checks the agent’s permissions before executing a tool. Out-of-scope operations are denied.
§JSON-first
All tool inputs and outputs are JSON. The CLI also has a
--json flag for JSON-first output mode.
§Feature gate
The mcp cargo feature must be enabled.
Structs§
- Agent
Identity - An agent’s identity and permissions.
- McpServer
- The MCP server: holds tool definitions and executes tool calls with RBAC checks.
- Mock
Tool Handler - A simple tool handler for testing: returns canned responses.
- Tool
Call Request - An MCP tool call request.
- Tool
Call Response - An MCP tool call response.
- Tool
Definition - An MCP tool definition.
Enums§
- McpTransport
- AI-11 (#200): The transport type for the admin MCP server.
- Permission
- A permission required to use a tool.
Traits§
- Tool
Handler - A tool handler: the caller implements this to actually execute tools (calling the admin API, reading config, etc.).
Functions§
- encode_
sse_ error - AI-11 (#200): Encode a JSON-RPC error as an SSE frame.
- encode_
sse_ response - AI-11 (#200): Encode a JSON-RPC response as an SSE frame.
Returns a string suitable for writing to an SSE response body
(
data: <payload>\n\n).