Install and first run¶
apcore-surfaces is the package name on PyPI, npm, and crates.io. One install gives you
the Toolkit and the MCP, A2A, and CLI adapters for your language. Nothing about your
modules changes.
New here? Read How APCore Surfaces works first — five terms, two minutes — or jump straight to Choose your surface if you only want one adapter.
Before you start¶
- A language runtime — Python 3.11+, Node.js 20.10+, or Rust 1.88+.
- Core — the runtime that defines, registers, and executes modules, and applies validation, authorization, and approval. Surfaces brings a compatible Core with it; you only declare Core yourself if your code imports it directly.
- Something to expose — an APCore project with an extensions directory, or an OpenAPI 3.0/3.1 document if you want the MCP or A2A OpenAPI backend.
For a Core-only project — defining and running capabilities in code with no protocol — install Core alone:
The Core quickstart builds a governed module in five minutes if you do not have one yet.
Install Surfaces¶
The base install includes the Toolkit. Add an extra for each adapter you use.
Replace python -m pip with uv add or poetry add if that is how your project
manages dependencies; the requirement strings are the same.
One install supplies the Toolkit and all three adapters; adapters are separate subpath exports.
npm install [email protected] [email protected]
Browser and worker code imports the Toolkit from apcore-surfaces/toolkit/browser.
Confirm the install¶
The three commands come from the package scripts. If a command is missing, the matching extra is not installed.
Binaries are installed separately from the library dependency.
cargo install apcore-surfaces --version '=0.1.0' --locked --features mcp,a2a,cli --bins
apcore-mcp --help
apcore-a2a --help
apcore-cli --help
The Rust apcore-mcp binary serves OpenAPI backends (--from-openapi) and rejects
--extensions-dir; native Rust modules are served by building APCoreMCP in code.
Your first run¶
Option A: drive existing modules from a terminal¶
Fastest path — no code to write. If you do not have modules yet, point at the examples that ship with the repository:
clone_dir=$(mktemp -d)
git clone --depth 1 https://github.com/apstack/apcore-surfaces.git "$clone_dir"
export APCORE_EXTENSIONS_ROOT="$clone_dir/python/examples/cli/extensions"
apcore-cli apcli list
apcore-cli apcli describe math.add
apcore-cli math add --a 5 --b 10
# {"sum": 15}
With your own modules, set APCORE_EXTENSIONS_ROOT (or pass --extensions-dir) and run
the same commands. Continue with the CLI quickstart.
Option B: serve modules to an AI client over MCP¶
Then add the server to the client's configuration (absolute path):
{
"mcpServers": {
"apcore": {
"command": "apcore-mcp",
"args": ["--extensions-dir", "/absolute/path/to/extensions"]
}
}
}
Continue with the MCP quickstart.
Option C: serve modules to other agents over A2A¶
apcore-a2a serve --extensions-dir ./extensions --name "My Agent" --port 8000
curl -s http://localhost:8000/.well-known/agent-card.json | jq .name
Continue with the A2A quickstart.
Option D: build your own adapter or metadata pipeline¶
Continue with the Toolkit quickstart.
Import paths at a glance¶
| API | Python | TypeScript | Rust |
|---|---|---|---|
| Core | apcore |
apcore-js |
apcore |
| Toolkit | apcore_surfaces.toolkit |
apcore-surfaces/toolkit |
apcore_surfaces::toolkit |
| 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. Full extras, features, and subpath details are in Packages and imports.
Where to go next¶
-
Not sure which adapter?
Match the caller you need to support to the surface that serves it.
-
Learn the model
Modules, registries, executors, display overlays, and why governance never moves.
-
Something failed?
Install, discovery, approval, and connection problems, with the fix for each.
Upgrading from the separate packages¶
The pre-unification apcore-toolkit, apcore-mcp, apcore-a2a, and apcore-cli
distributions are replaced by apcore-surfaces. The command names stay the same. The
migration guide maps old dependencies, imports, Python extras,
and Rust features to their replacements.