Skip to content

Add support for Model Context Protocol#456

Open
martin-fleck-at wants to merge 1 commit intomasterfrom
issues/1546
Open

Add support for Model Context Protocol#456
martin-fleck-at wants to merge 1 commit intomasterfrom
issues/1546

Conversation

@martin-fleck-at
Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at commented Dec 18, 2025

What it does

  • Extend the client-server protocol with server initialization hook
  • Provide some shared types and utility functions for MCP

Part of eclipse-glsp/glsp#1546

How to test

Follow-ups

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

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 foundational support for Model Context Protocol (MCP) by introducing server initialization hooks and shared types. The changes enable GLSP servers to optionally start MCP servers during initialization and communicate their accessibility information back to clients.

Key changes:

  • Introduced GLSPServerInitContribution interface for extending server initialization
  • Added MCP-specific types for configuration and results
  • Exported new MCP module through protocol package index

Reviewed changes

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

File Description
packages/protocol/src/index.ts Exports the new MCP module to make it available to package consumers
packages/protocol/src/client-server-protocol/mcp.ts Defines MCP server configuration types, initialization parameters/results, and utility functions
packages/protocol/src/client-server-protocol/glsp-server.ts Adds GLSPServerInitContribution interface to enable server initialization customization

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

- Extend the client-server protocol with server initialization hook
- Provide some shared types and utility functions for MCP

Part of eclipse-glsp/glsp#1546
Copy link
Copy Markdown
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

In general the changes look good to me.
I only have a fewer minor nitpicks.

mcpServer: McpServerConfiguration;
}

export function isMcpInitializeParameters(params?: InitializeParameters): params is McpInitializeParameters {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably align this with our typical pattern of interface+ namespace for utility functions
instead of standalone utility functions

}

export function isMcpInitializeParameters(params?: InitializeParameters): params is McpInitializeParameters {
return !!params && (params as McpInitializeParameters).mcpServer !== undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should use probably use our own type utilities (AnyObject.is & hasObjectProp) here

mcpServer: McpServerResult;
}

export function isMcpInitializeResult(result?: InitializeResult): result is McpInitializeResult {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above this should probably be migrated to a namespace

@Sakrafux Sakrafux mentioned this pull request Mar 25, 2026
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.

3 participants