ajan-sql
Click on "Install 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., "@ajan-sqlshow me the first 10 rows from the users table"
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.
β‘ What is ajan-sql?
ajan-sql is an MCP server that lets AI agents safely query your database.
π read-only
π schema-aware
π guardrailed
Supports:
PostgreSQL
MySQL
SQLite
Related MCP server: mcp-multi-db
π Quick Start
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB npx ajan-sqlThatβs it.
π§ What it solves
AI agents querying databases is risky.
Without guardrails:
they can modify data
run heavy queries
break your system
π ajan-sql fixes this by enforcing strict rules.
π₯ Safety by default
All queries are:
SELECTonlyno
INSERT,UPDATE,DELETEno
DROP,ALTER,TRUNCATElimited results (
LIMIT 100)timeout enforced (max 5s)
no multi-statement queries
no SQL comments
π These rules cannot be bypassed.
π Sandboxing & Approvals
ajan-sql enforces sandboxing at the SQL access layer:
every query is validated before execution
query execution is readonly and bounded
results are limited by row count, timeout, and size
optional schema/table access policies can restrict readable tables
Human approval flows are handled by the MCP host or client. ajan-sql does not provide its own approval UI.
For production use, connect with a database user that only has readonly permissions. Database permissions should be the final safety backstop.
β‘ Available Tools
list_tablesdescribe_tablelist_relationshipssearch_schemarun_readonly_queryexplain_querysample_rowsserver_info
π§ Example
{
"tool": "run_readonly_query",
"arguments": {
"sql": "SELECT * FROM users LIMIT 10"
}
}Tool responses include both standard MCP structuredContent and an embedded text/toon version of the same payload.
π Supported Databases
# PostgreSQL
DATABASE_DIALECT=postgres
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB
# MySQL
DATABASE_DIALECT=mysql
DATABASE_URL=mysql://USER:PASSWORD@HOST:PORT/DB
# SQLite
DATABASE_DIALECT=sqlite
DATABASE_URL=file:/absolute/path/to/database.sqliteOptional readonly policy controls:
AJAN_SQL_ALLOWED_SCHEMAS=public,analytics
AJAN_SQL_ALLOWED_TABLES=public.users,analytics.events
AJAN_SQL_DENIED_TABLES=public.audit_logs
AJAN_SQL_AUDIT_LOG=trueβοΈ Features
MCP-native SQL access
multi-database support
strict read-only guardrails
schema discovery + introspection
structured JSON output for AI agents
TOON-formatted embedded tool results
predictable execution limits
type-safe schemas
π§ Use Cases
AI copilots querying databases
internal data assistants
analytics agents
safe DB access in automation
MCP-based workflows
π¦ Install
npm install -g ajan-sqlor:
npx ajan-sqlπ§© Client Example
{
"mcpServers": {
"ajan-sql": {
"command": "npx",
"args": ["ajan-sql"],
"env": {
"DATABASE_DIALECT": "postgres",
"DATABASE_URL": "postgres://USER:PASSWORD@HOST:PORT/DB"
}
}
}
}π‘ Philosophy
AI should never have unsafe database access.
ajan-sql ensures queries are safe, predictable, and controlled.
β€οΈ Support
If this tool helps you:
β Star the repo
β Support via GitHub Sponsors
https://github.com/sponsors/borakilicoglu
π Links
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
- Alicense-qualityCmaintenanceAn MCP server that enables AI agents to interact with SQLite databases by querying schemas, executing SQL, and inspecting table metadata. It supports safe database access through configurable read-only modes, query timeouts, and dry-run execution plans.MIT
- AlicenseAqualityAmaintenanceRead-only MCP server for querying PostgreSQL, MySQL, and SQLite from AI agents β multi-database, safe by default.4181ISC
- Flicense-qualityFmaintenanceA read-only MCP server that enables AI agents to explore database schemas and execute safe queries on PostgreSQL and MySQL.
- AlicenseAqualityAmaintenanceRead-only MCP server that lets AI agents safely query SQLite, PostgreSQL, and MySQL/MariaDB. Enforces read-only transactions with column masking, row caps, query timeouts, EXPLAIN-based cost rejection, and rate limiting.7321MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
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/borakilicoglu/ajan-sql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server