start_contam_bridge_session
Launch ContamX in bridge mode to maintain an interactive socket session for airflow and contaminant transport modeling across multiple MCP calls.
Instructions
Use this when you want to launch ContamX in bridge mode and keep an interactive socket session open across multiple MCP calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | ||
| workingDirectory | No | ||
| windFromBridge | No | ||
| volumeFlowBridge | No | ||
| timeoutSeconds | No |
Implementation Reference
- contam-mcp/src/server.js:2302-2343 (handler)Implementation of the 'start_contam_bridge_session' tool, which launches a ContamX bridge session and returns a session ID.
"start_contam_bridge_session", "Use this when you want to launch ContamX in bridge mode and keep an interactive socket session open across multiple MCP calls.", { projectPath: z.string(), workingDirectory: z.string().optional(), windFromBridge: z.boolean().optional(), volumeFlowBridge: z.boolean().optional(), timeoutSeconds: z.number().int().min(1).max(300).optional() }, async ({ projectPath, workingDirectory, windFromBridge, volumeFlowBridge, timeoutSeconds }) => { const executablePath = await resolveExecutable("contamx"); const resolvedProjectPath = asAbsolutePath(projectPath); if (!(await fileExists(resolvedProjectPath))) { throw new Error(`Project file not found: ${resolvedProjectPath}`); } const session = new ContamBridgeSession({ executablePath, projectPath: resolvedProjectPath, workingDirectory: asAbsolutePath(workingDirectory ?? path.dirname(resolvedProjectPath)), windFromBridge: windFromBridge ?? false, volumeFlowBridge: volumeFlowBridge ?? false, host: BRIDGE_HOST, port: 0 }); try { const handshake = await session.start(timeoutSeconds ?? 30); bridgeSessions.set(session.id, session); return toolResponse("Started a ContamX bridge session.", { sessionId: session.id, readyTimeSeconds: session.readyTimeSeconds, initialMessageTypes: handshake.messages.map((message) => message.type), summary: session.getSummary() }); } catch (error) { await session.close().catch(() => {}); throw error; } } );