Skip to main content

Arbitype

Typed decision tools for AI agents.

Classify · Score · Verify · Gate · Route · Review

MCP-native · Powered by TypeSafe Jev

CI Latest release Arbitype PyPI publication pending MIT license Python 3.10 or newer MCP 2026-07-28

Arbitype MCP Registry publication pending Arbitype Glama crawl pending

Quick start · Why Arbitype? · Tools · Host setup · Configuration · Engineering benchmark

Arbitype is an MCP-native typed decision layer for AI agents, powered by TypeSafe Jev. It turns probabilistic judgments into structured decision primitives that an agent or program can consume directly.

Quick start

The shortest path is a local STDIO server launched by uvx:

export TYPESAFE_API_KEY="your-key"
uvx arbitype

The API key stays in the process environment. It is not an MCP argument and is never printed to standard output.

Install a pinned release with:

uvx --from 'arbitype==0.6.0' arbitype

Or run the repository checkout:

git clone https://github.com/Renwang-Huang/arbitype.git
cd arbitype
export TYPESAFE_API_KEY="your-key"
python3 server.py

Why Arbitype?

Generative models are excellent at prose, code, and open-ended generation. Agent workflows also need bounded decisions that software can branch on:

free-form state
      ↓
  TypeSafe Jev
      ↓
probabilistic judgment
      ↓
    Arbitype
      ↓
typed decision + probability
      ↓
agent / code branch

Arbitype provides that decision layer over MCP. It exposes short, host-neutral primitives for classification, scoring, verification, routing, review, and fail-closed gate signals. The result is structured data, not a paragraph that an agent must interpret again.

Architecture

flowchart LR
    host["AI Agent / MCP Host<br/>Codex · Claude · Cursor · VS Code"]
    arbitype["Arbitype<br/>Typed decision tools"]
    jev["TypeSafe Jev<br/>System One Model"]
    env["TYPESAFE_API_KEY<br/>process environment"]

    host -->|MCP| arbitype
    arbitype -->|validated HTTPS| jev
    jev -->|typed probabilistic judgment| arbitype
    arbitype -->|structured decision| host
    env -. credential .-> arbitype

The public product is Arbitype; TypeSafe Jev is the current provider. Provider configuration intentionally keeps the TYPESAFE_* names because the credential and endpoint belong to TypeSafe.

Tools

Arbitype advertises nine read-only, idempotent MCP tools:

Tool Input shape Output
evaluate state + TypeSafe questions map Raw typed Jev response
classify state + instructions + labels Choice and probability distribution
score state + instructions + ordered levels Weighted score and distribution
check state + yes/no criteria Noul probability
verify state + claims map Noul answer per claim
gate state + checks + thresholds pass, review, or fail signal
route state + actions map One suggested next action; no execution
review state + checks + thresholds Review decision and evidence
health Optional live boolean Local configuration; live request only when explicit

For raw Noul questions, provide non-empty instructions or at least one non-empty true/false criterion. Score levels must be non-null structured values. These provider-level constraints are validated locally before a paid request.

Probabilities and confidence are model signals, not proof. gate and review are advisory decision transformations, not authorization systems, security boundaries, or approval engines.

Host setup

Arbitype uses standard MCP STDIO. For a host that accepts an installed command:

[mcp_servers.arbitype]
command = "arbitype"
env_vars = ["TYPESAFE_API_KEY"]
startup_timeout_sec = 10
tool_timeout_sec = 60
default_tools_approval_mode = "prompt"

For a checkout:

[mcp_servers.arbitype]
command = "python3"
args = ["/absolute/path/to/arbitype/server.py"]
env_vars = ["TYPESAFE_API_KEY"]
startup_timeout_sec = 10
tool_timeout_sec = 60

The same process can be registered by Claude, Cursor, VS Code, Codex, or any other MCP host using its native configuration format. Keep the key out of host configuration files; use the host's environment forwarding mechanism.

CLI and Python

The canonical CLI and package are arbitype:

arbitype --version
arbitype doctor --json
cat request.json | arbitype evaluate
arbitype evaluate --input request.json

The Python API is intentionally small:

from arbitype import TypeSafeClient

client = TypeSafeClient()
result = client.evaluate({
    "state": "A payment failed twice.",
    "questions": {
        "urgent": {
            "type": "noul",
            "instructions": "Does this require urgent handling?",
        }
    },
})

Package and import compatibility

The canonical wheel contains the one implementation plus the legacy import shims. The old PyPI project is not deleted, yanked, or released under a new identity.

Surface Name Status
PyPI arbitype Canonical distribution
Python arbitype Canonical import
Python typesafe_mcp Legacy compatibility shim
Python typesafe_codex_mcp Legacy compatibility shim

CLI compatibility

Command Status
arbitype Canonical CLI
typesafe-mcp Legacy CLI alias
typesafe-codex-mcp Legacy CLI alias

Tool compatibility

Tool Status
route Canonical
review Canonical
codex_route Legacy alias
codex_review Legacy alias

The historical typesafe-mcp PyPI project remains intact. A metadata-only replacement with the same distribution name was tested and rejected because pip can remove legacy console-script files while replacing the old distribution. Therefore no typesafe-mcp==0.6.0 migration package will be published.

Existing users should use this explicit, safe migration:

python -m pip uninstall typesafe-mcp
python -m pip install arbitype

New installations should use arbitype directly. This leaves one distribution owning the canonical implementation, compatibility shims, and all three CLI entry points.

Discovery and Registry

The canonical MCP Registry identity is:

io.github.Renwang-Huang/arbitype

The intended package entry is:

uvx arbitype

The PyPI, MCP Registry, and Glama links are prepared before publication, but their badges remain explicitly marked pending until the external listings are verified. Release ordering and the legacy Registry migration procedure are documented in docs/REGISTRY_MIGRATION.md.

The former identity io.github.Renwang-Huang/typesafe-mcp is a legacy identity. It must remain available for existing users and should be marked deprecated through the Registry publisher when that mutation is supported. New installations should use the Arbitype identity.

Configuration

Variable Default Purpose
TYPESAFE_API_KEY Required TypeSafe bearer credential
TYPESAFE_BASE_URL https://api.typesafe.ai API base URL
TYPESAFE_MODEL jev-latest Model alias; legacy name supported
TYPESAFE_DEFAULT_MODEL jev-latest Official SDK-compatible model name
TYPESAFE_TIMEOUT_SECONDS 10 Per HTTP attempt timeout
TYPESAFE_MAX_RETRIES 2 Retries after the initial request
TYPESAFE_RETRY_BACKOFF_SECONDS 0.5 Initial exponential backoff
TYPESAFE_MAX_STATE_CHARS 120000 Serialized state limit
TYPESAFE_MAX_QUESTION_CHARS 60000 Serialized question limit
TYPESAFE_MAX_REQUEST_BYTES 512000 Whole request limit
TYPESAFE_MAX_RESPONSE_BYTES 4194304 Provider response limit

Custom provider endpoints must use HTTPS. Plain HTTP is accepted only for loopback hosts such as localhost, 127.0.0.1, and ::1. Redirects are disabled so a bearer credential is never forwarded to a redirect target.

Security boundaries

Arbitype is a local MCP adapter and typed decision layer. It is not:

  • a sandbox for untrusted code;
  • an authorization or identity system;
  • a prompt-injection firewall;
  • a security approval boundary; or
  • an official TypeSafe AI product.

It does not execute actions suggested by route, edit files, run shell commands, or treat model probabilities as proof. Read SECURITY.md before using live credentials.

Development

python3 -m unittest discover -s tests -v
python3 -m compileall -q .
python3 -m pip wheel --no-deps . --wheel-dir /tmp/arbitype-dist

The test suite uses local fakes and does not need an API key. The official MCP Python SDK interoperability smoke test is in scripts/official_sdk_smoke.py. A live Jev check is opt-in and paid:

TYPESAFE_API_KEY="your-key" arbitype doctor --live

See TESTING.md, CONTRIBUTING.md, and BENCHMARK.md for the full engineering checks and comparison. Maintainer migration details are in docs/REGISTRY_MIGRATION.md.

Release identity

Arbitype is currently released as 0.6.0 because it remains Beta while its canonical public identity moves to the new package, CLI, and Registry name. The old package history remains intact; the brand migration does not rewrite Git history or delete the former PyPI project.

Release files for arbitype 0.6.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 arbitype 0.6.0
File Size Uploaded
arbitype-0.6.0.tar.gz 52.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arbitype 0.6.0
File Interpreter ABI Platform
arbitype-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.0 kB

Release files / arbitype-0.6.0.tar.gz

Download URL arbitype-0.6.0.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
64c3f3164fee72ef93d08bb9199b7ca145f9a6ec8edba1d9ff4dfaea60052ea2
BLAKE2b-256 checksum
How to use checksums
e2f1b8d5c71284d3691b9b1a936f900ebe464a18635f8c5f755eda221b7ad167
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 Sep 21, 2026.

Transparency log

Release files / arbitype-0.6.0-py3-none-any.whl

Download URL arbitype-0.6.0-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dce7370d1dbef8a8a25e9600a35f7129ce60c3e82082d1d83f3b8269b9f8d682
BLAKE2b-256 checksum
How to use checksums
1b7ba258b50eb1bdd83e56e54739f6a408f0d93f95944bb133182abf99b48736
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 Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

2 release files

This release

0.6.0 This release

2 release files

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