feat(mcp): expose the vault catalog as MCP resources (#545) - #757
Merged
manoahLinks merged 2 commits intoAug 30, 2026
Merged
Conversation
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>
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #545
Summary
Implements #545 — the MCP server now advertises the
resourcescapability alongsidetoolsandprompts, 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 stablemindvault://resource/<id>URIs.resources/list→ maps every catalog entry fromGET /resourcesto 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>/metaendpoint — gated content is never exposed.InvalidParamserrors; backend failures surface the existing mapped HTTP/transport errors.mcp/src/index.ts: addedresources: {}to the advertised capabilities and registeredListResourcesRequestSchema/ReadResourceRequestSchemahandlers.catalogResources.test.ts) covering URI parsing, list/read, unknown-URI and failure handling; 3 integration tests exercisingresources/list+resources/readthrough the in-memory harness in mock mode; harness extended withlistResources()/readResource().docs/mcp-quickstart.mddocuments the new capability and URI contract.Also repaired (pre-existing breakage blocking CI)
mcp/src/index.tswas uncompilable onmain(missing braces innetworkProfile(), duplicateddispatchToolswitch cases, a grafted refactor tail referencing undefined symbols), which broke the entire MCP build and test suite. Repaired alongside:return/closing brace and removed the orphaned duplicated switch block + grafted export tail; restored missingMuteximport,checkBindings/toolMetrics, the#556offline catalog cache wiring, the#603API-health preflight gate, dry-runmindvault_buyargument handling, and structured tool results for tools advertisingoutputSchema.describe/itblock inindex.test.ts, added the missingmindvault_recover_catalog_cacheannotations/fixture, updated stale tests for merged features (x402 payment ceiling, sponsored-account diagnostics format), regenerateddocs/mcp-tool-reference.md, and applied lint/format fixes.Verification
All local CI-equivalent checks pass:
pnpm exec eslinton server/web/packages/mcp — 0 errorspnpm exec prettier --checkon server/web/packages/mcp — cleanpnpm run build:registry-client, server typecheck/build, web build, mcp build — passpnpm --filter @mindvault/mcp smoke:install— passpnpm test(registry-client 22, server 273, web 72, mcp 1135) — all passnode scripts/check-doc-links.mjs— pass