Skip to content

Conversation

@martin-fleck-at
Copy link
Contributor

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

What it does

  • Add new package to start a MCP server as part of the GLSP server
    • Start MCP HTTP server for client connections on GLSP server start
    • Provide some default tools and resources
    • Expose functionality as custom module
  • Extend examples to use GLSP MCP Server

Part of eclipse-glsp/glsp#1546
Requires eclipse-glsp/glsp-client#456

How to test

  • Start the node server
  • Connect with a client that sets the mcpServer configuration
  • Read the actual url of the server out of the log, e.g., [McpServerManager] MCP server 'glspMcpServer' is ready to accept new client requests on: http://127.0.0.1:5555/glsp-mcp
  • Connect to the server using the Theia Integration (caution: no support for MCP Resources) or Claude Code or the MCP Inspector.
  • Test querying resources and tools

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

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 Model Context Protocol (MCP) support to the GLSP server, enabling AI assistants and other MCP clients to interact with GLSP diagrams through a standardized protocol. The implementation provides HTTP-based MCP server functionality with default tools for diagram manipulation and resources for querying diagram state.

Key changes:

  • Introduces new @eclipse-glsp/server-mcp package with MCP server infrastructure, HTTP transport layer, and default tools/resources for diagram interaction
  • Extends GLSP server initialization to support contributions via GLSPServerInitContribution interface
  • Updates workflow example to demonstrate MCP integration

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/server/src/common/session/client-session-manager.ts Adds getSessions() method to retrieve all active client sessions
packages/server/src/common/protocol/glsp-server.ts Introduces GLSPServerInitContribution mechanism and deprecates handleInitializeArgs
packages/server/src/common/di/server-module.ts Adds binding configuration for GLSPServerInitContribution
packages/server-mcp/tsconfig.json TypeScript configuration for new MCP package
packages/server-mcp/src/mcp-util.ts Utility functions for MCP parameter extraction and result formatting
packages/server-mcp/src/mcp-server-manager.ts Core MCP server lifecycle management and HTTP server initialization
packages/server-mcp/src/mcp-server-contribution.ts Interface for extending MCP server with custom tools and resources
packages/server-mcp/src/index.ts Package exports
packages/server-mcp/src/http-server-with-sessions.ts HTTP server implementation with MCP session management
packages/server-mcp/src/di.config.ts Dependency injection configuration for MCP module
packages/server-mcp/src/default-mcp-tool-contribution.ts Default MCP tools for diagram validation, element creation, undo/redo, and save operations
packages/server-mcp/src/default-mcp-resource-contribution.ts Default MCP resources for querying sessions, diagram types, element types, and models
packages/server-mcp/package.json Package metadata and dependencies for MCP package
packages/server-mcp/.eslintrc.js ESLint configuration ignoring MCP SDK imports
examples/workflow-server/tsconfig.json Adds reference to server-mcp package
examples/workflow-server/src/node/app.ts Integrates MCP module into workflow server
examples/workflow-server/src/common/workflow-glsp-server.ts Migrates from deprecated handleInitializeArgs to GLSPServerInitContribution
examples/workflow-server/src/common/workflow-diagram-module.ts Updates binding to use new init contribution pattern
examples/workflow-server/package.json Adds dependency on server-mcp package

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

- Add new package to start a MCP server as part of the GLSP server
-- Start MCP HTTP server for client connections on GLSP server start
-- Provide some default tools and resources
-- Expose functionality as custom module
- Extend examples to use GLSP MCP Server

Part of eclipse-glsp/glsp#1546
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