Skip to content

Troubleshooting & FAQ

Start with the symptom. Each entry names the cause and the fix, in the order the problem usually appears.

Installation and versions

ModuleNotFoundError: No module named 'apcore_surfaces.mcp'

The base Python install contains only the Toolkit. Install the extra for the adapter:

pip install 'apcore-surfaces[mcp]'

The same applies to apcore_surfaces.a2a and apcore_surfaces.cli. See Packages and imports.

Rust: unresolved import apcore_surfaces::mcp (or a2a, cli)

Adapters are behind Cargo features. Add the feature for each module you use:

apcore-surfaces = { version = "0.1", features = ["mcp"] }

features = ["all"] enables everything. If HTTPProxyRegistryWriter, DeviceAuthClient, or PrometheusServer is missing, enable http-proxy, device-auth, or prometheus-server — the unified crate leaves them off by default.

TypeScript: cannot resolve apcore-surfaces/mcp

Server and CLI entry points are separate subpaths, not part of the root export:

import { serve } from "apcore-surfaces/mcp";   // not from "apcore-surfaces"

The root export is the Toolkit. Browser and worker code should use apcore-surfaces/toolkit/browser, which never imports Node-only modules.

Two versions of Core are installed

Surfaces pins a Core version. If your project declares Core directly, align the two:

pip install 'apcore==0.34.1' 'apcore-surfaces[mcp]==0.1.0'
npm install [email protected] [email protected]
cargo add 'apcore@=0.34.1' 'apcore-surfaces@=0.1.0' --features mcp
The old apcore-mcp, apcore-a2a, or apcore-cli package is still installed

Install the unified package in a fresh environment. The old and new distributions both provide the same executable names, so a stale environment can silently run the old binary. See Upgrade to the unified SDK.

Modules and discovery

apcore-cli: module not found — exit code 44

Exit 44 covers not-found, disabled, load errors, and dependency problems. Check, in order:

  1. Is the extensions directory the one you think? --extensions-dir beats APCORE_EXTENSIONS_ROOT, which beats apcore.yaml, which beats ./extensions.
  2. Does the module appear at all? apcore-cli apcli list.
  3. Is it filtered out of the command tree? See Exposure Filtering; hidden modules remain callable through apcore-cli apcli exec <module_id>.
  4. Is it disabled at runtime? apcore-cli apcli health <module_id>.
The module runs from code but no surface finds it

Surfaces read the registry, not your imports. Register the module, or point the adapter at the directory that discovery scans:

from apcore import Registry
registry = Registry(extensions_dir="./extensions")
registry.discover()

A plain file inside the extensions directory is discovered only if it declares a binding (decorator, class attributes, or a .binding.yaml next to it).

Every tool or skill is missing from the listing

If an ACL is attached with default_effect: deny and no matching rule, callers are denied — and A2A also removes those skills from the public Agent Card. Add an explicit allow rule for the module IDs you intend to expose. See ACL Builder.

Schema validation and input

Exit code 45 — schema validation error

The input did not satisfy input_schema. Use --dry-run to see which field failed without executing:

apcore-cli math add --a 5 --b hello --dry-run

apcli validate <module_id> --input '<json>' runs the same preflight checks.

--input - reads nothing when the command runs in CI

--input - requires stdin. If the process has no stdin (some CI runners), pass flags instead, or supply the JSON through a file with a shell redirect. Inputs above the size limit need --large-input.

Boolean and enum flags do not exist

Flags come from the schema. A boolean property becomes --flag / --no-flag; an "enum": [...] property becomes a validated choice. If the flag is absent, the property is not in input_schema or is not a supported type — check apcore-cli apcli describe <module_id>.

Approval and ACL

Exit code 46 — approval denied or timed out

Modules annotated requires_approval, or matched by an ACL rule with approval: required, need a human decision. In an interactive terminal you get a prompt (default timeout 60s). In automation:

apcore-cli db.dangerous --yes
# or, for a whole session
export APCORE_CLI_AUTO_APPROVE=1

A non-TTY session with no bypass fails closed — that is the intended behaviour, not a bug.

Exit code 77 — ACL or policy denied

Identity or rules denied the call. Exit 75 is a retryable policy evaluation failure. Check the caller identity your adapter supplies (JWT claims for MCP/A2A), then the rules for that caller_id and module ID.

Approval prompts never appear for an MCP client

Approval needs an elicitation-capable client. If the client cannot elicit, the bridge cannot ask, and the call fails closed. Use Approval Handler (Phase B) for out-of-band decisions.

MCP

The client starts the server but lists zero tools
  • Confirm the client config uses an absolute path for the extensions directory.
  • Run the command by hand first: apcore-mcp --extensions-dir /abs/path.
  • stdio servers write protocol frames to stdout. Anything else your modules print to stdout corrupts the stream — use stderr for logging.
--extensions-dir is rejected by the Rust apcore-mcp

The standalone Rust binary serves OpenAPI backends only:

apcore-mcp --from-openapi ./openapi.yaml

To serve native Rust modules, build the server in code (APCoreMCP::builder().backend(executor).build()?.serve()?). See MCP quickstart.

The Explorer loads, but the Execute button does nothing

Explorer execution is opt-in. Start the server with --allow-execute (CLI) or the equivalent option in code, and only on a trusted network — the Explorer is a development tool.

A2A

/.well-known/agent-card.json returns 404

The card is served by the A2A server, not by whatever proxy sits in front of it. Check that the request reaches the server (raw curl against the bind port), then that the reverse proxy forwards /.well-known/ unchanged. Keep the public url option aligned with the externally visible base URL so the card advertises reachable endpoints.

Skills are missing from the Agent Card but invocable by ID

The public card subtracts skills an anonymous caller may not invoke and skills that require approval. Those skills still exist; they are simply not advertised. See Adapters.

Streaming stops early

A stream ends on a terminal task state. If you expected more updates, check the task state in the last event and whether the module emits progress at all. Cancellation is cooperative — a module that ignores the cancel token keeps running until it returns.

The Explorer asks for the token again after a reload

Bearer tokens are kept in memory, never in storage. Re-enter the token after a reload. Copied curl commands contain the placeholder YOUR_TOKEN, not the real credential.

CLI extras

Device login fails in TypeScript with a keytar error

keytar is an optional peer dependency. Either install a system keyring and keytar, or switch to file storage:

auth:
  device:
    token_storage: file
--sandbox is accepted but does nothing

--sandbox is reserved and currently hidden; it does not isolate execution yet. Do not rely on it as a security boundary. Use process-level isolation in your runner instead.

Output differs between the Python and Rust CLIs

csv and jsonl are byte-equivalent across SDKs and guarded by conformance fixtures; table and terminal-width wrapping are presentation-local and may differ. For pipeline-stable output, pin --format json, csv, or jsonl. See Output Formatter.

Documentation and contribution

mkdocs build --strict fails locally

Install Material for MkDocs, then build through the repository script so link and version checks run:

python -m pip install mkdocs-material
./scripts/build-site.sh _site

The script also validates that the landing page links resolve and generates each surface's llms-full.txt.

Where do conformance fixtures live, and how do I run one suite?

Fixtures are in conformance/<surface>/fixtures/. Run the SDK suite you changed and the shared fixture tests:

uv run --project python --no-sync python -m pytest python/tests
pnpm --dir typescript test
cargo test --manifest-path rust/Cargo.toml --locked --all-features

See Cross-SDK Conformance for ownership rules.

Still stuck?

  • Choose your surface — confirm you are using the right component.
  • Glossary — decode a term in an error message.
  • GitHub issues — search before filing; include the SDK version, Core version, and the exact command.