Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

Fix non-default-version templated resources and add tools for programmatic resource access#47

Open
olaservo wants to merge 9 commits into
mainfrom
dev
Open

Fix non-default-version templated resources and add tools for programmatic resource access#47
olaservo wants to merge 9 commits into
mainfrom
dev

Conversation

@olaservo
Copy link
Copy Markdown
Owner

@olaservo olaservo commented Oct 26, 2025

Fixes #35
Fixes #49

Summary

  • Implements three new tools for programmatic MCP documentation resource access
  • Refactors resource fetching to eliminate ~200+ lines of redundant code
  • Improves tool descriptions for better LLM clarity

New Tools

  • getResource: Fetch any MCP documentation resource by its exact URI
  • getSpecificationResource: Fetch MCP specification documentation by version and section
  • listAvailableResources: List all available MCP documentation resources

Key Changes

  • Added zod and zod-to-json-schema dependencies for tool schema validation
  • Created shared fetchResourceContentByUri() helper function
  • Simplified tool descriptions to be more concise and action-oriented (60-67% shorter)
  • Updated server capabilities to include tools support

Test Plan

  • Build succeeds with TypeScript
  • Test tools with MCP-compatible LLM application
  • Verify resource fetching works for all resource types
  • Confirm tool descriptions are clear to LLMs

🤖 Generated with Claude Code

olaservo and others added 4 commits October 26, 2025 10:35
This workflow runs npm test daily at 9:00 AM UTC to detect if upstream
MCP documentation changes have broken the URL matching tests. When tests
fail, it automatically creates a GitHub issue (avoiding duplicates) to
notify maintainers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…hing

Implements three new tools that allow LLMs to programmatically fetch MCP documentation resources:
- getResource: Fetch any resource by exact URI
- getSpecificationResource: Convenient spec fetching by version and section
- listAvailableResources: Discover all available resources

Refactors resource fetching logic to eliminate ~200+ lines of redundant code by extracting shared fetchResourceContentByUri() helper function used by both the ReadResourceRequestSchema handler and tool handlers.

Adds zod and zod-to-json-schema dependencies for tool schema validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Simplifies tool descriptions to be more concise and action-oriented:
- getResource: 63% shorter, removes redundant examples
- getSpecificationResource: 60% shorter, removes editorial comments
- listAvailableResources: 67% shorter, removes redundant details

Follows best practices from reference implementation with direct, verb-led descriptions that focus on the action rather than meta-commentary.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@olaservo olaservo requested a review from Copilot October 26, 2025 23:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds programmatic access to MCP documentation resources through three new tools while significantly reducing code duplication. The implementation introduces getResource, getSpecificationResource, and listAvailableResources tools that enable LLMs to fetch documentation programmatically, and refactors the resource fetching logic into a shared helper function that eliminates ~200 lines of duplicate code.

Key changes:

  • Added three new MCP tools with Zod schema validation for programmatic resource access
  • Refactored resource fetching by extracting common logic into fetchResourceContentByUri() helper
  • Added GitHub workflow for daily upstream documentation testing

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/index.ts Added tool handlers, Zod schemas, and refactored resource fetching into shared helper function
package.json Added zod and zod-to-json-schema dependencies for tool schema validation
.github/workflows/daily-upstream-test.yml Added daily workflow to test against upstream MCP documentation and create issues on failures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
olaservo and others added 3 commits October 26, 2025 17:39
Addresses GitHub Copilot review comments on PR #47 by using the existing ContentItem interface instead of any type in resource mapping functions, improving type safety and code maintainability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Refactors GetSpecificationResourceSchema to use the SUPPORTED_VERSIONS constant instead of hardcoding version values, improving maintainability. Adds type-safe helper function isSupportedVersion() to handle version validation consistently throughout the codebase.

Changes:
- Convert SUPPORTED_VERSIONS to const tuple for Zod enum compatibility
- Add SupportedVersion type and isSupportedVersion() type guard
- Replace all SUPPORTED_VERSIONS.includes() calls with type-safe helper
- Eliminates version list duplication between constant and schema

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@olaservo olaservo requested a review from Copilot October 27, 2025 00:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts
@olaservo olaservo changed the title Add tools for programmatic resource access Fix non-default-version templated resources and add tools for programmatic resource access Oct 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Templated resources not working for any version besides latest published spec version Add Tools as an alternative for fetching the existing Resources

2 participants