fix: route datamate tools through local stdio mcp-engine instead of cloud#893
fix: route datamate tools through local stdio mcp-engine instead of cloud#893altimate-harness-bot[bot] wants to merge 1 commit into
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
E2E Verification — PASSED ✓Full pipeline tested end-to-end in the sandbox: Test setup:
Results: What was verified:
|
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
15 similar comments
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
- Add stdio transport support for datamate MCP (vs HTTP-only before) - Single-gateway mode: when .vscode/mcp.json has "datamate" key, always use it as server name — prevents duplicate tool sets from extension - syncDatamateUrlFromVscodeMcp: use updatedAt field as change signal for the "datamate" entry (works for both stdio and HTTP), URL comparison for all other remote entries - Strip ALTIMATE_EXTENSION_RPC from persisted mcp-discover configs to avoid stale socket paths across VS Code sessions - persistMcpEnabled: write enabled/disabled flag to disk on MCP connect/disconnect so it survives session restarts - Add /altimate/mcp/reload-datamate endpoint to re-sync and reconnect without full server restart - MCP.ToolsChanged subscription in prompt loop for traceability - Merge main: preserve trace consumer in serve.ts, restore exports on isAnthropicLikeModel and insertReminders
a71092d to
0b6cc26
Compare
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
1 similar comment
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
Problem
DatamateManagerTool.handleAdd()was creating MCP server entries pointing to the cloud MCP server (https://mcpserver.getaltimate.com) becausebuildMcpConfig()always fell back toDEFAULT_MCP_URLwhenmcpServerUrlwas absent fromaltimate.json.The cloud MCP runs in multi-user mode and reads connections from API headers — it has no access to
~/.altimate/connections.json. So any tool call likedatamate-remote_jira_get_issuefailed with "No connection configured for integration: jira" even when connections were configured locally.Fix
datamate.ts—handleAdd()Replace
buildMcpConfig()(HTTP remote) with a local stdio config:Each spawned
datamate start-stdioprocess:connections.jsonfrom~/.altimate/directly (local engine, same as VS Code extension)~/.altimate/extension-rpc/workspaceFolders; the spawned process matches onprocess.cwd()(set to project root byStdioClientTransport) and routes to the right bridge automaticallymcp-discover.ts—stripSessionEnv()When persisting a discovered server via
mcp_discover, stripALTIMATE_EXTENSION_RPCfrom the environment block before writing to disk. The socket path is session-specific (unique to the current extension host process) — hardcoding it would cause future sessions to connect to a dead or wrong bridge. Stripping it forces runtime discovery.Prerequisites
Requires the global
datamateCLI to be on PATH:npm install -g @altimateai/datamate. The VS Code extension already warns users when stdio mode is configured but no globaldatamateis found.Related PRs
mcpServerUrltoaltimate.json(interim fix, superseded by this approach)Requested by @saravmajestic via harness
Summary by cubic
Route
datamatetools through the local MCP engine when the VS Code extension is present, auto-detecting stdio vs HTTP from.vscode/mcp.json, and use a singledatamategateway to avoid duplicate tool sets. Sync thedatamateentry byupdatedAt(works for stdio and HTTP), add a live reload endpoint, and refresh tools after reconnects.Bug Fixes
datamate.ts: detect transport from.vscode/mcp.json; use server namedatamatewhen the extension entry exists (stdio or HTTP), otherwise use per-datamate cloud config; default toenabled: true.~/.altimate/connections.jsonand auto-selects the right VS Code bridge via cwd-based sidecars; supports multiple windows.mcp-discover.ts: stripALTIMATE_EXTENSION_RPCfrom persisted env to avoid dead/wrong sockets.serve.ts+config.ts: on startup, sync thedatamateentry byupdatedAt(covers stdio + HTTP); other remote MCP entries sync via URL comparison; persistupdatedAtin config.server.ts: addPOST /altimate/mcp/reload-datamateto re-sync from.vscode/mcp.jsonand reconnect updated MCP clients without a server restart.session/prompt.ts: subscribe toMCP.ToolsChangedand refresh tools on the next turn with trace logs.mcp/index.ts: persistenabled/disabledstate to config on MCP connect/disconnect so it survives restarts.Migration
datamateCLI is on PATH:npm install -g @altimateai/datamate.Written for commit 0b6cc26. Summary will update on new commits.