[DO NOT MERGE] Experiment: model-free `tool` CLI and MCP server on one adapter

Draft
HK
5h ago
+8494-238

Do not merge — just experiments. This branch exists only to evaluate how Claude Code (and other agents) should call altimate-code data tools directly, over MCP or from the shell.

What this experiment contains

  • Brings in altimate-code mcp serve from #1543 and the workspace tools from #1576.
  • One adapter, two front doors: mcp serve and a new model-free tool CLI (tool list | schema | run | context | daemon) execute tools through the same adapter, so both share compact schemas, sql_execute with tables and query_from, result spill files, answer_commit, and read-only enforcement.
  • mcp serve default set: the five #1543 tools plus impact_analysis, dbt_lineage, altimate_core_column_lineage, schema_detect_pii, data_diff, altimate_core_equivalence, sql_translate; --all-tools exposes the full 70-tool allow-list.
  • tool context prints the analyst method and connection/table listing that mcp serve sends at startup, for shell agents.
  • Long-running per-project process (auto-start, idle exit, version- and connections-scoped socket) keeps connections warm and releases DuckDB/SQLite file locks between calls.
  • --connections / ALTIMATE_TOOL_CONNECTIONS, --args - from stdin, --workspace-tools.
  • DROP DATABASE, DROP SCHEMA and TRUNCATE stay blocked even with --allow-write.
  • link --claude-md (opt-in) writes CLI routing guidance to CLAUDE.md for clients that cannot use MCP.
  • The CI change from #1543 is intentionally not included.

Validation

  • bun run typecheck clean; test/altimate/tool-cli + test/cli/help 50/50; ALTIMATE_MCP_E2E=1 test/altimate/mcp-server 101/101; other #1543/#1576 test files 761/761.
  • End to end: tool context, tool run via the daemon and in-process, and mcp serve over stdio (initialize, tools/list, tools/call) against DuckDB.
  • Companion plugin experiment: AltimateAI/altimate-claude-plugin#11. Benchmark results are shared internally.

šŸ¤– Generated with Claude Code


Summary by cubic

Experimental branch, not for merge: evaluates how external coding agents call altimate-code data tools directly, via a new model-free tool CLI or mcp serve over stdio.

  • tool list | schema | run | context | daemon and mcp serve execute the same adapter, so both share compact schemas, sql_execute options, result spill files, answer_commit, and read-only enforcement.
  • A per-project daemon keeps connections and the schema cache warm between calls and releases DuckDB/SQLite file locks.
  • mcp serve defaults to the original five tools plus impact, lineage, PII, data-diff, equivalence and translation tools; --all-tools opens the full 70-tool allow-list.
  • MCP requests are forced read-only; DROP DATABASE, DROP SCHEMA and TRUNCATE stay blocked even with --allow-write.
  • link --claude-md writes CLI routing guidance into CLAUDE.md for clients that cannot use MCP.

Behavior changes

  • schema_inspect lists schemas and up to 500 tables with catalog row estimates when table is omitted; MongoDB catalog discovery is bounded and closes cursors early.
  • answer_commit accepts asked and readings arguments, and its rejection checks moved into a dedicated module with per-turn limits.
  • The analyst now requests high reasoning effort on adaptive-thinking models unless the user or agent config sets one.

Validation: typecheck clean; test/altimate/tool-cli + test/cli/help 50/50; ALTIMATE_MCP_E2E=1 test/altimate/mcp-server 101/101; other affected test files 761/761.