Lantide Data
Back to blog

Claude Code and Codex for Reusable Analysis

Use Lantide as a local MCP workspace for Claude Code and Codex, keeping plans, SQL, evidence, and reports reusable across data analysis sessions.

Claude Code and OpenAI Codex can already run long tasks in a terminal, call MCP tools, and draft SQL. The usual bottleneck is not whether the Agent is smart enough; it is whether a weekly review, a question about metric definitions, or a rerun three weeks later can find a reviewable Plan, SQL query, and Report. Make Lantide the local MCP host: the external Agent keeps responsibility for reasoning and orchestration, while execution authority, workspace boundaries, and deliverables remain in a GUI you can inspect.

If Codex or Claude Code cannot reproduce last week's analysis in a new session, connect it to Lantide through MCP and keep the approved Plan, SQL tabs, validation evidence, Report, and activity in the Lantide workspace. The next session can inspect those artifacts instead of relying on a pasted summary or asking the Agent to invent the workflow again.

How the responsibilities split

What you use it for Claude Code / Codex Lantide
Breaking down long tasks, drafting code and SQL Strong Not its primary role
Calling tools through MCP Strong The local host being connected to
Local DuckDB queries and paginated cache Needs another execution environment Built in
Plan → Approve & Execute → Report Hard to preserve as a complete contract in conversation Built in
Reviewing activity and audit records Depends on the client Built in

In one sentence: the external Agent is the brain and orchestrator; Lantide is the data execution and review surface. See External Agent Integration and USER_GUIDE §13 for connection steps.

What can go wrong when formal analysis stays in the terminal

1. The middle of the process disappears

An analysis deliverable is a handoff-ready set of artifacts, not a single text answer. Temporary tables, filters, and provisional numbers in a CLI often scroll away. When someone asks whether the 23% excluded refunds, you need reopenable SQL, Plan definitions, and Report limitations. See Reproducible AI analysis.

2. Too much schema is loaded at once

Pasting the full DDL for hundreds of tables consumes context and repeats unnecessary structure every turn. A more practical approach is to start with table names and summaries, then read schemas as needed. As an MCP server, Lantide lets an external Agent explore tools and resources on demand.

3. Host permissions are not the workspace capability limit

Codex has sandbox modes and approval policies; Claude Code can connect to an MCP server over HTTP or streamable HTTP with headers. Those controls govern behavior on the Agent host. Analysis needs another layer: what this connection is allowed to do inside the data workspace. MCP standardizes connection methods; it does not configure least privilege for you. See MCP security: five layers.

What Lantide adds

Access Mode and workspace scope

Open Agent Integration in Lantide, enable Enable MCP server, and create a Quick or Persistent connection. Access Mode sets the capability ceiling for that connection:

Mode What it can do Suitable for
Observe Read workspace context and artifacts First evaluation and guided review
Execute Create analysis artifacts; formal execution remains constrained by Plan review and evidence Formal analysis in one workspace
Admin Execute plus trusted workspace, project, and knowledge organization A trusted Agent helping maintain the environment

Access Mode does not escalate automatically when a Plan enters Executing. Approve & Execute approves only that Plan's execution scope. See USER_GUIDE §13.5.

Plan approval and reviewable evidence

With Execute enabled, an external Agent can draft the Plan and SQL. You review them in Lantide and press Approve & Execute. Afterwards you can inspect SQL tabs, Steps, the Report, External MCP Activity, and the audit record.

Complex SQL gets a prompt to break it down

For overly complex queries, Lantide suggests splitting and optimizing them so multi-table joins can become reviewable tabs and a Source Run chain. This is query governance for readability and rerunnability; permission boundaries still depend on Access Mode, tool policy, Plan approval, and local loopback credentials.

Connecting Claude Code and Codex

Use the connection kit copied from Lantide's Agent Integration screen. Do not hand-write the port, path, or token. The MCP host binds to local 127.0.0.1; only paste credentials into trusted local clients.

Claude Code (HTTP / streamable HTTP):

claude mcp add --transport http lantide-data <URL copied from Lantide> \
  --header "Authorization: Bearer <token copied from Lantide>"

You can also place the JSON copied from the GUI in project or user settings. The official documentation uses type: "http" and accepts streamable-http as an alias. See the Claude Code MCP documentation.

Codex (config.toml or CLI):

[mcp_servers.lantide-data]
url = "<URL copied from Lantide>"
# Fill in bearer / headers from the connection kit; never commit the token to git.

You can also use codex mcp add to add a streamable HTTP server. Tighten sandbox and approval settings for the task; see Codex MCP and Codex best practices.

Dimension CLI Agent only With Lantide as an MCP host
Permission boundary Mainly client sandbox and approval Observe / Execute / Admin plus workspace scope
Schema loading Easy to inject too much DDL Explore tables and schemas on demand
Intermediate work Mostly terminal logs SQL tabs, Steps, and Activity artifacts
Formal delivery Copy and paste text Plan / Report with rerunnable evidence

Conclusion

An Agent running SQL in a terminal does not make the analysis reviewable. Claude Code and Codex are capable orchestrators; when you need definition review, local data boundaries, and rerunnable evidence, connect Lantide as the MCP host so their output enters a controlled workflow.

Next steps

References