
@theia/ai-mcp-server
<div align='center'>
<br />
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
<h2>ECLIPSE THEIA - AI MCP SERVER EXTENSION</h2>
<hr />
</div>
Description
This package provides Model Context Protocol (MCP) server functionality for Theia, enabling AI tools to access Theia services and workspace information.
Features
- HTTP Transport: RESTful HTTP API for MCP communication using the StreamableHTTPServerTransport
- Backend MCP Contributions: Register backend-only tools, resources, and prompts
- Frontend MCP Contributions: Register frontend-only tools, resources, and prompts that can access frontend services
- Frontend-Backend Delegation: Allows frontend contributions to be exposed through the backend MCP server
Development Setup
Starting the MCP Server
- Start Theia application
- The MCP server will automatically start and be available at
/mcpe.g.http://localhost:3000/mcp
API Endpoints
POST /mcp- MCP protocol endpoint (for all MCP protocol operations)
Architecture
The MCP server architecture consists of:
- HTTP Transport Layer: Manages HTTP connections using StreamableHTTPServerTransport
- MCP Server: Core server implementation that handles MCP protocol messages
- Backend Contributions: Extensions that run on the Node.js backend
- Frontend Contributions: Extensions that run in the browser frontend
- Frontend-Backend Bridge: RPC mechanism to connect frontend and backend
Creating Backend Contributions
Backend contributions run in the Node.js backend and have access to backend services:
@injectable()
export class MyBackendContribution implements MCPBackendContribution {
@inject(ILogger)
protected readonly logger: ILogger;
async configure(server: McpServer): Promise<void> {
// Register a tool
server.tool('my-backend-tool', {
type: 'object',
properties: {
input: { type: 'string' }
}
}, async (args) => {
this.logger.info('my-backend-tool called with args:', args);
return {
content: [{ type: 'text', text: 'Result from backend' }]
};
});
// Register a resource
server.resource(
'my-resource',
'theia://resource-uri',
async (uri) => {
return {
content: 'Resource content'
};
}
);
// Register a prompt
server.prompt(
'my-prompt',
'Prompt description',
{}, // Arguments schema
async (args) => {
return {
messages: [{
role: 'user',
content: { type: 'text', text: 'Prompt content' }
}]
};
}
);
}
}
Register the contribution in your backend module:
bind(MyBackendContribution).toSelf().inSingletonScope();
bind(MCPBackendContribution).toService(MyBackendContribution);
Creating Frontend Contributions
Frontend contributions run in the browser and have access to frontend services:
@injectable()
export class MyFrontendContribution implements MCPFrontendContribution {
@inject(WorkspaceService)
protected readonly workspaceService: WorkspaceService;
async getTools(): Promise<Tool[]> {
return [{
name: 'workspace-info',
description: 'Get workspace info',
inputSchema: {
type: 'object',
properties: {}
}
}];
}
async getTool(name: string): Promise<ToolProvider | undefined> {
if (name === 'workspace-info') {
return {
handler: async () => {
const roots
Related servers

n8n
by n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
NOASSERTION★ 198,904

@modelcontextprotocol/server-everything
OfficialMCP server that exercises all the features of the MCP protocol
★ 89,105

@modelcontextprotocol/server-filesystem
OfficialMCP server for filesystem access
SEE LICENSE IN LICENSE★ 89,105