---
url: https://docs.mochiexec.io/guides/agents-and-mcp.md
description: >-
  Connect coding agents to your workflows with the MCP server, chat with Mochi's
  own agent, and see what agents ran.
---

# Agents & MCP

Coding agents run a lot of commands on your behalf. Mochi gives them a proper interface to
your workflows, and keeps the record of what they ran.

## Connect an external agent

`mochi mcp` starts a Model Context Protocol server over stdio. Point Claude Code,
Cursor, or any MCP client at it:

```json
{
  "mcpServers": {
    "mochi": { "command": "mochi", "args": ["mcp"] }
  }
}
```

flow docs: [AI tools & MCP](https://flowexec.io/guides/ai-tools)

The full tool list, client setup, and run provenance. `mochi mcp` and `flow mcp` are the
same server.

An agent can only run tasks from workspaces you trust. See [Workspace Trust](/guides/workspace-trust).

## Chat inside Mochi

Chat in the desktop app (**Home** or **Chats**) and `mochi ai chat` need no setup. The
model gets the same tools an external agent does, limited by the
[tool tier](/guides/ai#what-chat-is-allowed-to-do) you allow.

## See what an agent ran

Every run an agent starts is recorded alongside your own. On the **Runs** page, the
**Origin** column names the client that ran it (Claude Code, Cursor, Mochi's own chat),
and the **Agent runs** tab lists only those. Filter **History** by **Source**: **CLI**,
**Desktop** or **Agent (MCP)**, or by client and session.

When an agent's run fails, open it and ask Mochi to [diagnose it](/guides/ai).
