fix(mcp): correct the exportTypes MCP-gating example#601
Open
kylebernhardy wants to merge 1 commit into
Open
Conversation
The `### exportTypes gating` example showed
`server.http(Resource, { exportTypes: { mcp: false } })`, but server.http
(= httpServer in harper server/http.ts) registers HTTP handlers and never reads
exportTypes — so that call does not gate MCP. The mechanism is the resource
registration call, `server.resources.set(path, Resource, { mcp: false })`
(resources/Resources.ts). Verified against harper main.
Also notes that a `static exportTypes` field on the class is not read, which is
a common adjacent mistake.
Comment generated by kAIle (Claude Opus 4.8)
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in reference/mcp/tools-and-resources.md to clarify that exportTypes gating is configured via server.resources.set rather than server.http, and updates the corresponding code example. There are no review comments, and I have no additional feedback to provide.
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-601 This preview will update automatically when you push new commits. |
kriszyp
approved these changes
Jul 23, 2026
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.
Summary
The
### exportTypes gatingsection on the MCP Tools and Resources page documents gating a Resource out of the MCP surface with:That call does not gate anything.
server.http(=httpServer, harperserver/http.ts) registers HTTP handlers and readsport/name/before/after/urlPath/host/runFirst— it has zeroexportTypeshandling. TheexportTypesmap is consumed by the resource registration call:Verified against harper
main:Resources.set(path, resource, exportTypes)(resources/Resources.ts) stores it, and the MCP enumerator readsentry.exportTypes?.mcp(components/mcp/resources.ts). Also added a note that astatic exportTypesfield on the class is not read — a common adjacent mistake.Why now
@kriszyp flagged this same pattern in the
harper-mcpskill review (HarperFast/skills#69), where it was corrected. Theharper-mcpskill is being flipped to generate its rules from these docs, andautomatic-verb-toolsis the one docs-mapped rule that can't flip until this example is fixed — generating from the buggy source would bake the broken call back into the skill. This unblocks that flip.Where to look
One example swapped in
reference/mcp/tools-and-resources.mdplus a one-sentence clarification. Prose about theexportTypes.mcpconcept is unchanged and was already correct.Cross-links: HarperFast/skills#69.
🤖 Generated with Claude Code (Claude Opus 4.8)