Skip to content

API Stability

SimonTarara62 edited this page Nov 29, 2026 · 9 revisions

API Stability

This page is a summary — the authoritative policy lives in the repo's docs/api-stability.md. Read that page for the full guarantee text; this one just orients you.

The surface is a stable contract

The server exposes a fixed surface — 42 tools, 4 resources, and 7 guided prompts — and that surface is a contract you can build a client integration on. Within a given major version:

  • Tool, resource, and prompt names don't change or get removed.
  • A tool's semantics don't silently change — what a tool does stays what it did.
  • Existing parameters keep their name, type, and meaning.

Adding a new tool/resource/prompt, or adding a new optional parameter to an existing tool, is allowed without a major version bump — those are additive. Renaming or removing something, or changing a parameter's type, requires a major bump and (where feasible) ships with a deprecation alias, always recorded in the CHANGELOG.

This contract covers the shape of the interface — names, parameters, prompt arguments. It does not freeze the values returned from the live Capital.com API (those reflect the upstream API) or the exact wording of human-readable descriptions.

Also covered

  • Error codes. A code a client can receive is not renamed or removed within a major version; new codes may be added. Message text may change, so match on the code (see Error Reference).
  • Settings. The names of the CAP_* environment variables (their meaning is documented in the Configuration Reference, not enforced by a test). CAP_REQUIRE_EXPLICIT_CONFIRM=false stays available; it removes the confirm=true requirement for every state-changing tool and is at your own risk.
  • Command line. The snapshot freezes the subcommand names (run, init, doctor, config, setup), their option strings, and the --client and --transport choices. tests/test_client_setup.py::test_default_paths (the workspace-path test) pins that setup --client vscode targets the workspace file .vscode/mcp.json.
  • Credentials lookup order. Values in the process environment and the CAP_*_CMD commands take precedence over any file (the environment beats a command, a command beats a file). Among files the order is CAP_ENV_FILE, then ./.env in the working directory, then the file capitalcom-mcp init writes, then the SDK default (~/.config/capital-cli/.env). This project's tests enforce the choice among CAP_ENV_FILE, ./.env and the init file; the environment/command precedence and the SDK default file are the SDK's own behaviour within the pinned capitalcom-cli range.
  • Result keys the server adds. The snake_case keys this server puts in results (for example account, position_deal_id, amend_request, the cap://risk-policy fields and the cap_stream_* envelope keys such as status, ticks or snapshots) are not renamed or removed within a major version; new keys may be added. Keys inside the broker's own data (camelCase, such as dealReference) follow Capital.com.

Some frozen error codes and settings come from the SDK, so the capitalcom-cli dependency stays pinned to a range that honours them (capitalcom-cli>=0.8,<0.9 in 0.9.0).

  • Credentials lookup order. CAP_ENV_FILE, then ./.env in the working directory, then the file capitalcom-mcp init writes (~/.config/capital-mcp/.env), then the SDK default (~/.config/capital-cli/.env).

Not covered

  • The bundle's internal variables. CAP_MCPB_* and CAPITALCOM_MCP_BUNDLE* are internal to the bundle and may change in any release; set the form fields instead.
  • The MCPB bundle. Its format is experimental upstream; it is provided as a convenience and may change or be withdrawn in a minor release.
  • Data returned by the broker, and the wording of descriptions.

Before 1.0.0

The project is still on 0.x, and the contract takes full effect at 1.0.0. Names are already stable. Until then a minor release (0.x.0) may still change a default — always listed under Changed in the CHANGELOG — and a patch release only fixes bugs. 0.9.0 carries the last planned default changes before 1.0.0. Tool and parameter descriptions are documentation and may be improved in any release. Pin an exact version if you depend on today's behavior.

How it's enforced

The surface is locked by an automated snapshot (tests/snapshots/api_surface.json) checked in the offline test suite. Any accidental change to a tool schema, resource URI, or prompt argument fails CI until it's either reverted or deliberately re-frozen with a CHANGELOG entry.

Error codes, the command line and the CAP_* setting names are guarded by three superset snapshots (test_error_codes_are_a_superset_of_the_snapshot, test_cli_surface_is_a_superset_of_the_snapshot and test_settings_are_a_superset_of_the_snapshot): additions are allowed, a removal or rename fails CI and needs a major version. The choice among CAP_ENV_FILE, ./.env and the init file is pinned by the resolver tests in tests/test_cli.py (for example test_explicit_cap_env_file_wins and test_local_dotenv_wins_over_default).

Tool titles and annotations (read-only, destructive, idempotent and open-world hints) are part of the snapshot; they describe the tool and may be corrected in a minor release.

Pinning is a separate, stronger guarantee

Version stability is a promise about major versions — a 1.x release can still add tools between 1.0 and 1.4. To pin against any change at all, including additive ones, pin the exact package version in your client config (capitalcom-mcp==0.9.0) — see Client Setup.

See also

  • docs/api-stability.md in the repository — the authoritative policy text
  • Contributing — the checklist for adding a tool without breaking this contract
  • Client Setup — how to pin an exact version

Clone this wiki locally