Skip to main content

Cavi MCP Core

Shared plumbing for the CAVI MCP servers (blender-mcp, substance-mcp, houdini-mcp, adobe-mcp): one server type, one failure contract, one schema compaction, one bounded process runner, bounded file reads and an operation journal.

Install

uv add cavi-mcp-core

Requires Python 3.11+ and the MCP Python SDK 2.

Server

from cavi_mcp_core.server import READ_ONLY, Server

mcp = Server("my-mcp", package="my-mcp", instructions="Inspect before editing.")


@mcp.tool(annotations=READ_ONLY)
async def status() -> dict:
    return {"ready": True}

Server extends mcp.server.mcpserver.MCPServer:

  • package sets the reported server version from that distribution's metadata.
  • Tool schemas are compacted (compact=False keeps the SDK's schemas).
  • ValueError, RuntimeError and OSError raised by a tool reach the caller with their text; any other exception is logged on the server and reported without details. Pass anticipated=() to leave tool errors to the SDK.
  • Every tool error, including an unknown tool name, returns one structured result:
{"error": {"version": 1, "code": "INVALID_ARGUMENT", "operation": "status",
           "outcome": "rejected", "retry_safe": false, "next_action": "inspect_inputs"}}

outcome is rejected only for invalid arguments, missing inputs and unknown tools; anything else is unknown, and retry_safe is always false. Raise contracts.OperationRejected(message, code) or contracts.OperationUnknown(message, code) to report a specific code. Override Server.failure to name a different recovery tool for unknown outcomes.

need(value, name, action) and reject_foreign(action, given, allowed) validate action-style arguments. READ_ONLY, WRITES and DESTRUCTIVE are the tool annotations.

Contracts

contracts.Result is a strict pydantic model whose unset optional fields stay off the wire. contracts.VariantResult accepts one of several declared field sets (shapes) without a discriminator field.

Schemas

schema.compact_schema(schema, output=False) returns a copy without titles or additionalProperties: true, with equivalent union forms shortened, and validates the same values; output=True also drops defaults, which are documentation only in a response. schema.validate_variant and schema.variant_schema back VariantResult.

Processes

proc.run(args, timeout) runs a command with bounded output and one deadline. On a timeout or a cancellation it stops the whole process group (process tree on Windows) and returns once the process exits. proc.run_sync is the blocking form and proc.diagnostics(result) formats what a failed run printed.

Files and journals

files.inside(workspace, path) resolves a path inside an existing workspace and refuses .., escapes through symbolic links and the workspace root. files.read_bytes, files.load_json and files.digest read bounded regular files and refuse a file that changes while it is read; files.parse_json refuses NaN and Infinity.

journal.write_json replaces a JSON file atomically, durably and readable only by its owner. journal.completion reads the completion receipt of one operation, journal.archive records how an interrupted operation was resolved, and journal.fingerprint hashes canonical JSON.

Development

uv sync --locked --dev
uv run --locked python -m unittest discover -s tests
uv run --locked ruff check .

License

MIT

Metadata

Release files for cavi-mcp-core 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 cavi-mcp-core 0.1.0
File Size Uploaded Provenance Actions
cavi_mcp_core-0.1.0.tar.gz 19.9 kB With provenance Details for cavi_mcp_core-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cavi-mcp-core 0.1.0
File Interpreter ABI Platform Actions
cavi_mcp_core-0.1.0-py3-none-any.whl Python 3 none any Details for cavi_mcp_core-0.1.0-py3-none-any.whl

Total release size: 34.1 kB

Release files / cavi_mcp_core-0.1.0.tar.gz

Download URL cavi_mcp_core-0.1.0.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1c62df88fa84323a1db3281586b3322739c9c81856ac6b2ec54efece786460dc
BLAKE2b-256 checksum
How to use checksums
99310184de98208fd875a65dbb32750808893531c0bd3b402eeadaa917613dce
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 4, 2026.

Transparency log

Release files / cavi_mcp_core-0.1.0-py3-none-any.whl

Download URL cavi_mcp_core-0.1.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10687e0468a12a09a6ee691c6e049d0fb1ee89ff8700260398fe2ca2bb4dcd0f
BLAKE2b-256 checksum
How to use checksums
bbad14d33d1b4f86e6e049d1cec5223452e30ac786e09afda16652e4c5b5805f
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 4, 2026.

Transparency log

Security for cavi-mcp-core 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cavi_mcp_core-0.1.0.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 4, 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.0 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