Skip to content

MCP server lifecycle

Status: proposed (constitution § 25, amendment mcp-lifecycle; epic #683, backlog #684). Feature: HUB-NEW / slug mcp-lifecycle. Requirement: FR-NEW:mcp-lifecycle. Roadmap: FF-NEW:mcp-lifecycle. Sub-PRD / user stories: docs/prd/MCP-SERVERS.md. Operator guide for the console MCP layer (implementation): tools/console/docs/mcp-layer.md.

This is the hub's centralized standard for building, registering, configuring and running Model Context Protocol (MCP) servers across the monorepo and related fleet repos. HUB-031 remains the Harness Console MCP implementation; this doc is the lifecycle umbrella.

Inventory (today)

See the consolidation checklist: mcp-servers-inventory.md and issue #684.

Hub highlights:

Kind Where Notes
Agent client config .mcp.json github, memory, sequentialthinking, context7, playwright, fleet
Verify kit client verify/mcp.json Playwright only
Console MCP server tools/console/mcp_layer/ stdio + HTTP :4002; tools/dash mcp
Compose profiles mcp, mcp-tunnel Opt-in sidecar + cloudflared quick tunnel
Legacy tools/fleetcore/mcp_server.py Delegates to mcp_layer

Registry

Canonical list: _data/mcp_servers.yml (mcp-servers/v1).

Every fleet-known MCP server gets a row before it is treated as supported. Status values:

  • canonical — preferred hub entry
  • legacy — still works; do not extend; migrate when touched
  • spoke — owned by another repo; hub tracks for fan-out
  • proposed — planned / issue-linked

Secret fields store names only (HARNESS_MCP_TOKEN, GITHUB_TOKEN, …). Never values.

A row whose server has an MCP Registry manifest names it in server_json: (a path in the hub; a spoke's manifest lives in its own repo). The lint checks that the file exists and that its name ends in /<id>.

Client config schema

Committed files use:

{
  "mcpServers": {
    "<id>": {
      "command": "…",
      "args": ["…"],
      "env": { "SOME_TOKEN": "${SOME_TOKEN}" }
    }
  }
}

HTTP clients (Cursor / remote) may use url + headers with ${env:NAME} style interpolation — still no literals.

Forbidden in git: personal access tokens, API keys, sk-…, ghp_…, gho_…, bearer literals, private key PEM blocks.

Naming

  • Ids: kebab-case, unique in the registry.
  • Keep agent-facing name fleet for the console MCP until a migration PR updates .mcp.json, permissions (mcp__fleet__*), and the registry together.

Transports and tunnels

Transport Use Guard
stdio Local Claude Code / Cursor / dash mcp Default for interactive agents
streamable HTTP Remote agents / compose mcp Loopback bind; Authorization: Bearer $HARNESS_MCP_TOKEN; Host allowlist
Quick tunnel Temporary remote demo Opt-in; hostname unstable; do not commit URL
Named tunnel / Tailscale Standing remote Document host in allow-list env; refresh docs when DNS changes

Auth, writes, kill switch

  • Console MCP HTTP auth: HARNESS_MCP_TOKEN (separate from DASH_CONSOLE_TOKEN).
  • Writes: off unless HARNESS_MCP_ALLOW_WRITES=1; tools need confirm=true.
  • GitHub-mutating ops still pass through the console allowlist and workflow kill switches.

Health

  • Compose mcp healthcheck: /mcp answering 401 (server up, auth required) is healthy.
  • tools/dash mcp --list-tools / --tunnel-url for operator checks.
  • P1: dash mcp status summarizing registry + live probes.

Versioning

  • Record npm package / Python module identity on the registry row.
  • Prefer the UPS baseline for always-on agent servers; document @latest when the verify kit intentionally floats.
  • Breaking tool renames: registry notes + migration window on the epic.

Registry manifests (server.json)

Constitution § 16.4 asks that MCP manifests follow the MCP Registry server.json schema. The hub's console server has one at tools/console/server.json (schema 2025-12-11, name io.github.bamr87/fleet), and the registry row fleet points at it with server_json:. Its version is the console layer's VERSION, and the tests fail when the two differ. It declares stdio and no packages or remotes: the server is not a published package, and its HTTP endpoints are loopback or a temporary tunnel. The launch and the env var names are recorded under _meta → io.modelcontextprotocol.registry/publisher-provided. Why the manifest is shaped this way, and how to validate it against the official schema, is in tools/console/docs/mcp-layer.md.

Nothing publishes a manifest to the public MCP Registry. Publishing, and the io.github.bamr87 namespace sign-in it needs, is the maintainer's decision.

Lint

python3 tools/mcp_servers_lint.py check .          # warn-only (default)
python3 tools/mcp_servers_lint.py check . --gate   # hard fail (after adoption)

Checks committed MCP JSON configs and _data/mcp_servers.yml: shape, inline-secret heuristics, ${ENV} for secret-looking keys, unknown server ids (warn).

It also checks every server.json in the hub, skipping projects/, dependencies, virtualenvs and build output. Each one needs the registry $schema URL and a name of the form io.github.<owner>/<server>. Its description is 1 to 100 characters. Its version is one specific version: no range and not latest. It declares at least one transport. Environment variables are given by name: a secret's value is only ever a {placeholder}, and the publisher-provided block holds names only. It contains no secret literal and no machine-local endpoint (loopback, host.docker.internal or a trycloudflare.com quick tunnel). For the console manifest, the version must also equal VERSION in tools/console/mcp_layer/server.py, and the console server must have a manifest at all.

Fan-out

Hub first. Spoke repos get a seed-kit PR (epic #683 P3) that aligns verify/mcp.json / baseline .mcp.json and flips the lint from warn to fail. Do not edit submodule checkouts in the ratification PR.