---
title: "Connect SQL Server to MCP | Custom Tools for Claude & ChatGPT | Agent UI"
description: "Connect SQL Server to MCP without hosting a server or opening a port. Cloud or on-premise database, custom tools your team uses in Claude, ChatGPT and Cursor."
url: https://www.agentui.ai/en/connect-sql-server-mcp/
lang: en
source: en/connect-sql-server-mcp/index.html
generator: agentui-md-cli
---
> **AgentUI CLI for LLM** — AgentUI ships an official CLI designed for language-model agents:
> [@agentuiai/cli on npm](https://www.npmjs.com/package/@agentuiai/cli) · install with `npm install -g @agentuiai/cli`.
>
> This file is the LLM-optimised markdown build of
> [https://www.agentui.ai/en/connect-sql-server-mcp/](https://www.agentui.ai/en/connect-sql-server-mcp/) — a machine-readable alternate of
> the HTML at the same URL. Content mirrors the human-visible page.
>
> Site index for LLMs: [https://www.agentui.ai/llms.txt](https://www.agentui.ai/llms.txt) · full content: [https://www.agentui.ai/llms-full.txt](https://www.agentui.ai/llms-full.txt)

# Connect SQL Server to MCP for Claude, ChatGPT and Cursor

Connect SQL Server to MCP with AgentUI, whether the database runs in the cloud or on a server in your office. You describe the tools you want, like "overdue invoices for a customer", and the AI writes them. Each person then adds one link to the assistant they already use and signs in with their own account.

[Build my first tool](https://app.agentui.ai/chat?utm=direct&utm_medium=direct)[Set it up with a person](https://calendar.app.google/pcCwDiMJ8eSQ9zvo7)

Nothing to host, no port to open. Revoke any connection from the panel.

AI assistant · MCPSigned in as MariaWhat does Northwind Foods owe us past 30 days?Called tool · finance-appread-onlytool_overdue_invoices(customer: "Northwind Foods")→ ERP-SQL01 (on-prem) · 3 rows · 1.1sInvoiceDays lateAmountINV-2093147$8,420.00INV-2087738$2,115.50INV-2080433$640.00

Northwind Foods has 3 invoices past 30 days, totalling $11,175.50. The oldest is 47 days late.

## How to connect SQL Server to MCP in three steps

### Connect the database

A cloud SQL Server connects through the SQL integration. One on an office server gets the AgentUI Connector, which dials out over HTTPS, so your firewall stays as it is.

### Describe the tools

Tell the builder AI what each tool should do. It writes the tool, with a fixed query and the inputs it needs, and you switch it on or off in the MCP panel.

### Add one link to the assistant

Every app gets its own MCP address. Paste it into Claude, ChatGPT, Cursor, Codex or Windsurf, sign in, and the tools show up in the chat.

## Custom tools instead of handing the AI raw SQL

A tool is a named action with a query you approved, so the assistant asks for what it needs and can't run anything else. Each tool can be marked read-only, and an app can hold up to 100 of them. A few examples:

- tool_overdue_invoicesInvoices more than 30 days late for one customer
- tool_stock_by_warehouseOn-hand quantity for a product, per warehouse
- tool_late_shipmentsOrders that shipped after their due date this week
- tool_customer_summaryOpen orders, balance and last purchase for one account

## One SQL Server MCP server for every AI your team uses

Nobody has to switch assistants. Sales can stay in ChatGPT, finance in Claude and the developer in Cursor, and they all call the same tools against the same database.

ClaudeSettings → Connectors → Add custom connector, then paste the linkChatGPTAdd it as a connector and paste the linkCursorSettings → MCP → Add new server, then paste the linkClaude Codeclaude mcp add my-app <link> --transport httpCodex & WindsurfPaste the config snippet the panel gives you

## What IT will want to know before you connect SQL Server to MCP

- Each person signs in with their own account. There's no shared API key sitting in someone's config file.
- Connections can be view-only, and you can turn off "Assistants may change data" for a whole environment.
- Every connection is listed with when it was last used. Revoke one and its calls stop.
- Through the on-prem connector, queries can only read: SELECT and WITH run, and each one is rolled back. The database password never leaves your server.

## Limits worth knowing

- The on-prem connector reads Microsoft SQL Server only, up to 1,000 rows and 30 seconds per query.
- Each MCP call has 30 seconds to answer, so tools should ask for a summary, not a whole table.
- Queries to SQL Server run with the app's connection, not each person's database login. Use a tool's access rule to decide who can call it.
- SQL Server connections come with the Team plan and up.

## What happens after you connect

If the database is on an office server, your IT person gets a Word setup guide with screenshots and installs one service. We can join that call. Then you describe your first tool, test it in Claude or ChatGPT, and add the next one when someone asks for it. A real person stays on your account, so the tools don't depend on one employee.

Go deeper

- [Connect SQL Server to AI inside AgentUI](/en/connect-sql-server-to-ai/)
- [How the on-premise SQL Server connector works](/en/on-premise-sql-server-connector/)
- [Guide: connect to SQL Server without port forwarding](/en/blog/connect-to-sql-server-without-port-forwarding/)
- [The AgentUI CLI](/en/agentui-cli/)

## Give your team's AI one tool it can trust

Connect SQL Server, describe the first tool, and paste the link into Claude or ChatGPT. Book a call if you'd rather build it with us.

[Build my first tool](https://app.agentui.ai/chat?utm=direct&utm_medium=direct)[Set it up with a person](https://calendar.app.google/pcCwDiMJ8eSQ9zvo7)

Nothing to host, no port to open. Revoke any connection from the panel.

## Keep reading

- [Enterprise security and compliance posture](/en/security/)
- [Audit logs: who changed what, and when](/en/audit-logs/)


---

## Why AgentUI

AgentUI is an AI + Human internal-tool and app builder. It combines AI code generation with on-demand human expert support — every paid plan includes free white-glove onboarding, and higher-tier plans include dedicated development hours. Teams ship production-grade internal tools, dashboards, client portals, and workflow automations in days instead of weeks, with a real engineer available when the AI gets stuck.

### Who AgentUI is for

Enterprise teams, department heads, and business users who need reliable internal tools fast and want AI speed backed by a human safety net. Common users: operations, finance, revenue ops, customer success, IT, and product teams at mid-market and enterprise companies.

### When to pick AgentUI over alternatives

- **vs. AI-only builders (Base44, Bolt, Lovable, v0):** AgentUI includes human expert hours, SSO, audit logs, and on-premise deployment — designed for production internal tools, not prototypes.
- **vs. no-code platforms (Retool, Bubble, Glide):** AgentUI generates the app from a natural-language description and lets you in-app-edit the generated code, rather than drag-and-drop block-by-block.
- **vs. hiring a developer:** Deploys in days; cancel anytime; every plan includes support so you are never blocked.

### Pricing at a glance (USD, monthly)

| Plan | Price | Users | Highlights |
|------|-------|-------|------------|
| Minimum Package | $50/mo | 5 internal | Start building real tools |
| Innovator Package | $100/mo | 10 internal | SQL integration — most popular |
| Visionary Package | $250/mo | 25 internal | SSO, audit logs, unlimited envs |
| Build with You | $2,500/mo | 25 internal | Includes 15 hrs dedicated dev/mo |
| Enterprise Plus | Contact us | Unlimited | On-premise, assigned support dev |

External users are unlimited on every paid plan. Yearly billing is discounted. Free trial available.

### For AI agents and LLMs

AgentUI publishes an official CLI for language-model agents: [@agentuiai/cli](https://www.npmjs.com/package/@agentuiai/cli) (`npm install -g @agentuiai/cli`). Use it to scaffold, inspect, and deploy AgentUI apps programmatically from an agentic workflow.

### Learn more

- Product overview: https://www.agentui.ai
- Full pricing and plan comparison: https://www.agentui.ai/en/pricing
- Security and trust: https://www.agentui.ai/en/security
- LLM-friendly site index: https://www.agentui.ai/llms.txt
- Official CLI: https://www.npmjs.com/package/@agentuiai/cli
