Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Summary

Removes the sizes field from icon definitions to fix connection failures with older MCP clients that expect a string instead of an array.

Why

The 2025-11-25 MCP spec changed Icon.sizes from a string to an array. The server uses SDK v1.2.0-pre.1 which implements the array format, but clients like Cursor v2.2.36 still expect a string, causing schema validation errors during initialization.

What changed

  • Omit optional Sizes field in octicons.Icons() function
  • Update tests to verify field is empty
  • Regenerate toolsnaps for tools with explicit icons (assign_copilot_to_issue, fork_repository, merge_pull_request, request_copilot_review, star_repository)

MCP impact

  • Tool schema or behavior changed
    Tools with icons now omit the sizes field. Icons remain functional via source (data URI) and mimeType fields.

Prompts tested (tool changes only)

Not applicable - change affects icon metadata only, not tool functionality.

Security / limits

  • No security or limits impact

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
    Icon field is internal metadata; no user-facing documentation required.
Original prompt

#1644

Can you see if there is a way to record the SDK version from initialize (like we do for host) and unless the spec version is high enough use the old icon size string format, or omit. If that's not possible, then ommit icons entirely for now.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Remove Sizes field from octicons.Icons() to fix compatibility with older MCP clients
- Older clients like Cursor expect sizes to be a string, not an array
- The 2025-11-25 MCP spec changed sizes from string to array
- Omitting the optional Sizes field makes icons compatible with all clients
- Update tests and toolsnaps to reflect the change

Fixes #1644

Co-authored-by: SamMorrowDrums <[email protected]>
Copilot AI changed the title [WIP] Add SDK version recording in initialize process Omit icon sizes field for backward compatibility with older MCP clients Dec 18, 2025
Copilot AI requested a review from SamMorrowDrums December 18, 2025 18:40
@SamMorrowDrums SamMorrowDrums marked this pull request as ready for review December 18, 2025 18:42
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner December 18, 2025 18:42
Copilot AI review requested due to automatic review settings December 18, 2025 18:42
Copy link
Contributor

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 removes the sizes field from icon definitions to maintain backward compatibility with older MCP clients. The MCP spec changed on 2025-11-25 from requiring Icon.sizes as a string to an array format. Since the SDK now uses the array format but older clients like Cursor v2.2.36 still expect a string, omitting this optional field prevents schema validation errors during initialization while maintaining icon functionality through the source and mimeType fields.

Key Changes

  • Removed Sizes field assignment in octicons.Icons() function
  • Updated tests to verify the Sizes field remains empty
  • Regenerated toolsnaps for the 5 tools with explicit icons

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/octicons/octicons.go Removed Sizes field assignments from both light and dark icon variants in the Icons() function; added documentation explaining the backward compatibility rationale
pkg/octicons/octicons_test.go Updated test assertions to verify Sizes field is empty using assert.Empty() with clarifying comments
pkg/github/toolsnaps/assign_copilot_to_issue.snap Removed sizes array from icon definitions in tool schema snapshot
pkg/github/toolsnaps/fork_repository.snap Removed sizes array from icon definitions in tool schema snapshot
pkg/github/toolsnaps/merge_pull_request.snap Removed sizes array from icon definitions in tool schema snapshot
pkg/github/toolsnaps/request_copilot_review.snap Removed sizes array from icon definitions in tool schema snapshot
pkg/github/toolsnaps/star_repository.snap Removed sizes array from icon definitions in tool schema snapshot

@SamMorrowDrums SamMorrowDrums merged commit a8fafad into main Dec 18, 2025
23 checks passed
@SamMorrowDrums SamMorrowDrums deleted the copilot/record-sdk-version-usage branch December 18, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants