Skip to main content

CAIAO — Server-as-atomic-unit framework for tool orchestration

Project description

CAIAO

Server-as-atomic-unit framework for tool orchestration.

CAIAO turns every solver, tool, or external capability into an independent Server process. The Hub discovers, routes, and manages them. Add a new capability by writing one Server file and registering it — no core code changes.


Two paths, same contract

MCP SDK Path Lightweight Path
What pip install "git+https://github.com/LaobaiAi/CAIAO.git#subdirectory=caiao" Copy 3 files into your project
Dependencies mcp>=1.0.0 Python stdlib only
Async Full asyncio lifecycle Synchronous, in-process or subprocess
Best for Production platforms, team projects, AI ecosystem Embedded Python (Abaqus/Blender), prototypes, CLI tools
Upgrade path Replace ~10 lines to switch to MCP SDK

Quickstart (MCP SDK path)

pip install "git+https://github.com/LaobaiAi/CAIAO.git#subdirectory=caiao"
from caiao import CAIAOClientHub
from caiao.discovery import discover_server_configs

configs = discover_server_configs(servers_dir="./servers")
hub = CAIAOClientHub(configs)
await hub.start_all()
result = await hub.call_tool("my_tool", {"param": "value"})

Create a new project:

caiao init my-project
cd my-project
caiao new server my-solver
# → servers/my-solver/server.py + caiao.yaml

Quickstart (Lightweight path)

Copy caiao_lightweight/server.py, hub.py, subprocess.py into your project.

from server import CAIAOServer, tool
from hub import Hub

class MyServer(CAIAOServer):
    name = "my_server"

    @tool
    def greet(self, args: dict) -> dict:
        return {"hello": args.get("name", "world")}

hub = Hub()
hub.register(MyServer())
result = hub.call_tool("greet", {"name": "CAIAO"})

Project structure (after caiao init)

my-project/
├── servers/                # All CAIAO Servers live here
│   └── my-solver/
│       ├── server.py       # MCP Server with list_tools/call_tool
│       └── caiao.yaml      # Declarative manifest
├── gateway/                # Application entry point (optional)
│   └── main.py             # Hub initialization + API
├── caiao/                  # (lightweight only) Framework files
├── caiao.yaml              # Project-level config
└── requirements.txt

CLI commands

caiao init <name>            Create a new CAIAO project
  --lightweight              Use zero-dependency lightweight path
caiao new server <name>      Scaffold a new Server
  --kind atomic-mcp          Default: standard Server
  --kind composite           Pipeline orchestration Server
caiao validate               Validate all caiao.yaml manifests
caiao list                   List all Servers with status
caiao doctor                 Check environment (Python, MCP SDK, etc.)

How it works

User → Application → Hub.call_tool("analyze", {...})
                         │
                         ├─→ Local handler? ──→ Execute in-process
                         ├─→ Tool registry? ──→ Route to Server subprocess
                         ├─→ Lazy? ───────────→ Start Server on-demand
                         └─→ Not found? ──────→ Semantic fuzzy match

Each Server is an independent process communicating via stdio JSON-RPC (MCP protocol). The Hub manages the full lifecycle: start, stop, restart, health check, metrics.


Exit mechanism

CAIAO is designed to be removable. Your Servers are standard MCP servers — they import from mcp.server, not from caiao.

To remove CAIAO:

  1. pip uninstall caiao (or delete caiao_lightweight/ directory)
  2. Replace Hub calls in your application with direct MCP Session connections
  3. Your Servers continue to work unchanged — each is a standalone MCP server

No server code changes required. The framework is a convenience layer, not a hard dependency.


Documentation

Full documentation at caiao-knowledge-base/ (this repository):

  • Core concepts and design principles
  • Server patterns and reusable code patterns
  • Development guides for both implementation paths
  • Protocol specification v1.0
  • Operations manuals (merge, test, review, absorb)

Requirements

  • Python >= 3.11
  • MCP SDK path: pip install mcp
  • Lightweight path: Python stdlib only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caiao-1.0.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caiao-1.0.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file caiao-1.0.1.tar.gz.

File metadata

  • Download URL: caiao-1.0.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for caiao-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9a6b02e12915995310e2a98cfc7af494d8a34c11819a229d3822e56cf2f0eb7f
MD5 56e4f163eb48332a9f7691a1e468faeb
BLAKE2b-256 c5b20d340e7e000b194af985200c46ae30cbd03980aea1d6d268e7f537ec1a67

See more details on using hashes here.

File details

Details for the file caiao-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: caiao-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for caiao-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c10f39bbe0237c69aba6fa0ef20bc05623cca2f590fccea2c7005ee5a537d05d
MD5 6f3a7575d9f95c4e1ee5c8e78862ed18
BLAKE2b-256 f6ac1a1d1a0d70f33585dd264d6c75df7e070b89a756a050ef5e6be3b0c8abef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page