Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/mcp/src/stdio.ts
5241 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
import { getServer } from './automation';
7
import { ApplicationService } from './application';
8
import { opts } from './options';
9
10
const transport: StdioServerTransport = new StdioServerTransport();
11
(async () => {
12
const appService = new ApplicationService();
13
const server = await getServer(appService);
14
15
if (opts.autostart) {
16
await appService.getOrCreateApplication();
17
}
18
19
await server.connect(transport);
20
})().catch(err => {
21
transport.close();
22
console.error('Error occurred while connecting to server:', err);
23
process.exit(1);
24
});
25
26