oscal-mcp
v1.1.0MCP Server that wraps the oscal Python library to enable an Agentic AI to validate, convert, query and mutate OSCAL content.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
open_document Open Document
Open an OSCAL document from a local file path or a URI. Loads XML, JSON, or YAML from a local path (e.g. ``./catalog.xml``) or acquires it from a URI (``https://…``, ``file://…``). The document is cached and validated/import-resolved by the library on load. Re-opening the same source returns the existing handle. Returns a summary including the ``handle`` used by all other document tools, the detected model, metadata, content state, and validation status.
| Parameter | Type | Description |
|---|---|---|
source * | string |
load_content Load Content
Load in-memory OSCAL content (a JSON, YAML, or XML string). Use when the OSCAL content is already available as text rather than a file. ``href`` is an optional label identifying the content's origin. Returns a document summary including the ``handle``.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
href |
new_document New Document
Create a new OSCAL document from the library's built-in template. ``model`` must be one of: ``catalog``, ``profile``, ``mapping-collection``, ``component-definition``, ``system-security-plan``, ``assessment-plan``, ``assessment-results``, ``plan-of-action-and-milestones``. ``published`` is an optional ISO-8601 timestamp (e.g. ``2026-01-01T00:00:00Z``). Returns a summary including the ``handle``.
| Parameter | Type | Description |
|---|---|---|
model * | string | |
title * | string | |
published | string | |
version | string |
list_documents List Documents
List all currently open documents with their summaries. Returns ``{count, documents}`` where ``documents`` holds one summary per open document (each includes its ``handle``).
get_document_summary Get Document Summary
Return the full summary for one open document. Includes model, live metadata, content state, per-phase ``validation_status``, version-support resolution, and origin/mutability flags.
| Parameter | Type | Description |
|---|---|---|
handle * | string |
close_document Close Document
Close a document, evicting it from the cache and releasing its handle.
| Parameter | Type | Description |
|---|---|---|
handle * | string |
validate_document Validate Document
Validate an open document against the NIST OSCAL metaschema. Standard (``full=False``) runs the L2 pipeline: well-formedness, structure, data-types, natively-evaluable allowed-values, cardinality and choice. Set ``full=True`` to additionally run L3 (``validate_full``): ancestor/cross-path scoped constraints evaluated against XML. Returns per-phase ``validation_status``, the overall verdicts (``is_minimally_valid`` / ``is_valid`` / ``is_fully_compliant``), and the library's normalized ``errors`` (``error-type``, ``location``, ``identifier``, ``field``, ``value`` + detail).
| Parameter | Type | Description |
|---|---|---|
handle * | string | |
full | boolean |
convert_document Convert Document
Serialize an open document to XML, JSON, or YAML and return it as a string. The library emits keys/elements in canonical NIST metaschema order. ``format`` must be one of ``xml``, ``json``, ``yaml``. Returns ``{handle, format, content}`` where ``content`` is the serialized document.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
handle * | string | |
pretty | boolean |
save_document Save Document
Write an open document to disk. With no ``path``/``format``, saves back to the original source location and format. Otherwise ``path`` is the target file and ``format`` (one of ``xml``, ``json``, ``yaml``) the output format. Returns ``{handle, saved, path, format}``.
| Parameter | Type | Description |
|---|---|---|
handle * | string | |
format | string | |
path | string | |
pretty | boolean |
query_document Query Document
Query an open document with an XPath-inspired path expression. Two step-name conventions are available: * ``json_syntax=False`` (default) — use OSCAL **XML element names** (``control``, ``prop``, ``part``), e.g. ``//control[@id="ac-2"]`` or ``/*/metadata/title``. Requires a metaschema index for the model/version. * ``json_syntax=True`` — use **JSON key names** (``controls``, ``props``, ``parts``), e.g. ``//controls[id="ac-2"]``. No index required. Set ``first_only=True`` to return just the first match (or ``null``). Returns ``{handle, path, json_syntax, count, matches}``. Query re…
| Parameter | Type | Description |
|---|---|---|
handle * | string | |
path * | string | |
first_only | boolean | |
json_syntax | boolean |
inspect_imports Inspect Imports
List a document's imports and their resolution status. Returns one entry per import statement (original/resolved href, status, local/ remote/cached flags, whether it resolved, the imported model, and structured failure detail when it did not).
| Parameter | Type | Description |
|---|---|---|
handle * | string |
resolve_imports Resolve Imports
Re-run import discovery and loading, then report the result. Imports resolve automatically once content is minimally valid; call this to force a fresh pass (e.g. after a retry or an environment change). ``base_path`` is an optional base for resolving relative hrefs.
| Parameter | Type | Description |
|---|---|---|
handle * | string | |
base_path | string |
retry_import Retry Import
Retry a single failed import using an alternate source. Point ``failed_href`` (as it appears in the document) at ``replacement_href`` (e.g. a local fallback copy), then re-reports import status.
| Parameter | Type | Description |
|---|---|---|
failed_href * | string | |
handle * | string | |
replacement_href * | string |
list_oscal_models List Oscal Models
List the OSCAL models known to the support database. With ``version="all"`` (default) returns every model across all versions; pass a version tag (e.g. ``v1.1.3``) to list only models defined for it.
| Parameter | Type | Description |
|---|---|---|
version | string |
list_oscal_versions List Oscal Versions
List the OSCAL versions available in the support database. If ``model`` is given, only versions that define that model are returned. Also reports the latest known version.
| Parameter | Type | Description |
|---|---|---|
model |
describe_model_structure Describe Model Structure
Describe an OSCAL model's metaschema structure. Returns an HTML outline of the model's structure in the requested ``format`` syntax (``xml`` / ``json`` / ``yaml``), annotated with data types and cardinality; each node carries a stable reference id. Supply ``reference_uuid`` (a node id from a prior outline) to get the one-node detail view instead. ``version`` defaults to the latest known version.
| Parameter | Type | Description |
|---|---|---|
model * | string | |
format | string | |
reference_uuid | string | |
version | string |
update_oscal_support Update Oscal Support
Update the support database with OSCAL versions published by NIST. REQUIRES AN ACTIVE INTERNET CONNECTION and is a no-op/failure in air-gapped deployments. With no ``version``, checks for and fetches any newly published versions (``mode="new"``). Pass a specific tag (e.g. ``v1.2.3``) to clear and re-fetch just that version. Returns success plus the library's update stats.
| Parameter | Type | Description |
|---|---|---|
version | string |
search_library_api Search Library Api
Search the ``oscal`` library API for symbols matching a query. Ranks classes, methods and functions by how well the query matches their name (highest), signature, then docstring. Use this to discover how to call the library from Python (e.g. ``search_library_api("resolve profile")`` or ``search_library_api("validate")``). Returns the top ``limit`` results, each with fully-qualified name, kind, signature, and the first docstring line.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer |
search_knowledge Search Knowledge
Search bundled OSCAL documentation for guides matching a query. ``scope`` is ``lib`` (oscal library concepts), ``std`` (NIST OSCAL standard), or ``all`` (default). Ranks by title and heading/body matches and returns the top ``limit`` hits, each with a snippet and the ``uri`` to read the full guide. For library *symbol/signature* lookups use ``search_library_api`` instead.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer | |
scope | string |