+Discovered at runtime from the CourseCode framework's MCP server via stdio JSON-RPC (`coursecode mcp --port <port>`). The MCP connection is managed by `mcp-client.js`. The desktop app assumes the MCP server is **always available** when a preview is running; MCP tools are only included in the tool list when a preview server is active. Desktop depends directly on `@modelcontextprotocol/sdk` so the client can negotiate with the SDK's current `LATEST_PROTOCOL_VERSION` while still sending the Electron app version as client metadata. Framework MCP tools return `structuredContent` for machine-readable results while keeping text content for compatibility. When MCP tools fail, Desktop preserves structured fields such as `code`, `hint`, and `details` so the AI can recover from tool errors without parsing prose.
0 commit comments