Skip to main content

AI · MCP · Security

How to connect Claude or ChatGPT to your data safely (MCP explained)

By DataViz team 4 min read

In short

The Model Context Protocol (MCP) is an open standard that lets an AI app call tools another service offers. To connect an assistant to your data safely, it should act as one named person with that person's permissions, get only the tools it needs, and wait for a human to approve anything risky.

What MCP is#

The Model Context Protocol (MCP) is an open standard for connecting AI applications to other services. A service runs an MCP server that offers tools (actions such as "list datasets" or "run this query"), prompts (ready-made starting points) and resources (reference material). An AI app such as Claude, ChatGPT or Gemini is the MCP client: once you add a server, the assistant can find and call its tools while you chat.

For data, that means you can ask "Which region had the highest revenue last quarter, and what was its margin?" and the assistant looks the answer up in your own data instead of guessing.

Why not just give the AI a database password?#

It works, and it is the riskiest way to do it:

With a shared database loginWhat you lose
The AI sees every table the login can readRow and column rules your BI tool enforces don't apply.
Every person's assistant uses the same loginYou can't tell who asked what, or cut off one person.
The login can often writeA wrong guess can change or delete data.
Queries go straight to productionNothing limits how heavy or how frequent they are.

The safer pattern is to connect the assistant to a governed layer, your BI tool, rather than to the database itself.

Five rules for safe AI access to data#

  1. One person, one connection. Every connection belongs to a named person and acts with exactly their permissions.
  2. Least privilege. A connection gets only the tools its job needs: answering questions needs read tools, not delete.
  3. Data rules still apply. Row-level and column-level rules filter what the AI sees, the same as on a dashboard.
  4. Risky actions wait for a human. Sharing, deleting and sending to other people need an approval.
  5. Everything is visible and revocable. Admins can see every connection and cut any of them off at once.

How it works in DataViz#

DataViz has a built-in MCP server. Nothing extra is installed.

  • Admins switch it on and set the ceiling. AI connectors start off. An admin turns them on under Settings → AI Connectors (MCP) and decides, for the whole workspace, which toolsets and access levels any connection may have. Raw SQL for AI clients is either off or policy-gated: allowed except on connections where a row-level rule covers the member. AI clients can never be given unrestricted raw SQL.
  • Each person connects as themselves. Claude, ChatGPT and Gemini sign in to DataViz and the person approves them. Command-line tools such as Claude Code and the Gemini CLI use a personal API key, which starts with dvz_pat_, expires after 7 to 90 days and is shown only once.
  • Three layers of limits. A connection can do only what the workspace policy, the person's role and the connection's own settings all allow, and every call still runs with that person's row and column rules. An AI client never sees a row its owner can't.
  • Changes are drafts or need approval. With write access, an assistant creates charts and dashboards as private drafts. Risky changes always need approval, and a workspace can make every change wait.
  • Admins see every connection. Members who manage AI connectors see all keys and connected apps and can revoke any of them, for example when someone leaves.

Connect Claude in a few minutes#

  1. An admin turns on AI connectors for the workspace.
  2. Copy the MCP server URL from Settings → AI Connectors (MCP).
  3. In Claude, open Settings → Connectors → Add custom connector and paste the URL.
  4. Choose Connect, sign in to DataViz, and pick the workspace and toolsets Claude may use.
  5. Ask a question about your data.

For Claude Code, create a personal API key and run:

claude mcp add --transport http dataviz YOUR_MCP_URL --header "Authorization: Bearer dvz_pat_YOUR_KEY"

Step-by-step instructions for every client are in Connect AI clients, and the policy options in Turn on and set the policy.

Good first questions#

  • "Which region had the highest revenue last quarter, and what was its margin?"
  • "Recommend charts for the Orders dataset that show where profit comes from."
  • "Build a draft dashboard of weekly orders by channel, with a date filter."
  • "Email me the Sales overview dashboard every Monday at 9."

Questions and answers

What is MCP?

MCP, the Model Context Protocol, is an open standard that lets AI applications such as Claude, ChatGPT and Gemini use tools offered by another service. The service runs an MCP server; the AI app connects to it as a client and calls its tools while you chat.

Is it safe to let ChatGPT or Claude query my database?

It is safe when the assistant connects to a governed layer rather than the database itself: each connection acts as one person with their permissions and row-level rules, has only the tools it needs, and risky actions wait for approval. A shared database password gives none of that.

Can an AI assistant see data I'm not allowed to see?

Not through DataViz. Every MCP call runs with the connected person's own permissions and row and column rules, so an AI client never sees a row its owner can't.

Can the AI change or delete things?

Only if the connection has write access. In DataViz an assistant with write access creates charts and dashboards as private drafts, risky changes such as sharing or deleting always need approval, and a workspace can make every change wait for approval.

How do I cut off an AI connection?

In DataViz, disconnect it from Settings, AI Connectors (MCP). Members who manage AI connectors can see every member's keys and connected apps and revoke any of them at once; turning AI connectors off stops them all.