New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ajan-sql

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajan-sql

AI-safe MCP server for schema-aware, read-only SQL access.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

ajan-sql cover

Safe, read-only SQL access for AI agents — via MCP.

⚡ 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

🚀 Quick Start

DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB npx ajan-sql

That’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:

  • SELECT only
  • no INSERT, UPDATE, DELETE
  • no DROP, ALTER, TRUNCATE
  • limited results (LIMIT 100)
  • timeout enforced (max 5s)
  • no multi-statement queries
  • no SQL comments

👉 These rules cannot be bypassed.

⚡ Available Tools

  • list_tables
  • describe_table
  • list_relationships
  • search_schema
  • run_readonly_query
  • explain_query
  • sample_rows
  • server_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.sqlite

⚙️ 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-sql

or:

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

Keywords

mcp

FAQs

Package last updated on 25 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts