Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve ambient Cursor MCP servers #15875

Mergedaravhawk(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/15875/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 15 additions and 1 deletion.

x
0 of 2 viewed, 2 left
14 additions and 0 deletionspackages/provider-cursor/src/server/adapter.test.tsModified
View file
@@ -55,6 +55,17 @@
});
const instanceId = ProviderInstanceId.make("cursor");
const threadId = ThreadId.make("cursor-lifecycle-thread");
+ const mcpSessions = yield* McpProviderSessions.McpProviderSessions;
+ yield* mcpSessions.set({
+ environmentId: EnvironmentId.make("cursor-lifecycle-environment"),
+ threadId,
+ providerSessionId: "cursor-lifecycle-session",
+ providerInstanceId: instanceId,
+ endpoint: "http://127.0.0.1:43123/mcp",
+ authorizationHeader: "Bearer synthetic-cursor-token",
+ browserToolsAvailable: true,
+ });
+ let sentWithMcpOverride = true;
const modelSelection = { instanceId, model: "composer-2.5" };
const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
runtimeMode: "full-access",
@@ -75,6 +86,7 @@
close: Effect.void,
send: (input) =>
Effect.gen(function* () {
+ sentWithMcpOverride = Object.hasOwn(input.options ?? {}, "mcpServers");
// Recorded Cursor task calls (see fixtures/subagent) stream a
// partial-tool-call before tool-call-started with the same args.
// The run then ends without tool-call-completed, which a live
@@ -184,6 +196,8 @@
Stream.takeUntil((event) => event.type === "turn.terminal"),