This document defines the MCP compatibility contract implemented by Nomos.
2024-11-05
Nomos returns this version from the initialize response.
The initialize response currently advertises:
capabilities.tools.listChanged = false
Nomos therefore treats MCP tools/list as a static advertised surface for the life of a server session.
- stdio
- Streamable HTTP for remote MCP clients and upstream MCP servers
Legacy SSE upstream MCP servers are supported as a compatibility path.
Nomos currently supports:
- framed JSON-RPC 2.0 requests using
Content-Length - line-delimited JSON-RPC 2.0 requests
- legacy line-delimited Nomos request envelopes for backward compatibility
Nomos emits:
- framed JSON-RPC 2.0 responses for framed JSON-RPC requests
- line-delimited JSON-RPC 2.0 responses for line-delimited JSON-RPC requests
- legacy line-delimited responses for legacy line requests
Nomos supports:
initializenotifications/initializedtools/listtools/callresources/listresources/readprompts/listprompts/getcompletion/complete- governed upstream
sampling/createMessagewhen the downstream client advertises sampling support
Exposed tools:
nomos_capabilitiesnomos_fs_readnomos_fs_writenomos_apply_patchnomos_execnomos_http_requestrepo_validate_change_set
Nomos advertises MCP tool names using a conservative cross-vendor-safe character set. Canonical dotted names such as nomos.capabilities and nomos.fs_read remain accepted for direct JSON-RPC and backward compatibility, but clients should call the names returned by tools/list.
Launcher/workspace-profile mode can request --tool-surface friendly, which advertises natural aliases for the five primary governed capabilities:
read_file->fs.readwrite_file->fs.writeapply_patch->repo.apply_patchrun_command->process.exechttp_request->net.http_request
--tool-surface canonical preserves the compatibility-safe names above. --tool-surface both advertises both sets. Incoming calls through any supported alias are canonicalized before policy, approval, and audit evaluation.
Tool surfacing semantics:
tools/listis static and returns the full advertised Nomos MCP surface- current policy state is exposed through the capabilities tool (
nomos_capabilitieswhen advertised, canonical aliasnomos.capabilitieswhen calling directly) - clients should use the capabilities tool to distinguish:
- tools callable now
- tools available only with approval
- tools currently unavailable for the active identity/environment
- the capabilities response is advisory only; every action is still evaluated live
- capability evolution is additive and versioned through
contract_version - clients may watch
capability_set_hashto detect deterministic contract changes within the current runtime tool_states[*].constraintsexposes bounded safe summaries only; Nomos does not expose raw policy internals or sensitive resource names by default
For tools/call:
- action tools return text content with a concise decision line (
ALLOW,APPROVAL, orDENY) and relevant output details when present - non-action utility responses such as
nomos_capabilities/nomos.capabilitiesandrepo_validate_change_setremain JSON text payloads
- stdout is reserved for MCP protocol bytes only
- the startup banner is written to stderr only
- runtime logs are written to stderr only
--quietsuppresses banner and non-error logs
- optional protocol features not explicitly listed above
- arbitrary non-protocol stdout output
The MCP Reference Contract CI job is the authoritative interop gate for upstream MCP gateway claims.
Pinned references are recorded in testdata/mcp-contract/reference-servers.json with package versions and sha512 integrity hashes:
@modelcontextprotocol/server-everything@2026.1.26@modelcontextprotocol/server-filesystem@2026.1.14@modelcontextprotocol/server-memory@2026.1.26
The CI suite runs offline deterministic contract fixtures for those references instead of downloading package payloads during test execution. Coverage includes:
initializeandtools/list- representative
tools/callsuccess for each reference - invalid
tools/callarguments returning structured tool errors resources/listandresources/readprompts/listandprompts/get- upstream-requested sampling for the Everything reference surface
- stdio and Streamable HTTP upstream transport parity
- unsupported method errors
- early upstream exit fail-closed behavior
- stable canonical action fingerprints across equivalent argument ordering
- least-privilege stdio upstream environment defaults
Failures in MCP Reference Contract are release blockers and must not be treated as optional unit-test flakes.