Skip to content

Build applications for people, MCP clients, and AI agents.

A Python backend framework for the agent era.

Start Here

Quater starts from a simple belief: AI agents need a better interface to software than screens meant for humans. The answer is not to bypass your backend. The answer is to expose the right backend views directly, with clear inputs and real safety boundaries.

This site documents Quater's current 0.x API. If you are evaluating the framework, start with the Quickstart, then read the Manual to understand how HTTP, MCP, and CLI access fit together.

Prerequisites: Python 3.11 or newer, async Python basics, and enough HTTP knowledge to read request and response examples.

One View, Three Ways To Call It

python
from quater import AuthConfig, AuthContext, Quater, Request


async def authenticate(request: Request) -> AuthContext | None:
    if request.headers.get("authorization") != "Bearer demo-token":
        return None
    return AuthContext(subject="demo-user")


app = Quater(auth=[AuthConfig(authenticate, surfaces=["api", "mcp", "cli"])])


@app.get(
    "/orders/{order_id}",
    tool=True,
    cli=True,
    description="Fetch one order by id.",
)
async def get_order(order_id: str, request: Request) -> dict[str, object]:
    assert request.auth is not None
    return {
        "order_id": order_id,
        "subject": request.auth.subject,
        "source": request.context.source,
    }

Run it:

bash
python -m pip install quater
quater dev main.py

If you use uv, install with uv add quater instead.

Expected server output:

text
[INFO] Starting granian
[INFO] Listening at: http://127.0.0.1:8000
  1. Call it as HTTP:
bash
curl -H "Authorization: Bearer demo-token" \
  http://127.0.0.1:8000/orders/ord_1001
  1. Call it as an MCP tool:
bash
curl http://127.0.0.1:8000/mcp \
  -H "Authorization: Bearer demo-token" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_order","arguments":{"order_id":"ord_1001"}}}'
  1. Call it from the CLI:
bash
export QUATER_APP=main:app
export QUATER_TOKEN=demo-token
quater call get_order --order-id ord_1001

All three calls reach the same handler. The source value tells you which surface called it: api, cli, or mcp.

Also See

Released under the MIT License.