Repo MCP Contract Expectation¶
Contract Expectation¶
The workspace discovery layer must declare repo capability and authority before any top-layer agent attempts repo-local file loads.
Expected behavior:
- Resolve target repo through the workspace registry first.
- Registry must explicitly declare whether a repo has a real repo manifest.
- Only load
docs/agent/manifest.yamlwhen the registry says it exists. - If no repo manifest exists, use registry-declared fallback entrypoints instead of probing blindly.
- Repo-local manifest remains authoritative when present.
- Workspace registry is discovery and routing authority, not content override authority.
- The registry-first rule must be enforced in
workspace-mcpserver handlers and MCP tools, not left to caller discipline.
Minimum Registry Contract Per Repo¶
repo_id: stable repo keymanifest_source:repoorgeneratedmanifest_path: absolute path when presententrypoints: ordered safe-to-read filesresource_roots: bounded scan roots by typeauthority_order: declared precedencerepo_class:dirac/oves/legacylifecycle:active/transitional/archivedowner: owning team or authoritysignals.has_docssignals.has_mkdocssignals.has_adrsignals.has_intents
Observed Gap¶
Current usage pattern is still too optimistic:
- top layer may try
docs/agent/manifest.yamldirectly - some repos still do not have that file
- this creates avoidable lookup failures during rollout
- fallback exists, but only after a failed blind load
Concrete Example¶
workspace-mcprepo is correctly declared in the registry and has a repo manifestmkdocs-templatenow has a repo manifest and explicit context docs- many other active repos are still registry-only
- current flow can still attempt direct manifest loading on a registry-only repo
- expected flow should consult registry first, see
manifest_source: generated, then route to fallback entrypoints likeREADME.md,docs/index.md, ormkdocs.yml
Required MCP Setup Change¶
Change resolution flow from:
- try nearest repo manifest
- then fallback to registry
to:
- resolve repo in registry
- if registry declares
manifest_path, load it - else use registry-declared fallback entrypoints
- only if repo is missing from registry, use heuristic probing
Why This Matters¶
- avoids fragile top-layer behavior during manifest rollout
- makes missing manifests an expected declared state, not an error condition
- reduces blind file probing
- gives agents a deterministic, bounded discovery contract
- supports mixed maturity repos cleanly
Next Layer¶
Once the registry-first contract is in place, repo-specific context services should be exposed in the same pattern:
repo://<repo>/manifestrepo://<repo>/start-hererepo://<repo>/capabilitiesrepo://<repo>/workflowsrepo://<repo>/contracts
These should be loaded only through declared registry or manifest-backed paths, not through open-ended probing.
Optional Hardening¶
- add
discovery_mode:manifest-backed/registry-fallback/heuristic - add
safe_to_probe: true/false - add
entrypoint_statusmetadata so missing files can be surfaced by the registry generator rather than by runtime agent failure
Bottom Line¶
The MCP discovery contract should be registry-first, manifest-when-declared, and heuristic-only-as-last-resort. The data already exists; the calling pattern must now be tightened in the server and exposed resources.