This release is a pre-release and may not be stable for production use.
MCP Event Subscriptions
An experimental, portable subscription record for MCP Events, with an optional JWE encrypted envelope.
Store the same record in a database, a key-value store, or an upstream webhook configuration. This repository defines its fields, encrypted encoding, and validation rules, with a Python reference implementation and conformance vectors.
Independent proposal. This is not an adopted MCP specification or an IETF RFC. The format may change before a stable release. It does not change MCP event requests or notification payloads.
What is here
- Record specification and JSON Schema.
- Encrypted envelope profile: JWE Compact,
dir+A256GCM, with explicit server/tenant/resource binding. - Appwrite webhook profile: proposed storage mapping and the limits of write-only upstream state.
- Examples and conformance vectors.
- Python reference implementation.
- Upstream discussion draft.
Install the alpha release
Available on PyPI for Python 3.12 or newer:
pip install mcp-event-subscriptions==0.1.0a1
See RELEASING.md for the Trusted Publishing setup and release process.
Quick start
Python 3.12 or newer and uv:
uv sync --group dev
uv run python examples/roundtrip.py
uv run python -m unittest discover -s tests -v
import json
import secrets
from mcp_event_subscriptions import seal, open_envelope
record = json.load(open("examples/subscription.json"))
context = {
"server": "https://mcp.example.com",
"tenant": "project_demo",
"resource": record["id"],
}
keys = {"k1": secrets.token_bytes(32)}
token = seal(record, keys, active_key="k1", context=context)
restored = open_envelope(token, keys, expected_context=context)
assert restored == record
The sample subscription expires in 2030. Examples and vectors use synthetic principals and secrets. Fixed test-vector keys are public fixtures, never production keys.
Scope
Version 1 describes webhook and push subscription state and optional encrypted storage. It does not specify a SQL layout, implement a delivery queue, establish current caller authorization, or make refresh/delete operations atomic. Adapters must provide their own coordination and revocation checks. Encryption cannot detect replay of an older, still-valid envelope without current state.
The Appwrite profile is documentation, not a working Appwrite adapter. It is not
wire-compatible with the existing v1.<kid>.<ciphertext> envelope in
appwrite/mcp PR #132.
Discussing the proposal
Start with the open questions: which fields should be common, whether an encrypted profile belongs alongside the schema, and what lifecycle guarantees adapters must expose. No proposal has been submitted upstream by this repository.
Development
uv run --group dev ruff check .
uv run --group dev black --check .
uv run python -m unittest discover -s tests -v
uv build
Licensed under the MIT License. See SECURITY.md before using the reference implementation with real secrets.
Metadata
Release files for mcp-event-subscriptions 0.1.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_event_subscriptions-0.1.0a2.tar.gz | 76.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_event_subscriptions-0.1.0a2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.7 kB
Release files / mcp_event_subscriptions-0.1.0a2.tar.gz
| Download URL | mcp_event_subscriptions-0.1.0a2.tar.gz |
|---|---|
| Size | 76.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d5a5698bd333752a2afdbad720b6d65a239dd094b9578e850a0cfb42e7b74f8
|
|
BLAKE2b-256 checksum How to use checksums |
06d199ee4c8d4548ba8a6ff36da64ed95cc5517f8b0536064df03546e3457359
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 12, 2026.
Transparency logRelease files / mcp_event_subscriptions-0.1.0a2-py3-none-any.whl
| Download URL | mcp_event_subscriptions-0.1.0a2-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abe6d58ea312d3c93579584d795dd06a6b541376e592d7a869bd035acaabc7fb
|
|
BLAKE2b-256 checksum How to use checksums |
cec5703027fb759e9b1bac49a20c303830ef98949ec01db5f75840e2b4da4537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 12, 2026.
Transparency log