Skip to main content
Glama
README.md
# Flowith MCP

A stdio MCP server that lets AI agents use Flowith Canvas for text, image, and video generation, canvas retrieval, file transfer, and recoverable asynchronous jobs.

The server is designed for MCP clients such as Claude Code, Codex, Zcode, and other agent harnesses. An agent sends structured tool calls to this server. The server then uses the Flowith CLI and HTTP APIs to perform authenticated operations.

## What agents can do

- Generate text, images, and videos.
- Create, list, search, read, and recall canvas content.
- Upload local reference files and download completed results.
- Inspect models, credits, session state, and job receipts.
- Resume status checks after a disconnected or interrupted generation request.

The canvas is the execution and storage context for these operations. This project provides an agent-facing MCP interface for Flowith capabilities.

## Quick start

### Requirements

- A [Flowith](https://flowith.io) account.
- [Bun](https://bun.sh) 1.4 or newer.
- An MCP client that supports local stdio servers.

Install dependencies:

```bash
bun install
```

Authorize Flowith once through the explicit login tool. Routine MCP calls run without opening a browser.

### Claude Code

Copy `.mcp.json.example` to `.mcp.json` in the repository root. The local file is ignored by Git.

The example configuration starts:

```json
{
  "mcpServers": {
    "flowith": {
      "type": "stdio",
      "command": "bun",
      "args": ["mcp-server.mjs"],
      "env": {
        "FLOWITH_BOT": "claude-code"
      }
    }
  }
}
```

### Other MCP clients

Use the same stdio command and arguments:

```text
command: bun
args: mcp-server.mjs
```

Set `FLOWITH_BOT` to the client identity when the harness supports environment variables. `codex-config.toml.example` contains a Codex example.

## Tool groups

| Group | Tools |
| --- | --- |
| Session | `flowith_status`, `flowith_login`, `flowith_whoami` |
| Catalogue | `flowith_models`, `flowith_credits` |
| Canvas | `flowith_list_canvases`, `flowith_create_canvas`, `flowith_search_canvases`, `flowith_read_canvas`, `flowith_recall`, `flowith_read_node` |
| Generation | `flowith_generate`, `flowith_generate_async`, `flowith_get_result` |
| Files | `flowith_upload`, `flowith_download_result` |
| Recovery | `flowith_list_jobs`, `flowith_job_result` |

The server exposes 18 tools and does not expose MCP prompts.

## Generation and recovery

Asynchronous generation returns stable node and canvas identifiers. A client can query the same node with `flowith_get_result` after a local timeout or process restart.

Local job receipts record the minimum metadata needed to recover a request. Receipts do not store access tokens, full prompts, or model responses. An uncertain submission is reported as `SUBMISSION_UNKNOWN`, and the server does not automatically submit a duplicate paid request.

## Documentation

- [README-MCP.md](./README-MCP.md) contains the detailed MCP behavior and verification notes.
- [SKILL.md](./SKILL.md) contains the full command and agent reference.
- [references/api.md](./references/api.md) contains the underlying HTTP recipes.
- [references/cli.md](./references/cli.md) contains the upstream CLI command reference.
- [references/troubleshooting.md](./references/troubleshooting.md) contains error codes and recovery steps.

## Development

Run the offline regression suite:

```bash
bun run test
```

The tests use mocks and temporary directories. They do not consume Flowith credits.

## License

MIT