Skip to main content

sealedplan-mcp

Serve a sealedplan runtime's actions as MCP tools, following the MCP binding of the contract. Needs the MCP Python SDK 2.3 or later (protocol 2026-07-28).

pip install sealedplan-mcp
from sealedplan_mcp import create_server

server = create_server(rt, agent=AGENT)  # rt: a Runtime with actions registered
server.run()  # stdio

Each registered action becomes one tool. sql.update_row becomes sql_update_row, and its arguments are the action's plan() parameters. A call never changes the target system directly.

What a tool call does

Policy decision Result
auto The change is drift-checked and applied. The Applied record is in _meta["io.github.sealedplan/plan-apply"].
approve, two_person input_required. A person approves the plan hash out of band, for example with sealedplan approve <hash prefix>. The client's retry then drift-checks and applies.
deny A tool error with the plan hash and the policy's reasons.

If the system changed after approval, the retry returns a tool error listing the failed preconditions, and nothing is written.

After an apply, the result text and the metadata say if a field ended up different from the plan (deviation) or a resource could not be checked (unchecked). A repeated call for a plan that is already applied reports them again.

While the plan waits, a client that supports elicitation shows the person a message saying how to approve. Answering that message is not an approval: the server reads approvals only from its own store. A client without elicitation gets a state-only input_required and retries on its own.

Approval page (URL mode)

The recommended channel (SPEC §12.4): the person decides on a web page where they sign in, not in the agent's client. Serve the page and tell the MCP server where it is:

from sealedplan_mcp import create_server
from sealedplan_mcp.approval_page import approval_app


def identity(request):  # your sign-in, e.g. a header your proxy verified
    user = request.headers.get("x-verified-user")
    return Principal(id=user, issuer="https://idp.example.com", kind="human") if user else None


page = approval_app(rt, authenticate=identity, secret=PAGE_SECRET)  # a Starlette app
server = create_server(
    rt, agent=AGENT, approval_url="https://approve.example.com/plans/{plan_hash}"
)

A client that supports URL-mode elicitation is sent to approval_url for the plan. Opening it is still not an approval. The page shows the stored, hash-verified plan as sealedplan show prints it, and records the person's approve or reject in the store with method: "url". Then the client's retry applies.

  • The page never decides who the person is: authenticate returns the approver, or None to refuse. Only kind="human" principals may decide.
  • Forms carry a token bound to the person and the plan, keyed by secret. Without a secret, a random key is made per process; pass one when you run several replicas.
  • Serve the page and the MCP server from one process: they share the runtime and lock around it (runtime_lock).
  • Clients without URL mode get the out-of-band message, which names approve_hint.

Explicit mode

An agent that knows the extension can ask for a plan first:

"_meta": { "io.github.sealedplan/plan-apply": { "mode": "plan" } }

The plan comes back in structuredContent. To apply, call the same tool with the same arguments and {"mode": "apply", "plan_hash": "sha256:…"}. The server refuses if the arguments do not produce the stored plan's params.

Request state

requestState carries the plan hash and the plan's expiry. The MCP SDK encrypts it and binds it to the tool, the arguments and the authenticated client. By default the key lives only as long as the process; pass request_state_security=RequestStateSecurity(keys=[...]) to keep pending calls across restarts or replicas.

Who is the agent

agent= is the principal recorded as the plan's agent. Pass a Principal, or a function that takes the MCP request context and returns one, for example from the client's token.

Metadata

Release files for sealedplan-mcp 0.1.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 sealedplan-mcp 0.1.1
File Size Uploaded Provenance Actions
sealedplan_mcp-0.1.1.tar.gz 14.6 kB With provenance Details for sealedplan_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sealedplan-mcp 0.1.1
File Interpreter ABI Platform Actions
sealedplan_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for sealedplan_mcp-0.1.1-py3-none-any.whl

Total release size: 31.8 kB

Release files / sealedplan_mcp-0.1.1.tar.gz

Download URL sealedplan_mcp-0.1.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
57efce045b3241ede529fb014695446bf74cb04fef8ef125245c19a8f888f723
BLAKE2b-256 checksum
How to use checksums
9b946226a25d3b2771f9af339dbc5e10ae247ea0abfdca857c0a642fc59877e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Release files / sealedplan_mcp-0.1.1-py3-none-any.whl

Download URL sealedplan_mcp-0.1.1-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7911272cf53f3bfdf845537d9b0f0bbf238f27912267e619743ef1d3f27236c4
BLAKE2b-256 checksum
How to use checksums
25f2dd107904f6b5e1a8e53b052d74eb3f734de1ac615a6815e07b450f533e56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for sealedplan-mcp 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sealedplan_mcp-0.1.1.tar.gz

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 Nov 30, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

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