Skip to content

feat(mcp): expose the vault catalog as MCP resources (#545) - #757

Merged
manoahLinks merged 2 commits into
mind-vault-1:mainfrom
obedojukwu50-stack:feat/mcp-545-catalog-resources
Aug 30, 2026
Merged

feat(mcp): expose the vault catalog as MCP resources (#545)#757
manoahLinks merged 2 commits into
mind-vault-1:mainfrom
obedojukwu50-stack:feat/mcp-545-catalog-resources

Conversation

@obedojukwu50-stack

@obedojukwu50-stack obedojukwu50-stack commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Closes #545


Summary

Implements #545 — the MCP server now advertises the resources capability alongside tools and prompts, so agents can discover vault catalog entries and read their public metadata without invoking a tool.

What changed

  • mcp/src/catalogResources.ts (new): MCP resources support with stable mindvault://resource/<id> URIs.
    • resources/list → maps every catalog entry from GET /resources to an MCP resource (name = title, description, mimeType: application/json).
    • resources/read → resolves the URI and returns public metadata only (id, title, description, price, type, verification status, access URL) from the /resources/<id>/meta endpoint — gated content is never exposed.
    • Deterministic failures: malformed/unknown URIs and unknown ids return InvalidParams errors; backend failures surface the existing mapped HTTP/transport errors.
  • mcp/src/index.ts: added resources: {} to the advertised capabilities and registered ListResourcesRequestSchema / ReadResourceRequestSchema handlers.
  • Tests: 20 unit tests (catalogResources.test.ts) covering URI parsing, list/read, unknown-URI and failure handling; 3 integration tests exercising resources/list + resources/read through the in-memory harness in mock mode; harness extended with listResources() / readResource().
  • Docs: docs/mcp-quickstart.md documents the new capability and URI contract.

Also repaired (pre-existing breakage blocking CI)

mcp/src/index.ts was uncompilable on main (missing braces in networkProfile(), duplicated dispatchTool switch cases, a grafted refactor tail referencing undefined symbols), which broke the entire MCP build and test suite. Repaired alongside:

  • Restored the missing return/closing brace and removed the orphaned duplicated switch block + grafted export tail; restored missing Mutex import, checkBindings/toolMetrics, the #556 offline catalog cache wiring, the #603 API-health preflight gate, dry-run mindvault_buy argument handling, and structured tool results for tools advertising outputSchema.
  • Fixed an unclosed describe/it block in index.test.ts, added the missing mindvault_recover_catalog_cache annotations/fixture, updated stale tests for merged features (x402 payment ceiling, sponsored-account diagnostics format), regenerated docs/mcp-tool-reference.md, and applied lint/format fixes.

Verification

All local CI-equivalent checks pass:

  • pnpm exec eslint on server/web/packages/mcp — 0 errors
  • pnpm exec prettier --check on server/web/packages/mcp — clean
  • pnpm run build:registry-client, server typecheck/build, web build, mcp build — pass
  • pnpm --filter @mindvault/mcp smoke:install — pass
  • pnpm test (registry-client 22, server 273, web 72, mcp 1135) — all pass
  • node scripts/check-doc-links.mjs — pass

Add the `resources` capability to the MindVault MCP server so agents can
discover catalog entries with resources/list and read their public metadata
with resources/read, without invoking a tool. Catalog entries get stable
mindvault://resource/<id> URIs; reads serve only the public meta endpoint,
never gated content. Unknown URIs and missing entries fail with deterministic
errors, and the new module is covered by unit and integration tests.

Also repairs merge damage that left mcp/src/index.ts uncompilable (missing
braces, duplicated switch cases, a grafted refactor tail) and stale tests
that failed against merged features (x402 payment ceiling, API health
preflight, offline catalog cache, structured tool results), plus regenerated
tool docs and lint/format fixes so all MCP and workspace CI checks pass.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@obedojukwu50-stack Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MCP] Expose the vault catalog through MCP resources/list and resources/read

2 participants