Version 1.1.0
Devart MCP Server for PostgreSQL
Devart MCP Server for PostgreSQL is a self-hosted Model Context Protocol (MCP) server that gives AI clients structured access to your PostgreSQL data—schema, queries, and writes. It runs in your environment on Windows and is free to use.
The server comes in two editions built from this repository:
| Edition | How you get it | Connects through |
|---|---|---|
| ADO.NET | NuGet .NET tool Devart.Mcp.PostgreSql, MCP Registry name com.devart/mcp-postgresql | Devart dotConnect for PostgreSQL, included in the package |
| ODBC | Windows installer from devart.com | Devart ODBC Driver for PostgreSQL, installed with the server |
Key benefits
Devart MCP Server for PostgreSQL allows you to:
- Work with data intuitively through natural language.
- Retrieve the required data for analysis within minutes.
- Report on your data faster with AI-powered assistance.
- Minimize manual data handling and integration maintenance.
How it works
The server exposes your PostgreSQL schema—tables, columns, keys, indexes, and routines—to the AI client as MCP tools. The AI client uses this schema to compose SQL queries and sends them to the server as tool calls. The server runs the queries through dotConnect for PostgreSQL or Devart ODBC Driver for PostgreSQL and returns structured results. Nothing is routed through a Devart-hosted service.

Available tools
The server exposes 14 tools. Tool names are prefixed with the connection profile name, for example my_postgresql_get_tables.
| Category | Tools |
|---|---|
| Schema | get_tables, get_columns, get_primary_keys, get_foreign_keys, get_indexes, get_routines |
| Read | execute_reader, count_rows |
| Write | execute_nonquery, add_row, execute_routine |
| Server | server_version, instructions, config |
The server includes write tools: execute_nonquery runs INSERT, UPDATE, DELETE, CREATE, ALTER, and DROP statements, and execute_routine calls stored procedures. For read-only access, see Security and access control.
Transports
| Transport | How it works |
|---|---|
| stdio | The AI client starts the server as a local process. Use it when the AI client runs on the same computer. |
| HTTP | You start the server, and AI clients connect to http://localhost:8080 (Streamable HTTP) or http://localhost:8080/sse (SSE). The HTTP transport doesn't use authentication, so keep the server bound to localhost. |
Quick start
Option 1: NuGet package (ADO.NET)
Prerequisites
- Windows x64.
- .NET 8 or later, including the ASP.NET Core shared framework.
dnxrequires .NET 10 or later. For .NET 8 and .NET 9, see the package README. - A dotConnect for PostgreSQL license key. On the licensing page, sign in to copy your key or register for a free 30-day trial.
Step 1: Create a connection profile
dnx Devart.Mcp.PostgreSql@1.1.0 config add my_postgresql --connection-string "Server=localhost;Port=5432;Database=your_database;User Id=your_user;Password=your_password;Unicode=True;License Key=your_license_key;" --protocol-type stdio
For all connection string parameters, see the dotConnect for PostgreSQL connection string reference.
Step 2: Add the server to your AI client
In Visual Studio Code, run MCP: Open User Configuration from the Command Palette and add:
{
"servers": {
"devart-postgresql": {
"type": "stdio",
"command": "dnx",
"args": ["Devart.Mcp.PostgreSql@1.1.0", "run", "my_postgresql"]
}
}
}
The AI client starts the server automatically. Instead of a profile, you can pass the connection string in the DEVART_MCP_POSTGRESQL_CONNECTION environment variable.
Configuration examples for Visual Studio, Claude Desktop, Cline, Codex, Cursor, Windsurf, and Zed, the .NET 8 and .NET 9 setup, and the HTTP transport setup are in the package README on NuGet.
Option 2: Windows installer (ODBC)
1. Download and install Devart MCP Server for PostgreSQL. The installer also installs Devart ODBC Driver for PostgreSQL and .NET 8.
2. In Devart MCP Server for PostgreSQL, configure your data connection, transport, and integration settings. For all connection string parameters, see the Devart ODBC Driver for PostgreSQL connection string reference.

3. Run your first natural-language query.
Security and access control
The server includes write tools and can do anything the account in the connection string is allowed to do. To limit an AI client to reading data:
| Edition | Read-only access |
|---|---|
| ADO.NET (NuGet) | Connect with a PostgreSQL role that has only the SELECT privilege |
| ODBC (installer) | Add Read Only=True to the connection string |
To limit what an AI client can read, give the account access only to the data it needs.
- Self-hosted. The server runs on your computer, not on Devart infrastructure, and connects to PostgreSQL from there. Query results go to your AI client and its AI model provider.
- Network access. The HTTP transport doesn't use authentication. Keep the server bound to
localhost, the default address. See Transports.
Manual installation and configuration
Prerequisites
Before building and running Devart MCP Server for PostgreSQL, ensure the following components are installed:
- .NET 8 SDK
- ADO.NET connection — Devart.AI.McpServer.AdoNet.PostgreSql.csproj Devart dotConnect for PostgreSQL (installed automatically via NuGet during build)
- ODBC connection — Devart.AI.McpServer.Odbc.PostgreSql.csproj Devart ODBC Driver for PostgreSQL (requires manual download and installation)
Step 1: Clone the repository
Clone the project repository and navigate to the project directory:
1. Open Command Prompt.
2. Enter the following command:
git clone https://github.com/devart-ai-connectivity/devart-mcp-server-postgresql.git
cd devart-mcp-server-postgresql
Step 2: Build the MCP Server from source
You can build Devart MCP Server for PostgreSQL from source using either of the supported database connectivity technologies: ADO.NET or ODBC.
- To build the MCP server with ADO.NET, run the following command:
dotnet publish Devart.AI.McpServer.AdoNet/Devart.AI.McpServer.AdoNet.PostgreSql/Devart.AI.McpServer.AdoNet.PostgreSql.csproj -c ReleasePostgreSql /p:TargetFramework=net8.0
The Devart dotConnect for PostgreSQL NuGet package is downloaded and restored automatically.
- To build the MCP server with ODBC, select the command based on the bitness of your data source.
For 64-bit data source, run the following command:
dotnet publish Devart.AI.McpServer.Odbc/Devart.AI.McpServer.Odbc.PostgreSql/Devart.AI.McpServer.Odbc.PostgreSql.csproj -c ReleasePostgreSql -r "win-x64" /p:TargetFramework=net8.0
For 32-bit data source, run the following command:
dotnet publish Devart.AI.McpServer.Odbc/Devart.AI.McpServer.Odbc.PostgreSql/Devart.AI.McpServer.Odbc.PostgreSql.csproj -c ReleasePostgreSql -r "win-x86" /p:TargetFramework=net8.0
Note
The target platform must match the bitness of your ODBC data source.
Step 3: Configure the database connection for the MCP Server
1. Create an mcpserver.json configuration file in the directory containing the built MCP Server executable.
2. In the file, configure the database connection.
- Configure a connection with ADO.NET.
Add the following configuration to the mcpserver.json file:
{
"Connections": [
{
"Name": "my_postgresql",
"ConnectionString": "Server=localhost;Port=5432;User Id=your_user;Password=your_password;Database=your_database;License Key=your_license_key;",
"ProtocolType": "stdio"
}
]
}
- Configure a connection with ODBC.
Add the following configuration to the mcpserver.json file:
{
"Connections": [
{
"Name": "my_postgresql",
"DsnName": "your_dsn_name",
"ProtocolType": "stdio"
}
]
}
- Configure a connection with ODBC using a connection string.
Add the following configuration to the mcpserver.json file:
{
"Connections": [
{
"Name": "my_postgresql",
"ConnectionString": "Driver={Devart ODBC Driver for PostgreSQL};Server=localhost;User ID=postgres;Password=your_password;Database=your_database;",
"ProtocolType": "stdio"
}
]
}
where:
-
Name— The connection name. -
ConnectionString(applies to ADO.NET) — A database-specific connection string used to establish a connection to the target database. -
DsnName(applies to ODBC) — The name of your data source. -
ProtocolType— A transport protocol. The possible options are:stdioorhttp. -
HttpPort(required ifProtocolTypeis set tohttp) — The port number for thehttpprotocol.
Step 4: Run the MCP server
After you configure the MCP Server, you can start it.
Note
This step is required only when
ProtocolTypeis configured ashttp. If you use thestdiotransport protocol, your AI client starts the server automatically.
- To start the server with ADO.NET, run the following command:
Devart.AI.McpServer.AdoNet.PostgreSql.exe run my_postgresql
- To start the server with ODBC, run the following command:
Devart.AI.McpServer.Odbc.PostgreSql.exe run my_postgresql
where my_postgresql is the name of the ODBC connection.
Step 5: Integrate with Claude Desktop
1. Open claude_desktop_config.json, the Claude configuration file.
Tip
If you can't locate the configuration file, it may not exist yet. To create it, open Claude Desktop and navigate to File > Settings > Developer, then click Edit Config. The folder with the
claude_desktop_config.jsonfile opens.
2. Add one of the following objects, depending on the transport protocol used by MCP Server:
- STDIO
{
"mcpServers": {
"devart": {
"command": "C:\\path\\to\\Devart.AI.McpServer.AdoNet.PostgreSql.exe",
"args": [
"run",
"my_postgresql"
]
}
}
}
where:
-
devartis the connector name that will appear in Claude Desktop. -
C:\\path\\to\\Devart.AI.McpServer.AdoNet.PostgreSql.exeis the path to the executable file. For an ODBC connection, useDevart.AI.McpServer.Odbc.PostgreSql.exe. -
my_postgresqlis the connection name specified in themcpserver.jsonconfiguration file. -
HTTP
"mcpServers": { "devart": { "command": "npx", "args": [ "-y", "mcp-remote", "http://localhost:5000/sse" ] } }where:
devartis the connector name that will appear in Claude Desktop.5000is the MCP Server listening port.
3. Save the file.
4. Restart Claude Desktop.
Devart MCP Server for PostgreSQL is now integrated with Claude, and devart appears in the Claude Desktop app in Customize > Connectors.
You can also integrate Devart MCP Server for PostgreSQL with other AI clients such as Cline, Codex, Cursor, Visual Studio Code, Windsurf, Zed.
Supported clients
Devart MCP Server for PostgreSQL supports integration with the following AI clients:
- Visual Studio
- Visual Studio Code
- Claude Desktop
- Cursor
- Codex
- Windsurf
- Cline
- Zed
- ...and other MCP-compatible AI clients
Typical use cases
Devart MCP Server for PostgreSQL is a practical fit for teams working with PostgreSQL as their primary data source.
-
Self-service analytics on PostgreSQL data
Let analysts, product managers, sales, finance, and operations teams ask natural-language questions without writing SQL. -
Developer copilot for production PostgreSQL databases
Help developers and DBAs investigate real data, inspect schemas, explore joins, and troubleshoot anomalies faster. -
Support and customer operations investigation
Let support teams quickly check orders, subscriptions, payments, statuses, and account history stored in PostgreSQL. -
Schema exploration and reverse engineering
Use AI to explain tables, relationships, and business logic in legacy or poorly documented PostgreSQL databases. -
Ad-hoc reporting and internal analysis
Generate one-off reports, investigate trends, and answer business questions from PostgreSQL without building a dashboard first. -
Secure on-premises AI access to PostgreSQL
Keep PostgreSQL data inside your infrastructure while giving AI tools a controlled path to work with real business data. The AI model provider still receives the data your AI client sends to it.
Licensing and activation
Devart MCP Server for PostgreSQL is free to use under the Devart MCP Server License Agreement. See LICENSE.
To connect to PostgreSQL, each edition needs a licensed Devart connectivity component. Both are commercial products with a free 30-day trial:
- ADO.NET edition—a dotConnect for PostgreSQL license key, passed in the connection string as
License Key=. Get a license key or a trial. - ODBC edition—a license for Devart ODBC Driver for PostgreSQL. The server installer installs the driver, and the driver's 30-day trial starts automatically. When the trial ends, buy a license and activate the license key in the driver settings.

