sql-mcp
@yuuzu/sql-mcp
Ein Model Context Protocol (MCP)-Server für MSSQL-, PostgreSQL- und SQLite-Datenbankoperationen.
Installation
# Using bunx (recommended)
bunx @yuuzu/sql-mcp
# Using npx
npx @yuuzu/sql-mcpRelated MCP server: Database MCP Server
Funktionen
Multi-Datenbank-Unterstützung: MSSQL, PostgreSQL und SQLite (via better-sqlite3)
8 Tools für Datenbankoperationen
Drei Abfragemodi: safe, write, full
Erweiterte Authentifizierung: Windows-Authentifizierung (MSSQL), SSL-Zertifikate (PostgreSQL)
Tools
Tool | Beschreibung |
| Verbindung zu einem Datenbankserver herstellen |
| Verbindung trennen |
| Verbindungsstatus und Abfragemodus prüfen |
| Alle Datenbanken auf dem Server auflisten |
| Zu einer anderen Datenbank wechseln |
| Alle Tabellen und Views auflisten |
| Details zum Tabellenschema abrufen |
| SQL-Abfragen ausführen |
Abfragemodi
Steuern Sie die Abfrageberechtigungen über die Umgebungsvariable SQL_MCP_MODE:
Modus | Erlaubte Operationen | Beschreibung |
| SELECT, WITH, EXPLAIN | Schreibgeschützt, am sichersten |
| + INSERT, UPDATE, DELETE | Erlaubt Datenänderungen |
| + CREATE, DROP, ALTER, TRUNCATE | Vollzugriff, mit Vorsicht verwenden |
Hinweis:
PRAGMA-Anweisungen (z. B.PRAGMA table_info(users)) sind in allen Modi erlaubt, einschließlichsafe, da es sich um schreibgeschützte Metadatenabfragen handelt, die häufig bei SQLite verwendet werden.
# Example: Enable write mode
SQL_MCP_MODE=write bunx @yuuzu/sql-mcpAnwendungsbeispiele
Claude Desktop-Konfiguration
Fügen Sie dies zu Ihrer claude_desktop_config.json hinzu:
{
"mcpServers": {
"sql-mcp": {
"command": "bunx",
"args": ["@yuuzu/sql-mcp"],
"env": {
"SQL_MCP_MODE": "safe"
}
}
}
}Verbindung zu MSSQL
{
"tool": "connect-database",
"arguments": {
"engine": "mssql",
"server": "localhost",
"port": 1433,
"user": "sa",
"password": "your_password",
"database": "master"
}
}Verbindung zu PostgreSQL
{
"tool": "connect-database",
"arguments": {
"engine": "postgres",
"server": "localhost",
"port": 5432,
"user": "postgres",
"password": "your_password",
"database": "postgres"
}
}Verbindung mit Windows-Authentifizierung (MSSQL)
{
"tool": "connect-database",
"arguments": {
"engine": "mssql",
"server": "localhost",
"windowsAuth": true
}
}Verbindung mit 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"
}
}
}Verbindung zu SQLite (Datei)
{
"tool": "connect-database",
"arguments": {
"engine": "sqlite",
"filename": "/absolute/path/to/database.db"
}
}Verbindung zu SQLite (im Arbeitsspeicher)
Nützlich für Tests, Demos oder temporäre Arbeitsbereiche.
{
"tool": "connect-database",
"arguments": {
"engine": "sqlite",
"filename": ":memory:"
}
}Verbindung zu SQLite (schreibgeschützt)
{
"tool": "connect-database",
"arguments": {
"engine": "sqlite",
"filename": "/absolute/path/to/database.db",
"readonly": true,
"fileMustExist": true
}
}Hinweis zur SQLite-Laufzeit: Die SQLite-Unterstützung verwendet
better-sqlite3, was Node.js erfordert. Bei der Ausführung überbunxfunktionieren MSSQL und PostgreSQL normal, aber SQLite-Verbindungen geben einen klaren Fehler zurück, der Sie anweist, stattdessennpxodernodezu verwenden.
Entwicklung
# 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 typecheckRelease
Releases werden über GitHub Actions automatisiert. Um ein neues Release zu erstellen:
# Create and push a version tag
git tag v1.0.0
git push origin v1.0.0Dies führt folgende Schritte aus:
Das Projekt bauen
Veröffentlichung auf npm mit Provenance
Erstellung eines GitHub-Releases mit automatisch generierten Release-Notes
Voraussetzungen: Setzen Sie das NPM_TOKEN-Secret in Ihren GitHub-Repository-Einstellungen.
Lizenz
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables secure interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.1381MIT
- Flicense-qualityDmaintenanceA Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.3

MCP TapData Serverofficial
Flicense-qualityDmaintenanceA Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.- Flicense-qualityCmaintenanceA Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for managing Prisma Postgres.
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NakiriYuuzu/sql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server