mcp-server-sqlite
Executes arbitrary SQL queries (SELECT, INSERT, UPDATE, DELETE, DDL) on a SQLite database, returning results as JSON, enabling AI agents to interact with local SQLite databases.
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., "@mcp-server-sqliteShow me all rows from the customers 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.
mcp-server-sqlite
Serveur MCP (Model Context Protocol) en Python exposant une base SQLite à un
assistant IA via un unique outil : execute_sql. Usage local et personnel.
L'IA peut exécuter n'importe quelle requête SQL (SELECT, INSERT, UPDATE,
DELETE, DDL…) et récupérer les résultats au format JSON.
⚠️ Aucun garde-fou de sécurité : le SQL est totalement libre, il n'y a ni mode lecture seule, ni authentification, ni limite. Destiné à un usage local par un utilisateur unique.
Prérequis
Python 3.12+
Related MCP server: SQLite MCP Server
Installation
uv syncLancement
Le chemin de la base SQLite est fourni via --db-path ou la variable
d'environnement SQLITE_DB_PATH. Le fichier est créé automatiquement s'il
n'existe pas.
Mode stdio (usage local standard)
uv run mcp-server-sqlite --db-path ./ma_base.dbMode HTTP (JSON, sans SSE)
uv run mcp-server-sqlite --transport http --db-path ./ma_base.db --host 127.0.0.1 --port 8000Le transport HTTP répond en application/json (pas de flux SSE), adapté aux
clients incapables de streamer. Par défaut : 127.0.0.1:8000.
Accès navigateur : le serveur fonctionne sans aucune configuration d'origine.
La protection anti DNS-rebinding du SDK MCP est désactivée (sinon les origines
non-localhost sont rejetées avec « Invalid Origin header ») et le CORS autorise
par défaut toutes les origines (*). Si vous souhaitez malgré tout restreindre
le CORS, utilisez --cors-origin (répétable) :
uv run mcp-server-sqlite --transport http --cors-origin http://localhost:3000 --cors-origin https://mon-app.exampleL'en-tête Mcp-Session-Id est exposé pour permettre aux clients navigateurs de
lire l'identifiant de session MCP.
L'outil execute_sql
Entrée :
sql— une chaîne contenant du SQL arbitraire. Plusieurs instructions peuvent être séparées par;(exécution de typeexecutescript).Sortie (chaîne JSON) :
Requête renvoyant des lignes (
SELECT) :{"rows": [{"colonne": valeur, ...}, ...]}Requête de modification / DDL :
{"rowcount": <nombre de lignes affectées>}Erreur SQL :
{"error": "<message>"}
Les types non natifs JSON sont convertis en chaîne :
BLOBdécodé en UTF-8 (repli en hexadécimal), dates au format ISO.Commit automatique après chaque appel réussi.
Configuration côté client MCP
Deux cas de figure : le client lance lui-même le serveur (mode stdio), ou le client se connecte à un serveur HTTP déjà démarré.
Mode stdio (le client lance le serveur)
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"sqlite": {
"command": "uv",
"args": [
"run",
"--directory",
"d:/___AGENTS/mcp-server-sqlite-uv",
"mcp-server-sqlite",
"--db-path",
"d:/___AGENTS/mcp-server-sqlite-uv/ma_base.db"
]
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"sqlite": {
"command": "uv",
"args": [
"run",
"--directory",
"d:/___AGENTS/mcp-server-sqlite-uv",
"mcp-server-sqlite",
"--db-path",
"d:/___AGENTS/mcp-server-sqlite-uv/ma_base.db"
]
}
}
}Mode HTTP (le serveur est démarré à part)
Démarrez d'abord le serveur en mode HTTP :
uv run mcp-server-sqlite --transport http --db-path ./ma_base.db --host 127.0.0.1 --port 8000Le point de terminaison MCP est alors disponible sur http://127.0.0.1:8000/mcp.
Configurez ensuite le client pour s'y connecter par URL.
VS Code (.vscode/mcp.json)
{
"servers": {
"sqlite": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp"
}
}
}Claude Desktop (claude_desktop_config.json)
Claude Desktop ne se connecte qu'en stdio ; on passe par le proxy
mcp-remote pour atteindre un
serveur HTTP :
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["mcp-remote", "http://127.0.0.1:8000/mcp"]
}
}
}ℹ️ Si le client tourne dans un navigateur, autorisez son origine avec
--cors-originau lancement du serveur (voir la section Lancement).
Tests
uv run pytestDéveloppement avec mise
Le projet fournit un mise.toml qui gère les outils (Python 3.12, uv)
et expose des tâches. uv est configuré pour utiliser le Python fourni par mise.
mise install # installe Python + uv
mise run install # uv sync
mise run test # tests pytest
mise run serve # serveur en mode stdio
mise run serve-http # serveur en mode HTTP (JSON)Licence
MIT — voir LICENSE.
Available Tools
1 toolexecute_sqlA
Exécute une ou plusieurs requêtes SQL sur la base SQLite.
Args:
sql: SQL arbitraire (SELECT, INSERT, UPDATE, DELETE, DDL…).
Plusieurs instructions peuvent être séparées par ';'.
Returns:
Une chaîne JSON : {"rows": [...]} pour les requêtes renvoyant des
lignes, {"rowcount": n} pour les modifications/DDL, ou
{"error": "..."} en cas d'erreur SQL.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses that arbitrary SQL (SELECT, INSERT, UPDATE, DELETE, DDL) is allowed, multiple statements via ';', and that errors return JSON with 'error'. However, it does not explicitly warn about destructive potential, but the listed operations imply it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with separate Args and Returns sections, though the formatting is slightly verbose. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given one required parameter, no annotations, and an output schema described in the description, the description covers purpose, parameter behavior, return format, and error handling completely.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must add meaning. It explains that the 'sql' parameter accepts arbitrary SQL, lists allowed operations, and notes that multiple statements can be separated by ';'. This fully compensates for the lack of schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'Exécute une ou plusieurs requêtes SQL sur la base SQLite', which is a clear verb (execute) + resource (SQLite database) and differentiates from any sibling (none provided).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit when-to-use or when-not-to-use guidance, but the tool's purpose is straightforward and no siblings exist, so the implied usage is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
execute_sql
TDQS
With only one tool, there is no ambiguity; the agent cannot confuse it with any other tool.
The single tool name 'execute_sql' follows a clear verb_noun pattern, consistent with best practices.
One tool is minimal but fully capable for a SQLite database server, covering all operations via arbitrary SQL queries.
The tool accepts any SQL statement, enabling full CRUD, DDL, and other database operations without gaps.
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
- OleanderOAuthdev.oleander
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to perform complete database operations on SQLite databases, including creating tables, executing queries, and managing data through CRUD operations with schema inspection capabilities.32MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with SQLite databases by executing read and write queries, listing tables, and inspecting schemas. It provides a secure, local interface for database management and data retrieval through the Model Context Protocol.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to connect to and query an SQLite database through the Model Context Protocol, allowing natural language interaction with database tables and data.-
- AlicenseBqualityCmaintenanceEnables AI agents to interact with local SQLite databases with full CRUD, schema introspection, foreign key relations, generated columns, and multi-format import/export (CSV, JSON, XLSX) through natural language.2617MIT
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/jlg-formation/mcp-server-sqlite-uv'
If you have feedback or need assistance with the MCP directory API, please join our Discord server