SQL MCP server for MSSQL, PostgreSQL, and SQLite

SQL MCP server for MSSQL, PostgreSQL, and SQLite

sql-mcp•bynakiriyuuzu

An MCP server that connects to MSSQL, PostgreSQL, and SQLite databases and exposes tools for listing databases, inspecting schemas, and executing SQL queries.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Connects to MSSQL, PostgreSQL, and SQLite, including SQLite in-memory and read-only modes.
  • •Offers tools to connect, check status, list databases, switch databases, list tables and views, describe table schemas, and execute queries.
  • •Controls SQL permissions through safe, write, and full query modes.
  • •Supports Windows Authentication for MSSQL and SSL certificates for PostgreSQL.

BEST FOR

  • •Read-only exploration of database schemas and data with the default safe mode.
  • •Allowing an assistant to modify data when write mode is enabled.
  • •Testing or demo work against ephemeral SQLite in-memory databases.

ABOUT SQL-MCP

SQL MCP server for MSSQL, PostgreSQL, and SQLite is cataloged as an MCP server attributed to nakiriyuuzu. An MCP server that connects to MSSQL, PostgreSQL, and SQLite databases and exposes tools for listing databases, inspecting schemas, and executing SQL queries. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for SQL MCP server for MSSQL, PostgreSQL, and SQLite are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which SQL databases does the server support?

It supports MSSQL, PostgreSQL, and SQLite via better-sqlite3.

Are PRAGMA statements allowed in safe mode?

Yes, PRAGMA statements are allowed in all modes including safe because they are read-only metadata queries commonly used with SQLite.

上游原版 README

在 GitHub 查看同一版本原文

README.md · d02f01768c01 · 采集于 2026-11-13 12:16:31 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

@yuuzu/sql-mcp

CI npm version

A Model Context Protocol (MCP) server for MSSQL, PostgreSQL, and SQLite database operations.

Installation

# Using bunx (recommended)
bunx @yuuzu/sql-mcp

# Using npx
npx @yuuzu/sql-mcp

Features

  • Multi-database support: MSSQL, PostgreSQL, and SQLite (via better-sqlite3)
  • 8 tools for database operations
  • Three query modes: safe, write, full
  • Advanced authentication: Windows Auth (MSSQL), SSL certificates (PostgreSQL)

Tools

ToolDescription
connect-databaseConnect to a database server
disconnectDisconnect from the current connection
connection-statusCheck connection status and query mode
list-databasesList all databases on the server
switch-databaseSwitch to a different database
list-tablesList all tables and views
describe-tableGet table schema details
execute-queryExecute SQL queries

Query Modes

Control query permissions via SQL_MCP_MODE environment variable:

ModeAllowed OperationsDescription
safe (default)SELECT, WITH, EXPLAINRead-only, safest
write+ INSERT, UPDATE, DELETEAllows data modification
full+ CREATE, DROP, ALTER, TRUNCATEFull access, use with caution

Note: PRAGMA statements (e.g. PRAGMA table_info(users)) are allowed in all modes including safe, as they are read-only metadata queries commonly used with SQLite.

# Example: Enable write mode
SQL_MCP_MODE=write bunx @yuuzu/sql-mcp

Usage Examples

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
    "mcpServers": {
        "sql-mcp": {
            "command": "bunx",
            "args": ["@yuuzu/sql-mcp"],
            "env": {
                "SQL_MCP_MODE": "safe"
            }
        }
    }
}

Connect to MSSQL

{
    "tool": "connect-database",
    "arguments": {
        "engine": "mssql",
        "server": "localhost",
        "port": 1433,
        "user": "sa",
        "password": "your_password",
        "database": "master"
    }
}

Connect to PostgreSQL

{
    "tool": "connect-database",
    "arguments": {
        "engine": "postgres",
        "server": "localhost",
        "port": 5432,
        "user": "postgres",
        "password": "your_password",
        "database": "postgres"
    }
}

Connect with Windows Authentication (MSSQL)

{
    "tool": "connect-database",
    "arguments": {
        "engine": "mssql",
        "server": "localhost",
        "windowsAuth": true
    }
}

Connect with SSL (PostgreSQL)

{
    "tool": "connect-database",
    "arguments": {
        "engine": "postgres",
        "server": "your-server.com",
        "user": "postgres",
        "password": "your_password",
        "ssl": {
            "rejectUnauthorized": true,
            "ca": "/path/to/ca-certificate.crt"
        }
    }
}

Connect to SQLite (file)

{
    "tool": "connect-database",
    "arguments": {
        "engine": "sqlite",
        "filename": "/absolute/path/to/database.db"
    }
}

Connect to SQLite (in-memory)

Useful for testing, demos, or ephemeral scratch workspaces.

{
    "tool": "connect-database",
    "arguments": {
        "engine": "sqlite",
        "filename": ":memory:"
    }
}

Connect to SQLite (read-only)

{
    "tool": "connect-database",
    "arguments": {
        "engine": "sqlite",
        "filename": "/absolute/path/to/database.db",
        "readonly": true,
        "fileMustExist": true
    }
}

SQLite runtime note: SQLite support uses better-sqlite3 which requires Node.js. When running via bunx, MSSQL and PostgreSQL work normally but SQLite connections will return a clear error directing you to use npx or node instead.

Development

# Install dependencies
bun install

# Run in development mode
bun run dev

# Run tests
bun test

# Run tests with coverage
bun test --coverage

# Build
bun run build

# Type check
bun run typecheck

Release

Releases are automated via GitHub Actions. To create a new release:

# Create and push a version tag
git tag v1.0.0
git push origin v1.0.0

This will:

  1. Build the project
  2. Publish to npm with provenance
  3. Create a GitHub Release with auto-generated release notes

Requirements: Set NPM_TOKEN secret in your GitHub repository settings.

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for SQL MCP server for MSSQL, PostgreSQL, and SQLite from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/sql-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage