---
title: Claude MCP for your database: connect Claude to SQL Server, Postgres or your ERP safely | Codivated
canonical: https://www.codivated.com/integrations/claude-mcp-database/
---

[Home](https://www.codivated.com/)/[Use cases](https://www.codivated.com/services/#teams)Integration · MCP · 8 min read

# Claude MCP for your database: ask SQL Server, Postgres or your ERP in plain English

By the Codivated team · Updated November 20, 2026

An MCP server lets Claude, ChatGPT and other assistants work with your database or ERP the way a person would through an app: it can look things up, answer questions and, if you allow it, make changes. It is the fastest way to let staff ask "which orders shipped late last week?" in plain English. Do it safely: a separate login with read-only access to the tables it needs, a short list of named tools instead of open SQL where you can, approval before any write, and a log of every query.

## What is MCP, and why does it matter for your data?

The Model Context Protocol (MCP) is an open standard for connecting AI assistants to the tools and data a business already runs. An MCP server sits in front of a system, here a database or an ERP, and offers the assistant a set of tools, such as "find customer", "list open orders" or "run this read-only query". Claude, ChatGPT, Copilot and most agent frameworks now speak it, so one server works with many assistants. Our team has built MCP servers for internal teams and for customers' own use, and the hard part is never the protocol. It is deciding what the assistant may see and do.

## How do you connect Claude to SQL Server, Postgres or MySQL?

There are three common ways, from quickest to safest:

| | Option | What it is | Good for | Watch out for

| Off-the-shelf database MCP server | An open-source or vendor server that lets the assistant list tables and run SQL | Analysts exploring data on a copy | Open SQL on a live database, and community servers vary in quality

| Vendor's own MCP server | For example Microsoft's SQL MCP Server (part of Data API builder), or an ERP's AI connector | SQL Server and Azure SQL, or an ERP that ships one | You still have to choose the role and the tables it exposes

| Custom MCP server with named tools | A small server you own that offers tools like "order status" or "AR aging by customer" | Staff self-service on live systems, and anything that writes | Takes a short build, and it's worth it

For a database that holds customer, financial or employee data, we start staff on named tools and keep open SQL for a few analysts working on a read replica.

## Can AI for ERP work with an older or on-prem system?

Usually, yes. Most on-prem ERPs sit on SQL Server or another standard database, and many have an API, even an old one. The MCP server runs next to the ERP, inside your network, and connects with its own service login. Nothing needs to move to the cloud except the questions and the rows the assistant is allowed to see. Read from reporting views or a replica rather than the live transaction tables. Send writes through the ERP's own API or import process, never straight into its tables, so its business rules still run.

## Is MCP secure? Read-only vs write access

MCP is as safe as the server and the login behind it. The protocol does not limit what a tool can do, so the limits have to live in the database and in the server. A public example shows why: the reference Postgres MCP server enforced "read-only" inside the server, and security researchers showed a SQL injection that got past it. It was archived in 2025. The fix is to make the database itself say no.

- Its own login. Give the server a database user of its own, never an admin or a person's account, with access to only the views and tables it needs.
- Read-only at the database. Grant SELECT and nothing else, so even a bad query can't change data.
- Limits. Row limits and query timeouts, so one question can't scan the whole warehouse.
- Sensitive columns out. Leave salary, bank details and personal data out of the views it can see.
- Writes are separate tools. "Update ship date" is its own tool, with checks in code, and a person approves it before it runs. See [human in the loop](https://www.codivated.com/insights/human-in-the-loop-ai-agents/).
- Every call logged. Who asked, which tool, which query, and what came back.
- Act as the user. When people ask through Claude, scope the answers to what that person could already see in the app. Our team builds agents that act on behalf of the signed-in user, with the same permissions as their own API calls.

More on the risks in [AI agent security](https://www.codivated.com/insights/ai-agent-security/).

## Text to SQL vs an MCP server: what's the difference?

Text to SQL means the model writes a SQL query from a plain-English question. An MCP server is how the assistant reaches the database at all, and it can offer text to SQL as one tool or skip it. Open text to SQL is great for an analyst who can read the query. For everyone else, named tools are more accurate and safer, because the query behind "late orders this week" is written and tested once, not guessed again each time.

## What should the MCP server expose first?

Start with the five to ten questions people ask the finance, ops or sales team every week, and make each one a tool. Typical first tools:

- Order status and shipment tracking by order, PO or customer
- Open invoices and AR aging by customer
- Inventory on hand and on order by item and warehouse
- Customer and vendor lookup with recent activity
- Sales by rep, region or product for a date range

Test each tool against real past questions with known answers before people rely on it. Then add one write tool at a time, with approval.

## How do you start?

Pick one team and one database. Set up the read-only login and the views, build the first handful of tools, and connect it to the assistant your company already uses, such as [Claude Enterprise or Team](https://www.codivated.com/insights/rolling-out-claude-at-your-company/). Watch the logs for two weeks: what people ask that it can't answer tells you the next tools to build.

First Agent SprintFind and build your first agent in two weeks.A ranked plan, an ROI model and a first working agent in practice mode, for a fixed $15,000.

[See what the sprint includes](https://www.codivated.com/ai-readiness-assessment/)

## Common questions

### What is a database MCP server?

A small service that sits between an AI assistant and your database and offers it tools to look up data, run approved queries or, if you allow it, make changes. Postgres, MySQL and SQL Server all have community and vendor options.

### Is there an official SQL Server MCP server?

Microsoft offers SQL MCP Server as part of its open-source Data API builder, which exposes chosen tables and operations under role-based access. Check Microsoft's current documentation for what it supports.

### Should Claude have write access to our database?

Not directly. Keep the database login read-only and add specific write tools that go through your application or ERP's API, with checks in code and a person's approval.

### Does our data leave the building?

The server runs inside your network. The question and the rows the assistant is allowed to read go to the model provider, so use a business plan with no training on your data, and keep sensitive columns out of the views.

### Do we need Claude Enterprise to use MCP?

No. Claude's business plans and its desktop app can connect to MCP servers. Enterprise adds admin controls that help when many people share one connector.

### How is this different from an AI knowledge base?

A [knowledge base assistant](https://www.codivated.com/use-cases/internal-knowledge-base/) answers from documents. A database MCP server answers from live records, like orders and invoices. Many companies want both.

## Sources

- [Model Context Protocol](https://modelcontextprotocol.io/): the open standard.
- [SQL MCP Server overview](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/overview), Microsoft Learn.
- [SQL injection in the PostgreSQL MCP server](https://securitylabs.datadoghq.com/articles/mcp-vulnerability-case-study-SQL-injection-in-the-postgresql-mcp-server/), Datadog Security Labs, 2025.

Written byThe Codivated teamWe build and run AI agents for established companies.[Book a consultation](https://www.codivated.com/contact/)

## Find your first agent in two weeks.

[Ask about the First Agent Sprint](https://www.codivated.com/contact/)
