Skip to content

How APCore Surfaces works

Read this page once before you start coding. It explains the vocabulary the rest of the documentation uses, and the one rule that explains most design decisions in this project: every surface projects the same module metadata, and every call still goes through the runtime.

If you already know apcore Core Concepts, the short version is: Core defines and governs capabilities; Surfaces describe those capabilities to a protocol and route calls back into Core.

The three layers

┌─────────────────────────────────────────────────────────────┐
│  Callers                                                    │
│  MCP clients (Claude, Cursor) · A2A agents · shells · CI    │
└───────────────┬──────────────────────┬──────────────────────┘
                │  protocol            │  argv
┌───────────────▼──────────────────────▼──────────────────────┐
│  Surfaces — this repository                                 │
│  MCP · A2A · CLI                                            │
│  (projection + transport + protocol error mapping)          │
└───────────────┬─────────────────────────────────────────────┘
                │  Executor.call / Executor.stream
┌───────────────▼─────────────────────────────────────────────┐
│  apcore runtime — one dependency, one pipeline              │
│  Registry · schema validation · identity · ACL · approval   │
│  middleware · audit · metrics                               │
└─────────────────────────────────────────────────────────────┘

The Toolkit sits beside the adapters rather than between them: it is the shared metadata pipeline (scan, normalize, enrich, format) that adapters and framework integrations use to produce the descriptions the layers above exchange.

The five words you need

Term What it is Where it lives
Module One callable capability with an ID, a description, input/output JSON Schemas, behavior annotations, and an execute() body Your application, via apcore
Registry The lookup table of modules the application has registered apcore runtime
Executor The component that runs a module call through the governance pipeline apcore runtime
Surface (or adapter) A protocol-specific projection of the registry: MCP tools, A2A skills, or CLI commands This repository
Toolkit Language-neutral metadata helpers: scanners, schema extraction, writers, formatters This repository

A surface is sometimes called an adapter in the docs; the words are interchangeable. "Surface" emphasizes the caller-facing view, "adapter" emphasizes that it translates between two protocols.

What a surface actually does

A surface performs three jobs, and deliberately no fourth:

  1. Project — convert apcore metadata into the target protocol's shape (an MCP tool descriptor, an A2A Agent Card skill, a CLI option set).
  2. Transport — serve that shape over the protocol (stdio/HTTP, JSON-RPC/SSE, process arguments and exit codes).
  3. Translate errors — turn runtime failures into protocol-appropriate responses, including AI-readable guidance where the protocol supports it.

It does not re-implement governance. Validation, identity, ACL checks, approval gates, and audit all run inside Core, so a call arriving over MCP has exactly the same constraints as the same call made from application code.

apcore concept MCP A2A CLI
module_id Tool name (dotted, verbatim) Skill id Command path
description Tool description Skill description Command help
input_schema inputSchema Skill input modes/schemas Typed flags and arguments
output_schema Structured result / artifact Artifact Rendered output (json, table, …)
annotations ToolAnnotations hints Capability hints Approval gate, --dry-run, --trace
metadata.display Tool aliases and descriptions Skill aliases and descriptions Command names, groups, summaries

metadata.display is the display overlay: a sparse block of per-surface naming and wording that lets one module present differently to each caller without changing its identity. See Display Overlay.

Two ways in, one way through

Every adapter accepts a backend and then projects it:

extensions directory ──▶ Registry ──▶ Executor ──▶ surface
OpenAPI 3.0/3.1 doc ──▶ ScannedModule list ──▶ Registry ──▶ Executor ──▶ surface
  • Native modules — you wrote them with apcore (decorator, class, or YAML binding). Point the adapter at the extensions directory, or hand it a Registry/Executor you already built.
  • OpenAPI backends — you only have an API description. The adapter scans the document into modules whose execute() proxies HTTP, so no apcore project is required on the far side. This is opt-in because an OpenAPI document describes shape, not consequences — review the safety notes in MCP OpenAPI Backend and A2A OpenAPI Backend before exposing write operations.

Three languages, one contract

Python, TypeScript, and Rust each ship the Toolkit and all three adapters from a single package per language. Where two consumers can observe the bytes — module IDs, Markdown, CSV/JSONL, TUI view models, Agent Cards — behaviour is pinned by a shared conformance corpus so the languages cannot drift apart.

That means:

  • A module ID derived from the same directory layout is identical in all three SDKs.
  • The same module formats to the same Markdown, CSV, and JSONL bytes.
  • Error codes and exit codes follow one table.

See Cross-SDK Conformance.

Where to go next

  • Pick a surface


    Match the caller you need to support to the adapter that serves it.

    Choose your surface

  • Install and verify


    Install the SDK for your language and run a first command against real modules.

    Install and first run

  • Look up a term


    One page for every protocol and runtime word used in these docs.

    Glossary