Skip to content

Conversation

@connor4312
Copy link
Contributor

@connor4312 connor4312 commented May 29, 2025

Motivation and Context

See #597

The Github MCP server provides resource templates... However, the MCP completions request doesn't give the client a way to tell the server what was previously completed in the template. So the user can fill in the "owner" and get completions well enough, but to complete the "repo", the MCP server has no idea who the "owner" is and cannot provide any reasonable completions.

This PR suggests a way to provide them. I'm not a big fan of the naming so if someone with stronger opinions has a point of view let me know 😛

How Has This Been Tested?

We implemented this as an experimental feature in VS Code's nightly build to resolve GH MCP's above scenario.

Breaking Changes

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Copy link
Contributor

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

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

Minor comments:

  • 1 typo
  • one reference should include prompts and the owner/repo could easily be prompt arguments to, so it's the same problem and the field should be used for both.

I don't want the comment to imply it's only for URIs

connor4312 added a commit to microsoft/vscode that referenced this pull request May 29, 2025
Refs modelcontextprotocol/modelcontextprotocol#598

Also fixes a bug I noticed where we sometimes didn't put templates in the quickpick
@connor4312
Copy link
Contributor Author

Ah right. Fixed that. Also kept it to just say "resolved variables" rather than URI template expressions since template variables seems like the more-correct thing to fill in (an expression can reference multiple variables which should be completed independently)

connor4312 added a commit to microsoft/vscode that referenced this pull request May 29, 2025
Refs modelcontextprotocol/modelcontextprotocol#598

Also fixes a bug I noticed where we sometimes didn't put templates in the quickpick
@connor4312
Copy link
Contributor Author

We've adopted this in VS Code and the Github MCP server and it's working well for us. Would love to see it ratified 🙂

Copy link
Member

@dsp-ant dsp-ant left a comment

Choose a reason for hiding this comment

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

I am okay with this change. Please update the documentation for the completion specification accordingly and mention how this is intended to be used. I think it would be worthwhile to notice how clients should handle the absence of context if they rely on it (given that it's optional)

@dsp-ant dsp-ant moved this from Draft to In Review in Standards Track Jun 5, 2025
@dsp-ant dsp-ant added this to the DRAFT 2025-06-XX milestone Jun 5, 2025
@connor4312 connor4312 requested a review from dsp-ant June 5, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Approved

Development

Successfully merging this pull request may close these issues.

5 participants