Kole MCP Server
OfficialAllows running SQL queries against connected MySQL databases through SyneHQ Kole, including listing database connections and inspecting schema metadata.
Provides SQL query execution and PostgreSQL-specific psql commands, DDL operations, and schema/table inspection for connected PostgreSQL databases.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Kole MCP Server show me the top 5 customers by revenue this month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SyneHQ Kole MCP Server
Query your databases using SQL, PostgreSQL, or plain English through SyneHQ's Kole platform. Built on the Model Context Protocol.
Why?
We built this because switching between database clients, writing boilerplate SQL, and remembering schema details gets old fast. Now you can just ask questions about your data in whatever way makes sense—whether that's raw SQL, psql shortcuts, or "show me last month's top customers."
Related MCP server: PostgreSQL MCP Server
What it does
Runs SQL queries against any connected database
Supports PostgreSQL-specific commands (
\dt,\d+, DDL operations)Translates natural language questions into proper SQL
Lists tables, schemas, and connection details
Tests connections before you waste time on bad queries
Includes a skill with 50+ real-world query patterns
Getting started
Security & Prerequisites
⚠️ Important Security Information
This MCP server can execute arbitrary SQL queries and DDL statements (CREATE, ALTER, DROP) against your connected databases. Before installing:
Review the source code: Check github.com/synehq/kole-mcp to understand what the API key grants access to
Use least-privilege credentials: For testing, use read-only database users when possible
Test on non-production databases first: Verify behavior before connecting to production data
Never commit credentials: Keep SYNEHQ_API_KEY out of version control
Understand audit logging: All queries are logged server-side at data.synehq.com/dashboard → Audit Logs
The SYNEHQ_API_KEY grants access to query all databases connected to your SyneHQ account.
Install
npm install -g @synehq/kole-mcpOr build from source:
git clone https://github.com/synehq/kole-mcp.git
cd kole-mcp
npm install
npm run buildSet up credentials
You'll need a SyneHQ account and API key. If you don't have one:
# Get signup info
curl https://data.synehq.com/api/auth-infoThen set your environment:
export SYNEHQ_API_KEY="your_api_key"
export SYNEHQ_CONNECTION_ID="your_connection_id" # optionalConfigure your MCP client
For desktop apps
Add to claude_desktop_config.json:
{
"mcpServers": {
"synehq-kole": {
"command": "npx",
"args": ["-y", "@synehq/kole-mcp@latest"],
"env": {
"SYNEHQ_API_KEY": "your_api_key",
"SYNEHQ_CONNECTION_ID": "your_connection_id"
}
}
}
}Or if installed globally:
{
"mcpServers": {
"synehq-kole": {
"command": "synehq-kole-mcp",
"env": {
"SYNEHQ_API_KEY": "your_api_key",
"SYNEHQ_CONNECTION_ID": "your_connection_id"
}
}
}
}For project-level setup
Create .mcp.json:
{
"synehq-kole": {
"command": "npx",
"args": ["-y", "@synehq/kole-mcp@latest"],
"env": {
"SYNEHQ_API_KEY": "${SYNEHQ_API_KEY}",
"SYNEHQ_CONNECTION_ID": "${SYNEHQ_CONNECTION_ID}"
}
}
}Or if installed globally:
{
"synehq-kole": {
"command": "synehq-kole-mcp",
"env": {
"SYNEHQ_API_KEY": "${SYNEHQ_API_KEY}",
"SYNEHQ_CONNECTION_ID": "${SYNEHQ_CONNECTION_ID}"
}
}
}Usage
Quick examples
Run SQL:
execute_query({
query: "SELECT * FROM users WHERE created_at > '2024-01-01' LIMIT 10"
})Ask in English:
execute_query({
query: "Show me the top 5 customers by revenue this month"
})PostgreSQL shortcuts:
execute_query({
query: "\\dt",
psql: true
})Override connection:
execute_query({
query: "SELECT COUNT(*) FROM orders",
connectionId: "staging-db"
})Available tools
execute_query
The main tool. Pass it SQL, psql commands, or natural language.
Parameters:
query(required) — SQL, psql command, or question in plain EnglishconnectionId(optional) — Which database to queryuserId(optional) — For audit logspsql(optional) — Enable PostgreSQL mode for DDL and psql commandslimit(optional) — Cap results (useful for large tables)timeout(optional) — Query timeout in milliseconds
get_connections
Lists all your database connections. No parameters needed.
Returns connection IDs, names, types (PostgreSQL, MySQL, etc.), and status.
test_connection
Checks if a connection works before you query it.
test_connection({ connectionId: "prod-db" })get_tables
Lists tables, optionally filtered by database and schema.
get_tables({ database: "production", schema: "public" })get_table_schema
Shows columns, types, constraints, and indexes for a table.
get_table_schema({
database: "production",
schema: "public",
table: "users"
})get_auth_info
Returns signup and login URLs if you need to create an account.
Real-world examples
Business questions
-- Monthly revenue trend
SELECT
DATE_TRUNC('month', order_date) as month,
SUM(total_amount) as revenue
FROM orders
WHERE order_date >= '2024-01-01'
GROUP BY month
ORDER BY month DESC;
-- Customer lifetime value
SELECT
customer_id,
COUNT(*) as order_count,
SUM(total_amount) as lifetime_value
FROM orders
GROUP BY customer_id
ORDER BY lifetime_value DESC
LIMIT 20;Natural language (just say it)
"What are the top 10 products by sales this quarter?"
"Show me users who signed up last week"
"How many orders are pending?"
"What's the average order value by region?"PostgreSQL power-user stuff
-- Inspect schema
\dt public.*
\d+ orders
-- Create things
CREATE TABLE cache (
id SERIAL PRIMARY KEY,
key VARCHAR(255) UNIQUE,
data JSONB,
expires_at TIMESTAMP
);
CREATE INDEX idx_cache_key ON cache(key);
-- Drop things
DROP TABLE IF EXISTS temp_table;Working with multiple databases
You can query different databases in the same session:
// Check production
execute_query({
query: "SELECT COUNT(*) FROM users",
connectionId: "prod-db"
})
// Compare with staging
execute_query({
query: "SELECT COUNT(*) FROM users",
connectionId: "staging-db"
})Development
npm install
npm run build # compile TypeScript
npm run dev # watch mode
npm start # run the serverTroubleshooting
"SYNEHQ_API_KEY environment variable is required"
You forgot to set your API key:
export SYNEHQ_API_KEY=your_api_key"Connection ID is required"
Either set a default:
export SYNEHQ_CONNECTION_ID=your_connection_idOr pass it with each query:
execute_query({
query: "SELECT * FROM users",
connectionId: "your_connection_id"
})Query times out
Increase the timeout or limit results:
execute_query({
query: "SELECT * FROM huge_table",
limit: 1000,
timeout: 60000 // 1 minute
})Connection fails
Test it first:
test_connection({ connectionId: "your_connection" })Check the dashboard to make sure the connection is configured correctly and the database is accessible.
Security
Required Credentials
This MCP server requires two environment variables:
SYNEHQ_API_KEY (required): Authentication key that grants access to query all databases connected to your SyneHQ account
SYNEHQ_CONNECTION_ID (optional): Default database connection ID (can be overridden per-query)
Get your credentials:
Sign up at https://data.synehq.com/signup
Get API key from dashboard: Settings → API Keys
Get connection ID from dashboard: Connections
Security Best Practices
What this MCP server can do:
Execute arbitrary SQL SELECT, INSERT, UPDATE, DELETE statements
Execute PostgreSQL DDL statements (CREATE TABLE, ALTER TABLE, DROP TABLE, etc.)
Access all databases connected to your SyneHQ account
Read database schemas and metadata
Recommendations:
✅ Use read-only database users for exploration and testing
✅ Test on non-production databases first
✅ Review the source code before installation
✅ Use database users with only necessary permissions for production
✅ Monitor audit logs at https://data.synehq.com/dashboard → Audit Logs
❌ Don't commit SYNEHQ_API_KEY to version control
❌ Don't use superuser database credentials
❌ Don't share API keys publicly
Transport security:
All API communication over HTTPS
API keys transmitted via headers (never in URLs or query strings)
Database credentials managed server-side (never exposed to MCP client)
Audit logging:
All queries logged with timestamps and user IDs (if provided)
Access logs at https://data.synehq.com/dashboard → Audit Logs
Track who executed what queries on which databases
Contributing
See CONTRIBUTING.md.
We're using TypeScript with strict mode, Zod for validation, and the official MCP SDK. Keep PRs focused and add tests when it makes sense.
Publishing
See PUBLISHING.md for the full release process.
Quick version:
npm version patch # or minor, or major
git push --tags
# GitHub Actions handles the restLicense
MIT — see LICENSE for details.
Questions?
Open an issue: https://github.com/synehq/kole-mcp/issues
Email us: support@synehq.com
Read the docs: https://docs.synehq.com
Built by the team at SyneHQ. We're using this in production every day.
Available Tools
6 toolsexecute_queryB
Execute a SQL query or natural language query against your data through SyneHQ Kole. Supports SQL queries subject to the API key permission and connector policy. Perfect for data analysis, reporting, and database operations.
Inputs: query (required), psql, limit, userId, +3 more.
get_auth_infoA
Get information about how to sign up, log in, and get started with SyneHQ. Returns URLs for signup, login, dashboard, and documentation. Use this when users need to create an account or get their API credentials.
Inputs: no named parameters.
get_connectionsA
List all database connections available in your SyneHQ account. Returns connection details including IDs, names, types, and status. Useful for discovering which databases you can query and their connection IDs.
Inputs: no named parameters.
get_tablesA
List all tables available in the connected database. Can be filtered by database and schema. Helps discover what data is available.
Inputs: schema, database, connectionId.
get_table_schemaB
Get detailed schema information for a specific table, including column names, data types, constraints, and indexes. Essential for understanding table structure.
Inputs: table (required), schema (required), database (required), connectionId.
test_connectionA
Test the connection to a SyneHQ database to verify credentials and accessibility. Useful before running queries to ensure the connection is valid.
Inputs: connectionId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct role: connection discovery, connectivity testing, table listing, schema inspection, query execution, and auth onboarding. get_connections and test_connection are related but clearly separated by listing vs verifying, and get_tables vs get_table_schema are also well differentiated.
All tool names follow a consistent snake_case verb_noun pattern such as get_table_schema, get_connections, execute_query, and test_connection. The convention is predictable and readable throughout.
Six tools is well scoped for a database query and inspection MCP server. Each tool covers a meaningful part of the workflow without obvious redundancy.
The surface covers discovery, validation, schema inspection, and query execution, which are the core needs for this domain. Minor gaps could include explicit database/schema listing operations, but get_connections and get_tables largely compensate.
Maintenance
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Query Postgres, MySQL, BigQuery, Iceberg and files with DuckDB, with per-query cost checks.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables querying and managing PostgreSQL and MySQL databases through natural language, supporting connection management, query execution, schema inspection, and parameterized queries with connection pooling.519 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables exploration and querying of PostgreSQL databases through natural language. Supports listing tables, viewing schemas, executing SELECT queries, filtering records, and retrieving database statistics.2MIT
- AlicenseAqualityDmaintenanceEnables executing SQL queries, schema introspection, and data management for PostgreSQL and MySQL databases via natural language, supporting local, SSH, and AWS RDS connections.8MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of SQL databases using AI, supporting multiple database types and automatic schema discovery.1MIT