ChatSQL
by thomasjerard·★ 0·Score 30
ChatSQL converts natural language questions to PostgreSQL queries using Gemini and FastMCP protocol.
Overview
ChatSQL is a command-line tool that enables users to query PostgreSQL databases using natural language. It leverages Google Gemini for natural language to SQL conversion and FastMCP for executing queries against the database. The tool creates a seamless experience where users can ask questions in plain English and receive valid SQL results instantly.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose ChatSQL if you're using PostgreSQL and want to allow non-technical users to query databases with natural language, with minimal setup.
When NOT to choose this
Avoid ChatSQL if you need support for multiple database types, advanced query features, or if you're concerned about security with sending sensitive database queries to external APIs.
Tools this server exposes
1 tool extracted from the READMEquery_databaseExecute a SQL query against the PostgreSQL database
Note: Inferred from the description and example use case. The README doesn't explicitly list tool names but describes functionality where natural language is converted to SQL and executed against a database.
Comparable tools
Installation
Installation
- Clone the repository:
git clone https://github.com/thomasjerard/ChatSQL.git
cd chatSQL- Create a .env file with your database credentials and Gemini API key:
DB_NAME=chattosql
DB_USER=postgres
DB_PASS=yourpassword
DB_HOST=localhost
DB_PORT=5432
GEMINI_API_KEY=your-gemini-api-key- Run the server in one terminal:
./run_server.sh- Run the client in another terminal:
./run_client.shTo use with Claude Desktop, add to your config.json:
{
"mcpServers": {
"chatsql": {
"command": "python",
"args": ["path/to/chatsql/server.py"]
}
}
}FAQ
- What databases are supported?
- Currently, only PostgreSQL is supported through the psycopg2 library.
- Can I use this with other LLMs besides Gemini?
- The current implementation is specifically designed for Google Gemini, though the architecture could potentially be adapted for other LLMs.
Compare ChatSQL with
Last updated · Auto-generated from public README + GitHub signals.