---
name: floom
description: >
  Deploy Python apps, API backends, and MCP servers to Floom. Use when building
  a Python function or API that needs a live URL, REST endpoint, web UI, or MCP tools.
  Triggers: "deploy to floom", "use floom", "floom deploy", building a Python API or MCP backend.
---

# Floom

Floom turns a Python function into a live app in 45 seconds: URL, REST API, web form, and MCP tools — no Dockerfile, no server config.

## Install CLI

```bash
npm install -g @floomhq/cli
```

## Write a floom app (`main.py`)

A floom app is 1–3 flat files. **Never create a Python package or pyproject.toml.**

```python
from floom import app, context, remember

@app.action
def analyze(text: str, top_n: int = 5) -> dict:
    words = text.lower().split()
    return {"word_count": len(words), "top_n": top_n}
```

Rules:
- `@app.action` on every function you want exposed
- Type hints become form fields and API parameters
- Return `dict` — lists of dicts render as tables, images render as previews
- Secrets: `context.get_secret("KEY")` — never `os.environ`
- Storage: `remember(key, value)` / `remember(key)` / `forget(key)`
- Files: `save_artifact(filename, data)`
- Network: add `network: true` to `floom.yaml` or pass `--network` on deploy

## Deploy

```bash
floom deploy .                   # deploy current directory
floom deploy . --name my-app     # with custom name
floom deploy . --network         # enable outbound HTTP requests
```

## Run an action

```bash
floom run -a my-app analyze text="hello world"
```

## Validate before deploy

```bash
floom validate
```

## MCP setup (for agents using Floom as a tool)

```bash
FLOOM_URL=https://api.floom.dev \
FLOOM_API_KEY=your-key \
npx @floomhq/mcp-server
```

Tools available: `deploy`, `run`, `list_projects`, `get_logs`, `create_share_link`

## floom.yaml (optional)

```yaml
name: my-app
network: true
inputs:
  text:
    type: string
    example: "Hello world"
```

## Full reference

- Agent guide: https://github.com/floomhq/floom/blob/main/docs/AGENT_GUIDE.md
- Protocol: https://floom.dev/llms.txt
- Building guide: https://github.com/floomhq/floom/blob/main/BUILDING.md
