Skip to main content

agent-webkit-server

Server-side toolkit for exposing the Claude Agent SDK over HTTP+SSE. One Python package; bundled adapters cover the common deployment shapes.

Install

pip install agent-webkit-server                # core only
pip install "agent-webkit-server[fastapi]"     # + FastAPI HTTP adapter
pip install "agent-webkit-server[postgres]"    # + PgSessionStore
pip install "agent-webkit-server[fastapi,postgres]"

Core

Framework-agnostic primitives — no FastAPI, no asyncpg until you opt in.

from agent_webkit_server import PROTOCOL_VERSION
from agent_webkit_server.session import SessionRegistry, SessionConfig
from agent_webkit_server.event_log import EventLog
from agent_webkit_server.sdk_bridge import (
    PermissionRouter,
    build_can_use_tool,
    translate_sdk_messages,
)

These pieces are what you'd otherwise reimplement: per-session inbound queue + receive-loop, append-only event log with multi-subscriber fan-out, permission/AskUserQuestion correlation router, the can_use_tool wiring, and the SDK→wire-event translator.

FastAPI adapter

from agent_webkit_server.adapters.fastapi import create_app
from agent_webkit_server.auth import AuthConfig

app = create_app(auth=AuthConfig.from_env())

Exposes:

  • POST /sessions
  • GET /sessions/{id}/stream (SSE, with Last-Event-ID resume)
  • POST /sessions/{id}/input (every inbound message type)
  • DELETE /sessions/{id}

Postgres adapter (PgSessionStore)

Plug into the SDK directly via ClaudeAgentOptions(session_store=...):

from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
from agent_webkit_server.adapters.pg_session_store import PgSessionStore

store = await PgSessionStore.connect("postgresql://...")
options = ClaudeAgentOptions(session_store=store, resume=session_id)
client = ClaudeSDKClient(options=options)

Passes the SDK's published run_session_store_conformance suite plus adapter-specific contracts (uuid idempotency, concurrent-append serialization, multi-tenant isolation).

Wire protocol

Documented in docs/wire-protocol.md. The Pydantic models in agent_webkit_server.models are the canonical schema.

Release files for agent-webkit-server 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-webkit-server 0.2.0
File Size Uploaded
agent_webkit_server-0.2.0.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-webkit-server 0.2.0
File Interpreter ABI Platform
agent_webkit_server-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.0 kB

Release files / agent_webkit_server-0.2.0.tar.gz

Download URL agent_webkit_server-0.2.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d848a16c70ca6842269a971e6477b3cc431076cd7fe225f3774664ef743cbe92
BLAKE2b-256 checksum
How to use checksums
389ef75f18588591d1e20d03a73b6505a8ece4927545b1b19a3b75a1e48c72bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release files / agent_webkit_server-0.2.0-py3-none-any.whl

Download URL agent_webkit_server-0.2.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a37b7ba25622744040d250748f235ee8a71df3b092cbdaa54b0765b41d00a82e
BLAKE2b-256 checksum
How to use checksums
10f6dc2b07d9ad67fd7e3743c2b322499bdcdf48d945eff0930e2926feefee12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release 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