Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Build
Start
Reference code
Tools
API reference
Public services
Agents
Bindings and crosswalks

obsp-mcp (reference Model Context Protocol server)

Source reference/mcp/obsp-mcp/README.md

On this page
  1. Tools
  2. Run
  3. Configuration
  4. Client configuration
  5. Registry manifest
  6. Tests
  7. Server manifest

A read-only Model Context Protocol server for the Observatory Protocol. It lets an AI agent check the evidence behind a reading (schema, signature envelope, inclusion proof, credential status, correction state, usage policy) instead of trusting the reading it was handed. TypeScript on Node.js 22.18 or later (run directly with Node’s type stripping, no build step), the official MCP TypeScript SDK pinned to an exact version, Apache-2.0.

DRAFT reference code. It makes no conformance claim, and most of what it checks follows DRAFT change proposals (OIP-0008, OIP-0014, OIP-0015, OIP-0016, OIP-0021, OIP-0001, OIP-0009), which are not part of the protocol until the editors accept them. A PASS says the supplied evidence is present and consistent; it never says a reading is true. Threat model and security controls: docs/security/mcp.md.

Tools

Every tool is read-only and deterministic for a given input (pass at to fix the evaluation time), with a JSON Schema for its input and its output. Results are PASS, FAIL, INCONCLUSIVE or NOT_APPLICABLE per check, each with the requirement ids it checks, and a scope sentence saying what the result does not establish. Text copied from a record or a fetched document is returned only inside untrustedData.

Tool What it checks Built on
verify_record schema; the draft OIP-0008 envelope: COSE_Sign1 over the RFC 8785 form, algorithm register (Ed25519, ES256, ES384, ML-DSA-44/65/87), protected header, payload digest, key resolution, the signature; the key record (status, validity, object class, test key); time quality (REQ-5.4-1, REQ-5.4-3) and provenance (P5, REQ-5.6-2) bound by UNI and digest obsp-sdk (verifyEnvelope), a pure-JS FIPS 204 verifier for ML-DSA where WebCrypto lacks it
check_inclusion_proof RFC 9162 leaf hash, audit path, root against a signed tree head (or a consistency proof to it), the head’s signature port of the reference log’s Merkle code
validate_object JSON Schema 2020-12 against schemas/json or the draft schemas; every failing rule obsp-sdk (SchemaSet)
resolve_uni, get_authority_document draft OIP-0016 UNI forms (DSC-1, DSC-2); authority document schema, expiry, rollback, signature (DSC-3 to DSC-5, DSC-9); offline cache first port of services/public-services discovery
credential_status draft OIP-0015 CRED-4: Bitstring Status List entry, list issuer and key, COSE securing, in force, bit clear; fail closed port of the draft’s reference verifier
conformance_record an implementation’s level in the registry export (DECLARED, SELF_TESTED, PEER_TESTED only) with evidence digests registers/implementations.json layout
explain_requirement, list_requirements, list_profiles requirement text, cases, coverage; profiles and levels registers/requirements.yaml, the draft proposals, registers/conformance-profiles.yaml
query_observations, get_corrections observations and the correction state of a product or record from a gateway’s OGC API read endpoint (EXCH-4, EXCH-5, EXCH-9; BND-OGCAPI-03, -04, -05, -07) drafts OIP-0001, OIP-0009
check_usage_policy may this use proceed: the draft OIP-0014 evaluator (GOV-3 to GOV-9, every reason code) and, with sovereignty evidence, the draft OIP-0021 invariants (SOV-1 to SOV-10) ports of the drafts’ reference code

Resources: the specification (obsp://spec/OBSP-0.1) and each of its sections (obsp://spec/OBSP-0.1/section/5.4), the registers (obsp://registers/<file>), the live schemas (obsp://schemas/<name>) and the draft schemas (obsp://schemas/draft/<name>). Prompt: verify-before-you-rely.

The server reads the contracts from a checkout (or an exported tree) of this repository: OBSP_MCP_DATA_ROOT, by default the repository that holds this folder. Nothing is copied, so it cannot drift from the files.

Run

cd reference/mcp/obsp-mcp
npm ci
node src/cli.ts --stdio                       # stdio transport
OBSP_MCP_HTTP_PORT=8765 node src/cli.ts --http  # stateless Streamable HTTP on http://127.0.0.1:8765/mcp

make mcp from the repository root installs the locked dependencies, type-checks and runs the tests.

Configuration

Environment variables (or a JSON file with the setting names of src/config.ts, passed as --config <file>). No setting holds a secret: the HTTP bearer tokens are read from the environment variable whose name you configure.

Variable Default Meaning
OBSP_MCP_DATA_ROOT this repository where schemas, registers, specification and drafts are read
OBSP_MCP_NETWORK off off or allow-list
OBSP_MCP_ALLOW empty comma-separated origins (https://host[:port]) the server may read from
OBSP_MCP_GATEWAY none base URL of a gateway’s OGC API read endpoint (must be allow-listed)
OBSP_MCP_AUTHORITY_CACHE none folder of pinned authority documents (offline cache)
OBSP_MCP_AUTHORITY_BASES none authority=baseUrl pairs, for a mirror of an authority’s well-known path
OBSP_MCP_KEY_RECORDS none folder of key records to resolve key ids against when a call supplies none
OBSP_MCP_REGISTRY_EXPORT registers/implementations.json the registry export conformance_record reads
OBSP_MCP_AUDIT_LOG ./obsp-mcp-audit.jsonl the audit log (one hash-chained line per call, digests only)
OBSP_MCP_MAX_INPUT_BYTES, OBSP_MCP_MAX_DEPTH, OBSP_MCP_MAX_OUTPUT_BYTES 1 MiB, 64, 4 MiB input and output limits
OBSP_MCP_HTTP_HOST, OBSP_MCP_HTTP_PORT 127.0.0.1, 8765 HTTP listener
OBSP_MCP_HTTP_RATE_PER_MINUTE 60 requests per minute per client
OBSP_MCP_HTTP_TOKENS_ENV_VAR none NAME of the variable holding label:token[,label:token]; when set, HTTP needs a bearer token

Client configuration

A client that starts servers from a JSON file (the common mcpServers layout):

{
  "mcpServers": {
    "obsp": {
      "command": "node",
      "args": ["/path/to/observatory-protocol/reference/mcp/obsp-mcp/src/cli.ts", "--stdio"],
      "env": {
        "OBSP_MCP_AUDIT_LOG": "/var/log/obsp-mcp/audit.jsonl",
        "OBSP_MCP_KEY_RECORDS": "/etc/obsp/key-records"
      }
    }
  }
}

With a gateway to read from (the network stays limited to the allow-list):

{
  "mcpServers": {
    "obsp": {
      "command": "node",
      "args": ["/path/to/observatory-protocol/reference/mcp/obsp-mcp/src/cli.ts", "--stdio"],
      "env": {
        "OBSP_MCP_NETWORK": "allow-list",
        "OBSP_MCP_ALLOW": "https://data.example.org",
        "OBSP_MCP_GATEWAY": "https://data.example.org/ogc",
        "OBSP_MCP_AUTHORITY_CACHE": "/etc/obsp/authorities"
      }
    }
  }
}

A client that connects over HTTP:

{
  "mcpServers": {
    "obsp": { "type": "http", "url": "http://127.0.0.1:8765/mcp", "headers": { "Authorization": "Bearer ${OBSP_MCP_TOKEN}" } }
  }
}

Registry manifest

server.json describes the server for MCP registries. Nothing is published: the package is private, npm publish stops in prepublishOnly (tools/guard-publish.ts) unless the maintainers approve a release, and the obsp-sdk dependency is a local file: link, which a published package would have to replace. Publishing to a package registry or an MCP registry is the maintainers’ decision.

Tests

npm test (or make mcp) runs, with Node’s test runner:

  • validate.test.ts: every fixture of fixtures/positive passes and every one of fixtures/negative fails; the draft OIP-0016 fixtures both ways; the register tools;
  • verify.test.ts: the 18 draft OIP-0008 signature vectors (ML-DSA-65 included), time quality and provenance bindings both ways; inclusion and consistency proofs and signed tree heads made by the Python reference log;
  • lookup.test.ts: UNI resolution and authority documents (offline, allow-list, rollback, unsigned successor, forged document); the draft OIP-0015 credential vectors that exercise the status check; the registry export;
  • gateway-policy.test.ts: a local gateway serving the draft OIP-0009 examples; every draft OIP-0014 evaluation vector; the draft OIP-0021 sovereignty evidence;
  • security.test.ts: limits, input schemas, untrusted text, the audit log (read back by the Python reference log), configuration, rate limiting, pinned dependencies, the publish guard;
  • e2e.test.ts: the MCP SDK client over stdio and over stateless Streamable HTTP (bearer token, 429, Host check).

Draft material is read out of the proposals’ patches at test time, not copied. test/fixtures/generated/ is written by python3 tools/make_fixtures.py with the repository’s Python reference services (TEST keys whose private parts are public); a test checks the files are current. test/fixtures/registry/ holds an invented registry export.

Server manifest

FieldValue
Nameio.github.gcri/obsp-mcp
Version0.0.1
DescriptionRead-only tools to check an Observatory Protocol record's evidence before relying on a reading.
Transportsstdio
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
  "name": "io.github.gcri/obsp-mcp",
  "title": "Observatory Protocol evidence checks",
  "description": "Read-only tools to check an Observatory Protocol record's evidence before relying on a reading.",
  "version": "0.0.1",
  "repository": {
    "url": "https://github.com/gcri/observatory-protocol",
    "source": "github",
    "subfolder": "reference/mcp/obsp-mcp"
  },
  "packages": [
    {
      "registryType": "npm",
      "identifier": "obsp-mcp",
      "version": "0.0.1",
      "runtimeHint": "node",
      "transport": {
        "type": "stdio"
      },
      "packageArguments": [
        {
          "type": "positional",
          "value": "--stdio"
        }
      ],
      "environmentVariables": [
        {
          "name": "OBSP_MCP_DATA_ROOT",
          "description": "Root of a checkout or exported tree of the protocol repository (schemas, registers, specification).",
          "isRequired": false
        },
        {
          "name": "OBSP_MCP_NETWORK",
          "description": "off (default) or allow-list.",
          "isRequired": false,
          "default": "off"
        },
        {
          "name": "OBSP_MCP_ALLOW",
          "description": "Comma-separated https origins the server may read from when the network is allow-list.",
          "isRequired": false
        },
        {
          "name": "OBSP_MCP_GATEWAY",
          "description": "Base URL of a gateway's OGC API read endpoint; must be on the allow-list.",
          "isRequired": false
        },
        {
          "name": "OBSP_MCP_AUDIT_LOG",
          "description": "Path of the audit log (hash-chained JSON lines).",
          "isRequired": false
        }
      ]
    }
  ]
}