Server-side toolkit for the Claude Agent SDK over HTTP+SSE: session lifecycle, permission routing, SDK bridge, plus bundled FastAPI and Postgres adapters.
Project description
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 /sessionsGET /sessions/{id}/stream(SSE, withLast-Event-IDresume)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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_webkit_server-0.2.0.tar.gz.
File metadata
- Download URL: agent_webkit_server-0.2.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d848a16c70ca6842269a971e6477b3cc431076cd7fe225f3774664ef743cbe92
|
|
| MD5 |
aaf3b8228ef2cdb4de880b8e83c338e9
|
|
| BLAKE2b-256 |
389ef75f18588591d1e20d03a73b6505a8ece4927545b1b19a3b75a1e48c72bc
|
Provenance
The following attestation bundles were made for agent_webkit_server-0.2.0.tar.gz:
Publisher:
release-pypi.yml on BlitzJB/agent-webkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_webkit_server-0.2.0.tar.gz -
Subject digest:
d848a16c70ca6842269a971e6477b3cc431076cd7fe225f3774664ef743cbe92 - Sigstore transparency entry: 1395436438
- Sigstore integration time:
-
Permalink:
BlitzJB/agent-webkit@6e4a78fa5a06fefd17c66b8b6894191ce81fd3f0 -
Branch / Tag:
refs/tags/py-v0.2.0 - Owner: https://github.com/BlitzJB
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@6e4a78fa5a06fefd17c66b8b6894191ce81fd3f0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_webkit_server-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agent_webkit_server-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a37b7ba25622744040d250748f235ee8a71df3b092cbdaa54b0765b41d00a82e
|
|
| MD5 |
5680356019422f2babaccb6b1fb7f351
|
|
| BLAKE2b-256 |
10f6dc2b07d9ad67fd7e3743c2b322499bdcdf48d945eff0930e2926feefee12
|
Provenance
The following attestation bundles were made for agent_webkit_server-0.2.0-py3-none-any.whl:
Publisher:
release-pypi.yml on BlitzJB/agent-webkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_webkit_server-0.2.0-py3-none-any.whl -
Subject digest:
a37b7ba25622744040d250748f235ee8a71df3b092cbdaa54b0765b41d00a82e - Sigstore transparency entry: 1395436468
- Sigstore integration time:
-
Permalink:
BlitzJB/agent-webkit@6e4a78fa5a06fefd17c66b8b6894191ce81fd3f0 -
Branch / Tag:
refs/tags/py-v0.2.0 - Owner: https://github.com/BlitzJB
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@6e4a78fa5a06fefd17c66b8b6894191ce81fd3f0 -
Trigger Event:
push
-
Statement type: