MCP Database Server
The MCP Server support your LLMs integrate with SQL Database (SQLite, SQL Server, Postgres SQL)
Overview
MCP Database Server is a Model Context Protocol (MCP) implementation designed to facilitate the integration of large language models (LLMs) with various SQL databases, including SQLite, PostgreSQL, and Microsoft SQL Server.
To use the MCP Database Server, install it via npm and run it in either SSE mode or STDIO mode, depending on your requirements. You can also integrate it with Claude Desktop for enhanced functionality.
- Supports multiple database systems: SQLite, PostgreSQL, Microsoft SQL Server, and MongoDB. - Runs in two modes: SSE mode for HTTP server and STDIO mode for standard input/output communication. - Provides tools for connecting to databases, executing queries, and managing database schemas.
- Connecting LLMs to SQL databases for data retrieval and manipulation.
- Executing complex queries and managing database schemas through a unified interface.
- Integrating with applications like Claude Desktop for enhanced database interactions.
Add to your AI client
Use these steps to connect MCP Database Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-dbs-cuongtl1992": {
"command": "npx",
"args": [
"-y",
"mcp-dbs@1.0.4",
"--stdio"
],
"env": {
"MCP_MONGODB_DATABASE": "hydra_kv_audit_1",
"MCP_MONGODB_URI": "mongodb://svc_audittrail:RiIWjXwzZnkaUpe@dc2d-fnb-infra-01.citigo.io:27017,dc2d-fnb-infra-02.citigo.io:27017,dc2d-fnb-infra-03.citigo.io:27017/?replicaSet=rs0",
"MCP_MSSQL_DATABASE": "HydraKiotVietShard1",
"MCP_MSSQL_ENCRYPT": "true",
"MCP_MSSQL_PASSWORD": "mssql#C1t1g0@sa",
"MCP_MSSQL_PORT": "1433",
"MCP_MSSQL_SERVER": "dc2d-fnb-mssql-01.citigo.io",
"MCP_MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"MCP_MSSQL_USER": "sa"
}
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-dbs-cuongtl1992": {
"command": "npx",
"args": [
"-y",
"mcp-dbs@1.0.4",
"--stdio"
],
"env": {
"MCP_MONGODB_DATABASE": "hydra_kv_audit_1",
"MCP_MONGODB_URI": "mongodb://svc_audittrail:RiIWjXwzZnkaUpe@dc2d-fnb-infra-01.citigo.io:27017,dc2d-fnb-infra-02.citigo.io:27017,dc2d-fnb-infra-03.citigo.io:27017/?replicaSet=rs0",
"MCP_MSSQL_DATABASE": "HydraKiotVietShard1",
"MCP_MSSQL_ENCRYPT": "true",
"MCP_MSSQL_PASSWORD": "mssql#C1t1g0@sa",
"MCP_MSSQL_PORT": "1433",
"MCP_MSSQL_SERVER": "dc2d-fnb-mssql-01.citigo.io",
"MCP_MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"MCP_MSSQL_USER": "sa"
}
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-dbs-cuongtl1992": {
"command": "npx",
"args": [
"-y",
"mcp-dbs@1.0.4",
"--stdio"
],
"env": {
"MCP_MONGODB_DATABASE": "hydra_kv_audit_1",
"MCP_MONGODB_URI": "mongodb://svc_audittrail:RiIWjXwzZnkaUpe@dc2d-fnb-infra-01.citigo.io:27017,dc2d-fnb-infra-02.citigo.io:27017,dc2d-fnb-infra-03.citigo.io:27017/?replicaSet=rs0",
"MCP_MSSQL_DATABASE": "HydraKiotVietShard1",
"MCP_MSSQL_ENCRYPT": "true",
"MCP_MSSQL_PASSWORD": "mssql#C1t1g0@sa",
"MCP_MSSQL_PORT": "1433",
"MCP_MSSQL_SERVER": "dc2d-fnb-mssql-01.citigo.io",
"MCP_MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"MCP_MSSQL_USER": "sa"
}
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-dbs-cuongtl1992": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-dbs@1.0.4",
"--stdio"
],
"env": {
"MCP_MONGODB_DATABASE": "hydra_kv_audit_1",
"MCP_MONGODB_URI": "mongodb://svc_audittrail:RiIWjXwzZnkaUpe@dc2d-fnb-infra-01.citigo.io:27017,dc2d-fnb-infra-02.citigo.io:27017,dc2d-fnb-infra-03.citigo.io:27017/?replicaSet=rs0",
"MCP_MSSQL_DATABASE": "HydraKiotVietShard1",
"MCP_MSSQL_ENCRYPT": "true",
"MCP_MSSQL_PASSWORD": "mssql#C1t1g0@sa",
"MCP_MSSQL_PORT": "1433",
"MCP_MSSQL_SERVER": "dc2d-fnb-mssql-01.citigo.io",
"MCP_MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"MCP_MSSQL_USER": "sa"
}
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-dbs-cuongtl1992": {
"command": "npx",
"args": [
"-y",
"mcp-dbs@1.0.4",
"--stdio"
],
"env": {
"MCP_MONGODB_DATABASE": "hydra_kv_audit_1",
"MCP_MONGODB_URI": "mongodb://svc_audittrail:RiIWjXwzZnkaUpe@dc2d-fnb-infra-01.citigo.io:27017,dc2d-fnb-infra-02.citigo.io:27017,dc2d-fnb-infra-03.citigo.io:27017/?replicaSet=rs0",
"MCP_MSSQL_DATABASE": "HydraKiotVietShard1",
"MCP_MSSQL_ENCRYPT": "true",
"MCP_MSSQL_PASSWORD": "mssql#C1t1g0@sa",
"MCP_MSSQL_PORT": "1433",
"MCP_MSSQL_SERVER": "dc2d-fnb-mssql-01.citigo.io",
"MCP_MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"MCP_MSSQL_USER": "sa"
}
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-dbs-cuongtl1992": {
"command": "npx",
"args": [
"-y",
"mcp-dbs@1.0.4",
"--stdio"
],
"env": {
"MCP_MONGODB_DATABASE": "hydra_kv_audit_1",
"MCP_MONGODB_URI": "mongodb://svc_audittrail:RiIWjXwzZnkaUpe@dc2d-fnb-infra-01.citigo.io:27017,dc2d-fnb-infra-02.citigo.io:27017,dc2d-fnb-infra-03.citigo.io:27017/?replicaSet=rs0",
"MCP_MSSQL_DATABASE": "HydraKiotVietShard1",
"MCP_MSSQL_ENCRYPT": "true",
"MCP_MSSQL_PASSWORD": "mssql#C1t1g0@sa",
"MCP_MSSQL_PORT": "1433",
"MCP_MSSQL_SERVER": "dc2d-fnb-mssql-01.citigo.io",
"MCP_MSSQL_TRUST_SERVER_CERTIFICATE": "true",
"MCP_MSSQL_USER": "sa"
}
}
}
}FAQ
**What databases are supported?**
The MCP Database Server supports SQLite, PostgreSQL, Microsoft SQL Server, and MongoDB.
**How do I install MCP Database Server?**
You can install it using the command: `npm install -g mcp-dbs`.
**Can I run it on a custom port?**
Yes, you can specify a custom port using the `--port` option when starting the server.