Skip to main content

cliver-playbook-app-mcp

MCP package of the cliver-playbook library — serves the Model Context Protocol over streamable HTTP and stdio, with an optional bearer gate, agent identity on every audit row, and the identity package's OAuth 2.1 provider as the way agents obtain tokens.

Builds on cliver-playbook-app-user (and through it on cliver-playbook-app-basic): it subclasses the user package's Settings, uses the basic package's runtime and declarative base, reads the identity tables, and contributes its own ROUTERS and self-application. It owns no tables and no migration chain.

What is inside

Area Path (under src/cliver_playbook/app/mcp/) Notes
Settings settings.py Settings(user.Settings) + the mcp block (auth switch, agent-type allowlist, concurrency).
Routers api/routes.py ROUTERS: list[APIRouter] — the protocol endpoint at /mcp and /api/v1/mcp views (ADR-0017).
Protocol endpoint api/streamable.py The SDK's ASGI endpoint as a plain route; the session manager is installed and entered here.
Gate auth.py MCPGateMiddleware: 401 + RFC 9728 pointer, 403 for a forced password change, viewer resolution.
Tools tools/, toolkit.py echo and user_directory as worked examples: @public_tool() / @require_perm(...) write the audit row.
Audit audit.py MCP events on the identity package's audit_logs (viewer + agent + outcome).
Transports transport.py, __main__.py `python -m cliver_playbook.app.mcp --transport stdio
Application app.py create_app() composes basic + user + mcp; configure_runtime() for app-less entry points.

The mcp:* permission codes register themselves into the identity package's catalog when this package is imported, so a composed install seeds them for the admin role and a user-only install never sees them (ADR-0017).

Install

python -m pip install -e ../cliver-playbook-app-basic  # dependency first
python -m pip install -e ../cliver-playbook-app-user
python -m pip install -e .
# or in one command: pip install -e ../basic -e ../user -e .

Editable installs of sibling packages coexist in one virtualenv: the cliver_playbook and cliver_playbook.app namespace directories are PEP 420 — deliberately no __init__.py — so every package's portion merges.

Run standalone

docker compose up -d db        # or point CLIVER_DATABASE_URL at PostgreSQL
python -m cliver_playbook.app.mcp --transport http --port 8100   # full app: API + /mcp + OAuth
python -m cliver_playbook.app.mcp --transport stdio              # one stdio session on stdin/stdout

The default deployment is in-process: the composed application serves /mcp next to the API on one port. The stdio transport is for agents that spawn a process and speak JSON-RPC over pipes; with mcp.auth_enabled it reads the bearer token from MCP_BEARER_TOKEN and refuses to start if that token is missing, unknown or belongs to a user who must change their password.

Migrate

No chain of its own. Apply the dependencies':

python -c "
from cliver_playbook.app.basic.alembic import run_migrations_online
from cliver_playbook.app.user.alembic import run_migrations_online as run_user
run_migrations_online(); run_user()
"

Test

python -m pytest        # needs PostgreSQL; creates and drops a temp database

The suite binds the composed application (create_app) and applies both migration chains. It includes the composition guard (no mounted sub-app, no duplicate route, /mcp served as a plain route) and real-transport tests that spawn uvicorn and stdio subprocesses against a real port and real pipes. tests/fixtures/app.yaml supplies the configuration layer (pinned via CLIVER_CONFIG_FILE), keeping the suite independent of the surrounding checkout's app.yaml.

Metadata

Release files for cliver-playbook-app-mcp 0.3.1

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

Source distribution (sdist)

Source distribution for cliver-playbook-app-mcp 0.3.1
File Size Uploaded Provenance Actions
cliver_playbook_app_mcp-0.3.1.tar.gz 58.3 kB Without provenance Details for cliver_playbook_app_mcp-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cliver-playbook-app-mcp 0.3.1
File Interpreter ABI Platform Actions
cliver_playbook_app_mcp-0.3.1-py3-none-any.whl Python 3 none any Details for cliver_playbook_app_mcp-0.3.1-py3-none-any.whl

Total release size: 100.8 kB

Release files / cliver_playbook_app_mcp-0.3.1.tar.gz

Download URL cliver_playbook_app_mcp-0.3.1.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
891b901a80656960b5af7711126c95c1a93fcc2de8f9a992919b8c9688fe4de3
BLAKE2b-256 checksum
How to use checksums
148aa7a0f8498978b70083a4f736410a4e8aed4bf486081a464d7b1ac3fd585e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cliver_playbook_app_mcp-0.3.1-py3-none-any.whl

Download URL cliver_playbook_app_mcp-0.3.1-py3-none-any.whl
Size 42.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab6d5cc1ce36d24da2be77b8058628128e50859caf653d8808db9ee98073a2d9
BLAKE2b-256 checksum
How to use checksums
6cf22a54f61d961569b7327ccff769ee420910309c994198c74c5ccd148a43a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cliver-playbook-app-mcp 0.3.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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