Add resource://mapbox-documentation with proper MIME type support #59
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
Adds
resource://mapbox-documentationas a proper MCP resource withtext/markdownMIME type, while keeping the existingget_latest_mapbox_docs_toolfor broad compatibility.Why This Matters
Following up on PR #58 which added the Accept header, this PR provides the full solution for clients that properly support MCP resources:
Tool (
get_latest_mapbox_docs_tool):type: 'text'(no MIME type)Resource (
resource://mapbox-documentation):mimeType: 'text/markdown'(properly typed)Changes
New Files:
src/resources/mapbox-documentation-resource/MapboxDocumentationResource.ts- Resource implementationtest/resources/mapbox-documentation-resource/MapboxDocumentationResource.test.ts- Comprehensive testsModified Files:
src/resources/resourceRegistry.ts- Register new resourcesrc/tools/get-mapbox-doc-source-tool/GetMapboxDocSourceTool.ts- Updated description to mention resourcesrc/tools/get-reference-tool/GetReferenceTool.ts- Fixed TypeScript type assertiontest/tools/__snapshots__/tool-naming-convention.test.ts.snap- Updated snapshotImplementation Details
The
MapboxDocumentationResource:https://docs.mapbox.com/llms.txttext/markdown, text/plain;q=0.9, */*;q=0.8)mimeType: 'text/markdown'Testing
User Experience
Users now have two ways to access documentation:
Call the tool (works everywhere):
Read the resource (better typing):
// Client reads resource://mapbox-documentationThe tool description mentions the resource for clients that support it:
Consistency
This follows the same pattern we use with:
resource://mapbox-style-layersresource://mapbox-streets-v8-fieldsresource://mapbox-token-scopesresource://mapbox-layer-type-mappingThe key difference is that this resource fetches from an external URL (docs.mapbox.com) rather than returning static content, making it always up-to-date.