mcpServerConnection.ts ×5

Frontier kind: Code frontier

unlabeled · c_42b81274deb7

20 tests · 33231 LOC · 160 files · introduces 0 tests · 41 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges41 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3407 ranges33231 lines · 160 files · Browse complete extent
All tests (intent)
20 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 41 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/mcp/common/mcpServerConnection.ts 32 introduced LOC · 5 ranges

Open complete file

66
67 private adoptLaunch(launch: IMcpMessageTransport, methods: IMcpClientMethods): IReference<IMcpMessageTransport> {
68 > const store = new DisposableStore(); mcpServerConnection.ts
69 > const cts = new CancellationTokenSource();
70 >
71 > store.add(toDisposable(() => cts.dispose(true)));
72 > store.add(launch);
73 > store.add(launch.onDidLog(({ level, message }) => {
74 log(this._logger, level, message);
75 const potentialBlock = this._toPotentialSandboxBlock(message);
77 this._onPotentialSandboxBlock.fire(potentialBlock);
78 }
80 >
81 > let didStart = false;
82 > store.add(autorun(reader => {
83 > const state = launch.state.read(reader);
84 > this._state.set(state, undefined);
85 > this._logger.info(localize('mcpServer.state', 'Connection state: {0}', McpConnectionState.toString(state)));
86 >
87 > if (state.state === McpConnectionState.Kind.Running && !didStart) {
88 didStart = true;
89 McpServerRequestHandler.create(this._instantiationService, {
116 );
117 }
119 >
120 > return { dispose: () => store.dispose(), object: launch };
121 > }
122
123 public async stop(): Promise<void> {
134
135 private _waitForState(...kinds: McpConnectionState.Kind[]): Promise<McpConnectionState> {
136 > const current = this._state.get(); mcpServerConnection.ts
137 > if (kinds.includes(current.state)) {
138 return Promise.resolve(current);
139 }
141 > return new Promise(resolve => {
142 > const disposable = autorun(reader => {
143 > const state = this._state.read(reader);
144 > if (kinds.includes(state.state)) {
145 > disposable.dispose();
146 > resolve(state);
147 > }
148 > });
149 > });
150 > }
151
152 private _toPotentialSandboxBlock(message: string): IMcpPotentialSandboxBlock | undefined {
src/vs/workbench/contrib/mcp/common/mcpTypes.ts 9 introduced LOC · 5 ranges

Open complete file

728
729 export const toString = (s: McpConnectionState): string => {
730 > switch (s.state) { mcpTypes.ts
731 > case Kind.Stopped:
732 return localize('mcpstate.stopped', 'Stopped');
733 > case Kind.Starting: mcpTypes.ts
734 > return localize('mcpstate.starting', 'Starting');
735 > case Kind.Running:
736 return localize('mcpstate.running', 'Running');
737 > case Kind.Error: mcpTypes.ts
738 return localize('mcpstate.error', 'Error {0}', s.message);
739 > default: mcpTypes.ts
740 assertNever(s);
741 > } mcpTypes.ts
742 > };
743
744 export const toKindString = (s: McpConnectionState.Kind): string => {