Skip to content

Conversation

@mattpodwysocki
Copy link
Contributor

@mattpodwysocki mattpodwysocki commented Jan 6, 2026

Add Mapbox Server Icon with Light and Dark Theme Support

This PR implements MCP server icons at the correct architectural level (server initialization) with both light and dark theme variants.

What's Implemented

Server-Level Icons - Icons are added to the McpServer constructor per MCP specification
Theme Support - Both light and dark variants for different UI contexts
Base64 SVG Data URIs - Logos embedded directly, no external files needed
Official Mapbox Branding - Uses official Mapbox logo assets

Implementation Details

Icons are configured in src/index.ts at server initialization:

const server = new McpServer(
  {
    name: versionInfo.name,
    version: versionInfo.version,
    icons: [
      {
        src: 'data:image/svg+xml;base64,...',
        mimeType: 'image/svg+xml',
        sizes: ['800x180'],
        theme: 'light'  // Black logo for light backgrounds
      },
      {
        src: 'data:image/svg+xml;base64,...',
        mimeType: 'image/svg+xml',
        sizes: ['800x180'],
        theme: 'dark'   // White logo for dark backgrounds
      }
    ]
  },
  { capabilities: { tools: {}, resources: {}, prompts: {} } }
);

Architecture

This follows the MCP specification where icons are part of the ImplementationSchema at the server level, not individual tool definitions.

Why server-level?

  • Icons represent the MCP server/application identity
  • They appear in client UI showing which servers are connected
  • The MCP spec defines icons in ImplementationSchema (server metadata)
  • No SDK modifications needed - this is native MCP support

Assets

  • assets/mapbox-logo-black.svg - For light theme backgrounds
  • assets/mapbox-logo-white.svg - For dark theme backgrounds

Testing

To see the icons in Claude Desktop or other MCP clients:

  1. Build the server:

    npm run build
  2. Connect the server to your MCP client

  3. Look for the Mapbox logo in the client's server list/connection UI

Note: Icon support varies by client. Claude Desktop and other modern MCP clients that support the full MCP specification will display the appropriate themed icon.

SDK Update

Also updates @modelcontextprotocol/sdk to 1.25.2 (CVE fix) which includes improved icon support.

Files Changed

  • src/index.ts - Added icons array to server initialization
  • assets/mapbox-logo-black.svg - Black logo for light themes
  • assets/mapbox-logo-white.svg - White logo for dark themes
  • package.json & package-lock.json - SDK version bump to 1.25.2
  • patches/@modelcontextprotocol+sdk+1.25.2.patch - Updated SDK patch

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

@mattpodwysocki mattpodwysocki requested a review from a team as a code owner January 6, 2026 17:04
@mattpodwysocki
Copy link
Contributor Author

TypeScript Build Error Note

The CI build is currently failing with:

src/tools/BaseTool.ts(68,12): error TS2589: Type instantiation is excessively deep and possibly infinite.

This is a pre-existing error on main, not introduced by this PR. I verified by checking out main and running the build - the same error occurs (at line 65 on main vs line 68 in this PR due to the added lines).

The issue is related to complex recursive types in the TypeScript compiler when dealing with the MCP SDK's registerTool method. All tests pass successfully (397/397), and the icon functionality works correctly at runtime.

The icon implementation is ready for review. The TypeScript build issue should be addressed in a separate PR as it affects the entire codebase.

@mattpodwysocki
Copy link
Contributor Author

Update: Build Now Passes ✅

After a clean npm install, the build passes successfully! The TypeScript error was caused by stale node_modules from before PR #88's SDK update.

The fix from PR #88 (explicit type annotations (args: any, extra: any)) is already included in this PR's code, so CI should pass on the next run.

Local verification:

npm run build
# ✅ Build succeeded!

All 397 tests passing + build passing = ready for review!

mattpodwysocki and others added 2 commits January 12, 2026 16:18
Implements MCP server icons at the correct architectural level (server
initialization) instead of at the tool level. Adds both light and dark
theme variants of the Mapbox logo using base64-encoded SVG data URIs.

- Add mapbox-logo-black.svg for light theme backgrounds
- Add mapbox-logo-white.svg for dark theme backgrounds
- Update server initialization to include icons array with theme property
- Use 800x180 SVG logos embedded as base64 data URIs

This replaces the previous incorrect approach of adding icons to
individual tools, which was not aligned with the MCP specification.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates the MCP SDK from 1.25.1 to 1.25.2 and recreates the output
validation patch for the new version. The patch continues to convert
strict output schema validation errors to warnings, allowing tools
to gracefully handle schema mismatches.

Changes:
- Update @modelcontextprotocol/sdk from ^1.25.1 to ^1.25.2
- Recreate SDK patch for version 1.25.2
- Remove obsolete 1.25.1 patch file
- All 397 tests pass with new SDK version

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki changed the title Add Mapbox icon to all tools Add Mapbox icon to the MCP server Jan 12, 2026
@mattpodwysocki mattpodwysocki force-pushed the add-mapbox-icon-to-tools branch from c04541b to c205821 Compare January 13, 2026 04:13
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.

1 participant