@axiom-foundation/mcp
v0.3.0
Published
MCP server adapter for the Axiom Rule API.
Readme
Axiom MCP
MCP server adapter for the Axiom Rule API. The server is intentionally thin: all rule search, retrieval, source lookup, graph traversal, package discovery, and calculation execution go through the HTTP API.
Status: developer preview. The MCP server and the hosted API it talks to are open for evaluation with self-serve trial keys. Interfaces and limits may change before general availability; pin versions and expect breaking changes between minors.
Run
For a client-focused setup guide, see docs/quickstart.md.
From a checkout:
AXIOM_API_BASE_URL=https://api.axiom.org \
AXIOM_API_KEY=... \
npm run mcpAfter installation:
AXIOM_API_BASE_URL=https://api.axiom.org \
AXIOM_API_KEY=... \
axiom-mcpClaude Desktop example:
{
"mcpServers": {
"axiom": {
"command": "npx",
"args": ["-y", "@axiom-foundation/mcp"],
"env": {
"AXIOM_API_BASE_URL": "https://api.axiom.org",
"AXIOM_API_KEY": "axiom_..."
}
}
}
}The npm package @axiom-foundation/mcp is the primary distribution path.
Installing from GitHub also works and tracks main:
{
"mcpServers": {
"axiom": {
"command": "npx",
"args": ["-y", "github:TheAxiomFoundation/axiom-mcp"],
"env": {
"AXIOM_API_BASE_URL": "https://api.axiom.org",
"AXIOM_API_KEY": "axiom_..."
}
}
}
}For local development, point the client at the checkout:
{
"mcpServers": {
"axiom-local": {
"command": "node",
"args": ["/path/to/axiom-mcp/dist/index.js"],
"env": {
"AXIOM_API_BASE_URL": "https://api.axiom.org",
"AXIOM_API_KEY": "axiom_..."
}
}
}
}Tools
The server is a pure pass-through: every public, non-admin route of the Axiom API is a tool. Tool arguments are forwarded as-is; validation and error codes come from the API.
That claim is checked, not asserted. src/api-surface.ts
maps each public route to its tool and gives a reason for the few that are
deliberately not tools; npm run check:api-surface holds the map against the
deployed GET /v1/openapi.json, and the live-smoke workflow runs it every
half hour.
Discovery and meta
get_capabilities—GET /v1/capabilitiesget_version—GET /v1/versioncheck_health,check_readiness—GET /v1/health,GET /v1/ready(no API key needed)list_programs—GET /v1/programslist_variables—GET /v1/variables(every requestable output and suppliable input, filterable byjurisdiction,kind,q; this is how you resolve a variable name before a variable-addressed calculation)list_certified_nodes—GET /v1/certified(enforcement mode, ledger metadata, paged ledger entries, status counts, pending list)list_corpus_subtrees—GET /v1/corpus/subtrees(every subtree executable on demand)get_bundled_validation—GET /v1/public/validation/bundled(the validation snapshot committed with the deployment; no API key needed)
Rules and graphs
search_rules—POST /v1/searchget_rule,get_rule_sources,get_rule_dependencies—GET /v1/rules/{id}[/sources|/dependencies].get_ruletakesas_of(YYYY-MM-DDorYYYY-MM) for a point-in-time read.get_rule_versions—GET /v1/rules/{id}/versions(every retained (symbol, version) pair with its valid-time window, citation, and formula or values; filter withsymbolandas_of). Read the response'scoveragebefore reading anything into a gap: one retained version is not evidence that a rule never changed.get_node—GET /v1/nodes/{legal_id}(node detail with certification status;certificateis null unless the node is in a valid ledger)compose_graph—GET /v1/graph/compose?focus=(dependency graph for any rule or file)get_subgraph—GET /v1/subgraph?roots=(dependency closure from up to 20 roots)
Certification is reported, not enforced, unless the API runs in enforced
mode. The API default is permissive: get_node and get_subgraph serve
every node of the compiled runtime packages' graphs, certified or not, and a
node's certificate is null unless it is in a valid ledger. (Under
permissive, each package graph is trimmed to the dependency closure of its
graph_roots, or of its default outputs when graph_roots is absent,
whenever those resolve to nodes.) Under enforced they serve only certified
rules and parameters whose rule, input, and relation dependencies are all
certified (checked transitively), plus the certified inputs and relations
reachable from them, and the same ledger also gates search, rule reads, programs,
compose_graph, runtime packages, and calculations.
An id outside the package graphs served in the current mode is
404 uncertified_node. Under permissive that means the id is not in a
served package graph (legal ids from compose_graph may not be), not that the
node is uncertified. Successful responses report the mode in
meta.certified.enforcement; in an MCP tool error the API's response
envelope, when there is one, is under error.api_response.
list_certified_nodes also reports the mode, with the ledger.
Runtime
list_runtime_packages,get_runtime_package—GET /v1/runtime/packages[/{j}/{p}]get_package_graph—GET /v1/runtime/packages/{j}/{p}/graph(the package's rules, inputs, relations, and terminal outputs as a DAG from the compiled artifact — how a program's outputs are computed)get_root_inputs—GET /v1/runtime/root-inputs?root=(input catalog for any root)list_runtime_artifacts—GET /v1/runtime/artifacts(pinned artifact identities)
Calculate
calculate_household—POST /v1/calculate. Three addressing modes, mutually exclusive, picked by the API from the body's shape:- Variable-addressed:
variableswith noprogram_idand noroot, plusperiod(YYYYorYYYY-MM),state(two letters) orjurisdiction(us-xx) — send one spelling or the other —peoplekeyed by your own ids, and eitherunitfor a single unit or entity groups such asspm_unitsandtax_units, keyed by your own unit ids, each carryingmembersand that unit's facts. Variable names resolve through the variables catalog; unsupported ones come back inunsupported[]instead of failing the request. - Root: any corpus subtree compiled on demand (
root, e.g.us:statutes/7/2014/e/6/A).factsis sugar forhousehold.facts, andinput_contractis valid only here. - Package: a registered package (
program_id+jurisdiction) withhousehold.
The tool schema is passthrough, not strict. Entity groups are whatever plurals the admitted packages declare, so the schema cannot name them all, and the API refuses an unknown field by name rather than ignoring it — both need the field to arrive. Unknown fields are therefore forwarded, and the API's error is the one you see.
- Variable-addressed:
calculate_batch— up to 25 synchronous calculations, positional resultssubmit_calculation_job/get_calculation_job— up to 50 as a detached async jobcalculate_household_compat—POST /v1/household/{country_id}/calculate(PolicyEngine wire format)
Parity
list_parity_cases,run_parity_cases
list_parity_cases returns canonical Axiom requests plus optional
external_comparisons metadata for engines such as PolicyEngine. Those
comparisons include the external request, output mappings, trace mappings,
notes, and tolerances owned by the Axiom API fixture.
run_parity_cases returns the Axiom API parity summary, expected-output
diffs, trace_outputs, calculation trace rows, and case notes when the API
provides them. Use it for migration checks and to explain why a result differs
from another engine.
Resources
axiom://capabilitiesaxiom://programsaxiom://runtime/packagesaxiom://corpus/subtreesaxiom://parity/cases
Prompts
explain_rule_for_caseworkertrace_household_resultrun_corpus_subtreefind_missing_household_inputs
Security
The server does not expose shell execution, arbitrary network fetch, database access, or write/admin operations. It only calls the configured Axiom API base URL with the configured API key.
No API key yet? Issue yourself a trial key (14-day expiry, read +
calculate scopes, no signup): curl -s -X POST
https://api.axiom.org/v1/keys/trial
Recommended API key scopes:
none check_health, check_readiness, get_bundled_validation
rules:read get_capabilities, get_version, list_programs, list_variables, search_rules, get_rule, get_rule_versions, get_node, list_certified_nodes, list_corpus_subtrees, list_runtime_packages, get_runtime_package, get_package_graph, get_root_inputs, list_runtime_artifacts
sources:read get_rule_sources
graphs:read get_rule_dependencies, compose_graph, get_subgraph
calculate:run calculate_household, calculate_household_compat, calculate_batch, submit_calculation_job, get_calculation_job
admin:parity list_parity_cases, run_parity_casesUse the narrowest key that matches the agent workflow. A read-only research
agent usually needs rules:read, sources:read, and graphs:read; a scenario
runner also needs calculate:run.
Axiom API errors are returned to the MCP client as structured tool errors that
include the HTTP status and the API's error body, so agents can see error
codes, messages, and request ids. If the Axiom API returns 429 rate_limited
with a retry-after of 10 seconds or less, the server retries once
automatically; otherwise the tool error includes the response's retry-after
value — retry after that interval.
Full reference with recorded examples: api.axiom.org/docs/mcp
Configuration
| Variable | Default | Purpose |
| --- | --- | --- |
| AXIOM_API_BASE_URL | https://api.axiom.org | Axiom API base URL |
| AXIOM_API_KEY | none | Bearer token sent to the API |
| AXIOM_API_TIMEOUT_MS | 30000 | Per-request timeout in milliseconds |
Development
npm run check
npm pack --dry-run
npm run smoke:github-installnpm run check is hermetic. To check the tool surface against the deployed
contract — no API key needed, since GET /v1/openapi.json is public:
npm run check:api-surfaceIt fails when the API serves a public route that
src/api-surface.ts neither maps to a tool nor lists as
deliberately unwrapped, and when the manifest names a route the API no longer
serves. Add the tool, or the UNWRAPPED_ROUTES entry with its reason.
Live smoke against the deployed API:
AXIOM_API_BASE_URL=https://api.axiom.org \
AXIOM_API_KEY=... \
npm run smoke:livePublishing
The package is published to npm as @axiom-foundation/mcp.
Use npm Trusted Publishing for CI/CD releases instead of a long-lived npm token. Configure the package's trusted publisher in npm with:
- package:
@axiom-foundation/mcp - repository owner:
TheAxiomFoundation - repository name:
axiom-mcp - workflow filename:
publish.yml - environment: leave blank unless the workflow is later moved behind a GitHub environment
Then run the manual Publish MCP Package workflow from:
https://github.com/TheAxiomFoundation/axiom-mcp/actionsThe publish workflow runs npm run check, npm pack --dry-run, and
npm publish --access public --provenance through GitHub OIDC. The first
version (0.1.0) was published manually because npm requires an existing
package before trusted publishing can be configured; all later releases should
go through the workflow.
MCP clients can install with:
npx -y @axiom-foundation/mcpLicense
MIT. See LICENSE.
