Skip to content

Add support for Model Context Protocol#271

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

Add support for Model Context Protocol#271
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

Registers GLSP-announced MCP servers with the IDE's MCP frontend
service so the agent can use them immediately after IDE startup.

MCP integration

  • Discovers MCP server descriptors on each GLSP client contribution
    and adds them to the IDE's MCP host on startup.
  • Triggers an explicit start since the host's autostart hook only
    fires at frontend init.
  • Per-registration cleanup releases server entries and state-change
    subscriptions on GLSP failure or extension dispose, avoiding
    stale entries across IDE restarts under random-port defaults.

Adopters

  • Set the configuration on the GLSP client contribution to enable
    MCP for a diagram language.
  • The workflow example demonstrates the end-to-end wiring with a
    transient connect notification and a copy-URL action.

Misc

  • Sends a shutdown notification before the GLSP connection drops
    so the server tears down cleanly with the parent session.

Part of eclipse-glsp/glsp#1546
Requires eclipse-glsp/glsp-client#456 and eclipse-glsp/glsp-server-node#120

How to test

  • Nothing should break in the default case
  • To use the new mcp server, you need to use a GLSP server that supports it, i.e., the GLSP Node Server
  • Startup the Workflow example
  • Check the AI Configuration > MCP Server view that should show the GLSP MCP server correctly and allow you to connect to it and show all tools. Please note that there is no support for MCP resources in Theia yet.

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 support for the Model Context Protocol (MCP) by integrating GLSP MCP servers with Theia AI. The changes enable GLSP diagram editors to expose their functionality through MCP servers that can be discovered and utilized by Theia's AI features.

Key changes:

  • New theia-mcp-integration package that automatically registers GLSP MCP servers with Theia's AI MCP service
  • Fixed shutdown notification handling to properly notify servers before connection disposal
  • Updated workflow example to demonstrate MCP server initialization

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/theia-mcp-integration/package.json Defines new package for MCP integration with dependencies on Theia AI and GLSP integration
packages/theia-mcp-integration/tsconfig.json TypeScript configuration for the new MCP integration package
packages/theia-mcp-integration/src/browser/theia-mcp-integration-frontend-module.ts Container module that registers the MCP registration service
packages/theia-mcp-integration/src/browser/glsp-mcp-registration.ts Service that discovers GLSP clients and registers their MCP servers with Theia
packages/theia-integration/src/browser/glsp-client-contribution.ts Fixed to send shutdown notification before disposing connection
examples/workflow-theia/src/browser/workflow-glsp-client-contribution.ts Updated to include MCP server initialization parameters
examples/workflow-theia/package.json Added dependency on new theia-mcp-integration package
examples/workflow-theia/tsconfig.json Added TypeScript project reference to theia-mcp-integration
examples/browser-app/package.json Added Theia AI dependencies to demonstrate MCP integration
package.json Updated workspace pattern to include all packages
configs/local-linking.sh Added server-mcp package to local linking script
.vscode/launch.json Added debug configuration for server-mcp package

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

Comment thread packages/theia-integration/src/browser/glsp-client-contribution.ts
Registers GLSP-announced MCP servers with the IDE's MCP frontend
service so the agent can use them immediately after IDE startup.

MCP integration
- Discovers MCP server descriptors on each GLSP client contribution
  and adds them to the IDE's MCP host on startup.
- Triggers an explicit start since the host's autostart hook only
  fires at frontend init.
- Per-registration cleanup releases server entries and state-change
  subscriptions on GLSP failure or extension dispose, avoiding
  stale entries across IDE restarts under random-port defaults.

Adopters
- Set the configuration on the GLSP client contribution to enable
  MCP for a diagram language.
- The workflow example demonstrates the end-to-end wiring with a
  transient connect notification and a copy-URL action.

Misc
- Sends a shutdown notification before the GLSP connection drops
  so the server tears down cleanly with the parent session.

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