Registry / database / talk-sql

talk-sql

JSON →
library1.1.2jsnpmunverified

MCP (Model Context Protocol) server providing SQL database access for AI assistants like Cursor, Claude, and Copilot. Supports PostgreSQL, MySQL, SQL Server, SQLite, and IBM DB2 via unified tools (query, select, create table, etc.). Version 1.1.2 is current; released in 2025. Configuration via connection strings or JSON config files, with SSH tunnel support. Ships TypeScript types. Requires Node.js 18+. Differentiator: eliminates need for Docker or shell commands for AI database interaction; supports multiple database types and connections.

npm install talk-sql
INSTALL
IMPORT
SIG · TALK-SQL
T
talk-sql
databasejavascriptv1.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

talk-sql (CLI)
npx talk-sql
npm run talk-sql
Run directly without installing via npx; configure env TALK_SQL_CONFIG for multiple connections.
Programmatic use
import { Server } from '@modelcontextprotocol/sdk/server/index.js'; // then use talk-sql's Server subclass if exported
import talkSql from 'talk-sql'
talk-sql is primarily a CLI server; if programmatic API exists, it's not documented. Use CLI or spawn child process.
Config file
// ~/talk-sql.config.json with array of connection objects
// Single connection object without array
Config file must be a JSON array, even for one connection.

Shows setup for multiple database connections using a config file and npx run, plus AI client configuration.

// Create a config file ~/talk-sql.config.json: [ { "name": "local", "connectionString": "postgresql://user:password@localhost:5432/mydb" }, { "name": "prod", "connectionString": "postgresql://user:password@prod:5432/mydb" } ] // Then run: TALK_SQL_CONFIG=~/talk-sql.config.json npx talk-sql // In your MCP client (e.g., Claude Desktop), configure: { "mcpServers": { "talk-sql": { "command": "npx", "args": ["-y", "talk-sql"], "env": { "TALK_SQL_CONFIG": "/absolute/path/to/talk-sql.config.json" } } } } // AI tools: db_list_connections, db_ping, db_query, etc.
Debug
Known issues
gotchabetter-sqlite3 native binding may fail installation on Windows if missing build tools. You can safely ignore the error if not using SQLite.
fix
If SQLite not needed, no fix required. Otherwise install Windows Build Tools or use WSL.
affects: >=1.0.0
gotchaConnection string host must be the host as seen from the SSH server when using SSH tunnel; use localhost if DB is on same machine as SSH endpoint.
fix
Set connectionString host to the internal host (e.g., localhost) accessible from the SSH server.
affects: >=1.0.0
gotchaConfig file must be a JSON array, not a single object. Providing a single object will cause errors.
fix
Wrap your connection object in an array: [{...}].
affects: >=1.0.0
gotchaThe TALK_SQL_CONFIG environment variable path must be absolute. Relative paths may not resolve correctly.
fix
Use absolute path (e.g., /home/user/talk-sql.config.json).
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'better-sqlite3'
Native binding not installed, often due to missing build tools on Windows.
fix
Ignore if not using SQLite, or install prebuilt binaries with: npm install better-sqlite3 --build-from-source
Invalid configuration: expected array, got object
Config file is a single JSON object instead of an array of connections.
fix
Wrap the connection object in an array: [{ "name": "...", "connectionString": "..." }]
Connection refused: connect ECONNREFUSED
Database host not reachable (e.g., SSH tunnel not set up or wrong host in connectionString).
fix
Check SSH tunnel configuration and ensure connectionString host is correct from the SSH server's perspective.
Error: talk-sql: command not found
Package not installed globally or npx not available.
fix
Use npx talk-sql (without global install) or install globally: npm install -g talk-sql
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
better-sqlite3optionalNative binding for SQLite support; optional — SQLite can be ignored if not used.
Agent activity
15 hits · last 30 days
node
12
Meta
1
Amazon
1
OpenAI (training)
1
Resources
talk-sql — npm install talk-sql · libregistry