What does --mcp do?
The --mcp flag starts the CLI as a Model Context Protocol (MCP) stdio server. AI assistants connect to it over standard input/output and call Mandate commands as structured tools. No HTTP server, no port binding: the transport is stdio.
Exposed tools
The MCP server exposes two tools:| Tool | Description |
|---|---|
search | Look up validation schemas, command usage, and examples. Read-only, no auth needed. |
execute | Call any Mandate CLI command (validate, transfer, event, status, approve). Requires a runtime key. |
search tool helps agents discover how to use Mandate before they have credentials. The execute tool runs real commands against the API.
Client configuration
Claude Desktop
Add this to yourclaude_desktop_config.json:
~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, it is at %APPDATA%\Claude\claude_desktop_config.json.
Codex CLI
Add this to your.codex/config.toml:
Claude Code
Claude Code can connect to the MCP server directly:How it works
When an AI assistant sends a tool call to the MCP server, the server:- Parses the tool name and arguments
- Routes to the corresponding CLI command
- Authenticates using the runtime key from environment or
~/.mandate/credentials.json - Returns the result as structured JSON
When to use MCP vs the CLI directly
Use--mcp when your AI assistant supports MCP natively (Claude Desktop, Codex CLI, Claude Code). The assistant gets structured tool definitions, typed inputs, and typed outputs without parsing CLI text.
Use the CLI directly when you are scripting, running in CI, or working from a terminal. The output is the same JSON.
For a cloud-hosted MCP server on Cloudflare Workers (no local CLI needed), see the MCP Server integration. It runs as a deployed service rather than a local process.
Next Steps
Cloud MCP Server
Deploy Mandate as a hosted MCP server on Cloudflare Workers.
CLI Overview
Full list of commands and global options.
Agent Discovery
Use —llms for lightweight command discovery without MCP.