Skip to main content

daimon-sdk

Typed async Python SDK for processd-mcp and processd-sandbox-manager.

daimon-sdk wraps the raw MCP tool surface exposed by processd-mcp and presents it as grouped Python APIs such as client.files.read() and client.exec.start_session(). The SDK keeps processd-standalone as the contract source of truth and focuses on:

  • connection and token wiring
  • manager sandbox lifecycle helpers
  • typed request/response handling
  • structured tool error mapping
  • interactive session helpers
  • compatibility tests against a real processd-mcp binary

Install

pip install daimon-sdk

For local development:

pip install -e ".[dev]"

Quickstart

With a sandbox manager:

import asyncio

from daimon_sdk import DaimonManagerClient


async def main() -> None:
    async with DaimonManagerClient("http://127.0.0.1:18080") as manager:
        async with manager.sandbox() as sandbox:
            runtime = await sandbox.runtime.get_context()
            print(runtime.base_workdir)

            result = await sandbox.exec.bash("python3 --version")
            print(result.stdout or result.stderr)


asyncio.run(main())

If you already have a sandbox MCP URL and token, connect directly to MCP:

import asyncio

from daimon_sdk import DaimonClient


async def main() -> None:
    async with DaimonClient("http://127.0.0.1:8080/mcp") as client:
        runtime = await client.runtime.get_context()
        print(runtime.base_workdir)

        result = await client.files.glob("**/*.rs", path=runtime.base_workdir)
        print(result.filenames[:5])

        bash = await client.exec.bash("printf 'hello from processd\\n'")
        print(bash.stdout)


asyncio.run(main())

Raw MCP vs SDK

Raw MCP:

payload = await mcp_client.call_tool("Read", {"file_path": "/tmp/demo.txt"})

SDK:

read = await client.files.read("/tmp/demo.txt")
print(read.file.content)

API Overview

  • DaimonClient(base_url, access_token=None, timeout_s=30.0)
  • await client.connect() / await client.close()
  • async with DaimonClient(...) as client
  • client.runtime.get_context()
  • client.files.read() / write() / edit() / glob() / grep()
  • client.exec.bash() / start_session()
  • SessionHandle.write() / poll() / wait_for_exit() / close()
  • client.web.fetch()
  • client.raw.call_tool()
  • DaimonManagerClient(base_url, access_token=None, timeout_s=30.0)
  • await manager.health()
  • await manager.capacity()
  • await manager.create_sandbox()
  • await manager.list_sandboxes(labels=..., states=...)
  • await manager.find_sandbox(labels={"thread_id": thread_id})
  • await manager.find_or_create_sandbox(labels={"thread_id": thread_id})
  • await manager.get_sandbox(id)
  • await manager.start_sandbox(id) / stop_sandbox(id) / delete_sandbox(id)
  • await manager.update_sandbox(id, ttl_seconds=...)
  • async with manager.sandbox() as sandbox
  • await sandbox.set_ttl(ttl_seconds)
  • sandbox.service_ports
  • sandbox.get_service_port(port)
  • sandbox.runtime/files/exec/web/raw

manager.sandbox() creates a sandbox, connects to its MCP endpoint, and deletes it on context exit by default. Use delete_on_exit=False or create_sandbox() when the workspace should survive beyond the context. find_sandbox(labels=...) is a read-only lookup by default and does not extend the sandbox TTL. Pass ttl_seconds=... only when you intentionally want the manager's compatibility renew behavior, or use find_or_create_sandbox(...) for normal acquire/renew flows. ttl_seconds=0 marks a sandbox as immediately expired so the next manager reaper loop deletes it.

Sandbox Service Ports

When a sandbox runs a service on a manager-configured port, the SDK exposes the connection information and leaves the request itself to your HTTP or WebSocket client:

import httpx

async with manager.sandbox() as sandbox:
    web = sandbox.get_service_port(3000)

    response = httpx.get(web.url + "hello.txt", headers=web.headers)
    print(response.text)

ServicePortInfo contains only port, url, token, and headers.

Local Testing

The SDK compatibility tests expect a sibling checkout of processd-standalone:

e2b-project/
  processd-standalone/
  processd-sdk/

Run tests with an environment that already has the dev dependencies installed:

PYTHONPATH=src python -m pytest -q

The E2E suite builds and launches ../processd-standalone/target/debug/processd-mcp.

Manager E2E uses the sibling processd-standalone Docker manager compose path:

PROCESSD_SDK_MANAGER_E2E=1 PYTHONPATH=src python -m pytest -q -m manager_e2e

Release

Releases are published from GitHub Actions when a tag matching v* is pushed.

git tag v0.4.0
git push origin v0.4.0

The tag version must match pyproject.toml's project version.

Download files

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

Source Distribution

daimon_sdk-0.5.4.tar.gz (89.5 kB view details)

Uploaded Source

Built Distribution

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

daimon_sdk-0.5.4-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file daimon_sdk-0.5.4.tar.gz.

File metadata

  • Download URL: daimon_sdk-0.5.4.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for daimon_sdk-0.5.4.tar.gz
Algorithm Hash digest
SHA256 334c5aac8a7dc2c5bc16eda4261fe509505551228576f9d25687a75d7e222291
MD5 ffec5f542e48fd14d3541ffdb42886cd
BLAKE2b-256 5e629a52a657c50980c4afef7940e43085cec52c0cea16eb392d34e42b0def75

See more details on using hashes here.

Provenance

The following attestation bundles were made for daimon_sdk-0.5.4.tar.gz:

Publisher: publish.yml on daimon-hq/processd-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file daimon_sdk-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: daimon_sdk-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for daimon_sdk-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 25435bf5a43621e4fb65d74a5f4a678c78a44af22923415a858122525b957da6
MD5 0a24459d4b989663c188df892ace690e
BLAKE2b-256 8e0f51c0ab6cb9cf87bfafb96bae9ea2186589852975452c2ab5ab9d77266d0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for daimon_sdk-0.5.4-py3-none-any.whl:

Publisher: publish.yml on daimon-hq/processd-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page