SQL MCP Server
Provides read-safe access to a SQLite database, enabling schema exploration, SELECT queries, and sample data retrieval through five MCP tools.
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., "@SQL MCP Serversummarize the database schema"
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.
SQL MCP Server
A Model Context Protocol (MCP) server that exposes a SQLite database to any MCP-compatible client — including Claude Desktop, Claude Code, and custom agents.
What it does
Gives an AI assistant structured, read-safe access to a relational database through five tools. The assistant can explore the schema, run SELECT queries, and retrieve sample data — without any risk of writes or destructive operations.
Related MCP server: SQLite Explorer
Schema
Five tables with realistic foreign-key relationships:
users ──< orders ──< order_items >── products
│
└──< support_ticketsTable | Description |
| 20 registered customers |
| 30-item product catalog with categories and stock levels |
| 30 purchase records linked to users |
| ~55 line items linking orders to specific products |
| 35 support requests with status and priority |
MCP Tools
Tool | Description |
| Returns all table names in the database |
| Returns column metadata — name, type, nullability, defaults, PK flag |
| Executes a SELECT query and returns rows as JSON. Non-SELECT statements are rejected. |
| Returns up to 100 sample rows from any table |
| Returns a plain-English summary of all 5 tables — columns, types, and FK relationships — in one call |
Security
run_querychecks the first SQL token and rejects anything that isn'tSELECTMulti-statement queries (containing
;) are blockedTable name parameters are validated against
[A-Za-z_][A-Za-z0-9_]*before interpolation
Setup
1. Install dependencies
pip install -r requirements.txt2. Seed the database
python seed.pyThis creates test.db in the same directory with all 5 tables populated.
3. Run the server
python server.pyThe server communicates over stdio using the MCP protocol.
Claude Desktop Integration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"sql-mcp": {
"command": "python3",
"args": ["/absolute/path/to/server.py"]
}
}
}Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop after saving.
Verify Tools (without Claude Desktop)
test_tools.py connects to the server via stdio and exercises all 5 tools:
python test_tools.pyExpected output confirms:
All 5 tools are registered
Each tool returns correct results
run_queryrejects non-SELECT statements
Project Structure
.
├── server.py # MCP server — 5 tools
├── seed.py # Creates and populates test.db
├── test_tools.py # Stdio client verification script
├── requirements.txt # mcp, aiosqlite
└── .gitignoreRequirements
Python 3.10+
mcp— MCP server frameworkaiosqlite— async SQLite driver
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
- OleanderOAuthdev.oleander
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables SQLite database interactions including querying, updating, and schema management through structured tools.3-
- AlicenseNot gradedqualityCmaintenanceEnables exploring and querying SQLite databases through natural language, with tools to list tables, describe table structures, and run SELECT queries.MIT
- FlicenseNot gradedqualityCmaintenanceExposes any SQLite database as read-only MCP tools for AI assistants, enabling listing tables, describing schemas, and running SELECT queries with filtering, ordering, and pagination.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to explore and query SQLite databases through read-only tools, with defense-in-depth sandboxing preventing any data modifications.MIT
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/apoorva183/MCP_for_SQL'
If you have feedback or need assistance with the MCP directory API, please join our Discord server