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.1.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 cliver-playbook-app-mcp 0.1.0
File Size Uploaded Provenance
cliver_playbook_app_mcp-0.1.0.tar.gz 58.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 100.5 kB

Release files / cliver_playbook_app_mcp-0.1.0.tar.gz

Download URL cliver_playbook_app_mcp-0.1.0.tar.gz
Size 58.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5ea8d3b0b1d5ba1d1a2239c9d7aaf761e8b0b6016f78d0ebb49fc2aa4a2b2b04
BLAKE2b-256 checksum
How to use checksums
9f74f5df9ae2518a84f416b52e8b741631eb7ebd17b4113cf30c6ce6f0b31b77
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":"24.04","id":"noble","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.1.0-py3-none-any.whl

Download URL cliver_playbook_app_mcp-0.1.0-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0df434d28a9f1b866f4b6fae01f2b147a5624f4e1390a4428b6fd203c6972524
BLAKE2b-256 checksum
How to use checksums
c3c822e73309b9da184138a0414e3cd25c07cfed3a07d9507a901588e766fe5f
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":"24.04","id":"noble","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.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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