Add support for Model Context Protocol#271
Open
martin-fleck-at wants to merge 1 commit intomasterfrom
Open
Conversation
There was a problem hiding this comment.
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-integrationpackage 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.
95ebe92 to
974b6d4
Compare
This was referenced Dec 19, 2025
974b6d4 to
9e1afb7
Compare
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
9e1afb7 to
f944f7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
and adds them to the IDE's MCP host on startup.
fires at frontend init.
subscriptions on GLSP failure or extension dispose, avoiding
stale entries across IDE restarts under random-port defaults.
Adopters
MCP for a diagram language.
transient connect notification and a copy-URL action.
Misc
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
Follow-ups
Changelog