Packages and imports¶
One package name per language (apcore-surfaces) contains the Toolkit and all three
adapters. What you can import depends on the extras, features, or subpaths you select.
Packages and versions¶
| Language | Package | Registry | Runtime floor | Core package |
|---|---|---|---|---|
| Python | apcore-surfaces |
PyPI | Python 3.11+ | apcore |
| TypeScript | apcore-surfaces |
npm | Node.js 20.10+ | apcore-js |
| Rust | apcore-surfaces |
crates.io | Rust 1.88+ (edition 2021) | apcore |
All three SDKs pair with Core 0.34.1 in the current release. Each language SDK has its
own version number and release cadence; see the
migration guide and the per-language changelogs.
Surfaces declares Core as a dependency, so installing Surfaces installs a compatible Core. If your own code imports Core directly, declare it in your project dependencies as well — that keeps the version you compile against explicit.
Import paths¶
| Component | Python | TypeScript | Rust |
|---|---|---|---|
| Toolkit | apcore_surfaces.toolkit |
apcore-surfaces or apcore-surfaces/toolkit |
apcore_surfaces::toolkit |
| Toolkit (browser/worker) | — | apcore-surfaces/toolkit/browser |
— |
| MCP | apcore_surfaces.mcp |
apcore-surfaces/mcp |
apcore_surfaces::mcp |
| A2A | apcore_surfaces.a2a |
apcore-surfaces/a2a |
apcore_surfaces::a2a |
| CLI | apcore_surfaces.cli |
apcore-surfaces/cli |
apcore_surfaces::cli |
The TypeScript package root re-exports the Toolkit, so import { OpenAPIScanner } from
"apcore-surfaces" works without the subpath. Server and command-line entry points are
kept out of the root so browser bundles never pull in Node-only code.
Python and Rust do not import optional adapter modules unless you enable them — see the next two sections.
Python extras¶
The base install contains the Toolkit. Add an extra for each adapter you use.
| Extra | Adds |
|---|---|
mcp |
MCP server (mcp), schema validation, embedded UI, Starlette/uvicorn, PyJWT |
a2a |
A2A server and client (a2a-sdk[http-server]), Starlette/uvicorn, httpx, PyJWT |
cli |
CLI runtime (Click, Rich), schema validation, keyring, cryptography, httpx |
openapi |
HTTP proxy support for OpenAPI backends |
http-proxy |
HTTP proxy support used by the Toolkit and adapters |
auth |
Device authorization helpers (httpx) |
json-schema |
JSON Schema validation helpers (jsonschema) |
all |
Every extra above |
pip install apcore-surfaces # Toolkit only
pip install 'apcore-surfaces[mcp]' # + MCP
pip install 'apcore-surfaces[mcp,a2a,cli]' # + all adapters
pip install 'apcore-surfaces[all]' # everything
In Python, the MCP, A2A, and CLI extras declare apcore[config,discovery] because they use
Core's configuration and discovery features.
Rust features¶
The base crate contains the Toolkit. Features enable adapters, binaries, and optional Toolkit services.
| Feature | Enables |
|---|---|
mcp |
MCP adapter and the apcore-mcp binary |
a2a |
A2A adapter, client, and the apcore-a2a binary |
cli |
CLI adapter and the apcore-cli binary |
openapi |
OpenAPI proxy backend for MCP and A2A (implies http-proxy) |
http-proxy |
HTTPProxyRegistryWriter and proxy plumbing |
device-auth |
Toolkit device authorization client |
prometheus-server |
Standalone Prometheus HTTP listener |
all |
mcp, a2a, cli, openapi, prometheus-server |
The base crate leaves http-proxy, device-auth, and prometheus-server off. Enable
them explicitly when porting code from the pre-unification Toolkit crates.
cargo add apcore-surfaces --features mcp
cargo add apcore-surfaces --features mcp,a2a,cli,openapi
cargo install apcore-surfaces --locked --features mcp,a2a,cli --bins
Command-line entry points¶
All three languages install the same three command names. The Python and TypeScript packages install them automatically with the package; the Rust crate needs an explicit install or a binary target in your build.
| Command | Purpose | Python | TypeScript | Rust |
|---|---|---|---|---|
apcore-mcp |
MCP server | package script | package bin |
--features mcp --bin apcore-mcp |
apcore-a2a |
A2A agent server | package script | package bin |
--features a2a --bin apcore-a2a |
apcore-cli |
Module CLI | package script | package bin |
--features cli --bin apcore-cli |
# Python — installed with the matching extra
pip install 'apcore-surfaces[mcp,a2a,cli]'
apcore-mcp --help
# TypeScript — run without a global install
npm exec -- apcore-mcp --help
# Rust — install all three binaries
cargo install apcore-surfaces --locked --features mcp,a2a,cli --bins
Rust apcore-mcp serves OpenAPI backends
The standalone Rust MCP binary accepts --from-openapi and rejects
--extensions-dir. To serve native Rust modules, build the server in code with
APCoreMCP::builder(). See MCP quickstart.
Repository layout¶
| Path | Contents |
|---|---|
python/ |
Python SDK: pyproject.toml, src/apcore_surfaces/{toolkit,mcp,a2a,cli}, tests, examples |
typescript/ |
TypeScript SDK: package.json, src/{toolkit,mcp,a2a,cli}, tests, examples |
rust/ |
Rust SDK: Cargo.toml, src/{toolkit,mcp,a2a,cli}, binaries, tests, examples |
conformance/ |
Shared fixtures per surface, consumed by all three test suites |
docs/ |
This documentation site |
scripts/ |
Release, staging, site-build, and downstream verification tooling |
migration/ |
Pre-unification repository map for historical lookups |
Examples for each surface live in python/examples, typescript/examples, and
rust/examples, each with a cli, mcp, and a2a directory.
Build and test from a checkout¶
Run these from the repository root; each SDK directory owns its manifest and lockfile.
| Language | Install and test | Package |
|---|---|---|
| Python | uv sync --project python --locked --all-extras then uv run --project python --no-sync python -m pytest python/tests |
uv build --project python --out-dir dist |
| TypeScript | pnpm --dir typescript install --frozen-lockfile, pnpm --dir typescript build, pnpm --dir typescript test |
pnpm --dir typescript pack |
| Rust | cargo test --manifest-path rust/Cargo.toml --locked --all-features |
scripts/stage-rust-release.py then cargo package |
The Rust crate stages shared fixtures and the A2A Explorer page before packaging; see Rust README and Release the SDKs.
Source trees in all three SDKs must pass apdev-rs check-chars, which allows ASCII
plus the emoji and technical-symbol ranges in its base charset and rejects CJK text,
full-width forms, and invisible or bidirectional control characters. The
Source characters workflow checks python/src, typescript/src, rust/src,
rust/tests, and rust/examples; run the same command locally after adding fixtures
that contain non-ASCII text:
cargo install --locked apdev-rs --version 0.2.4
apdev-rs check-chars python/src typescript/src rust/src rust/tests rust/examples
See also¶
- Install and first run — the same matrix with install commands.
- Cross-SDK Conformance — what the fixture corpus pins.
- Troubleshooting & FAQ — version, import, and feature errors.