convez.ai
MCP Server
achmadya-dev

mcp-sqlite-query

achmadya-dev/mcp-sqlite-query

Ver no GitHub
InicialPluginScore · de 0 a 100

Model Context Protocol (MCP) server for SQLite to run SQL queries via stdio

Instalação

$npx convez-ai achmadya-dev/mcp-sqlite-query

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
1
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
v0.3.2
Issues abertas
0
Contribuidores
2

README

A tradução para o português deste README ainda está na fila.

@achmadya-dev/mcp-sqlite-query

MCP server for SQLite. Runs a single SQL statement per tool call over stdio using Node.js built-in node:sqlite (no native add-ons). Read-only by default — writes and DDL require explicit env flags.

Requirements

  • Node.js ≥ 22.5.0 (node:sqlite built-in)
  • A SQLite database file path, or :memory: for ephemeral storage

Install from npm

{
  "mcpServers": {
    "sqlite": {
      "command": "npx",
      "args": ["-y", "@achmadya-dev/mcp-sqlite-query"],
      "env": {
        "SQLITE_DB_PATH": "/absolute/path/to/database.db"
      }
    }
  }
}

Use :memory: for an in-memory database (data is lost when the server stops).

Or use envFile instead of inline env.

Develop from source

git clone https://github.com/achmadya-dev/mcp-sqlite-query.git
cd mcp-sqlite-query
pnpm install
pnpm run build
pnpm test

Open the repo root in Cursor and point at a database file (or :memory:):

{
  "mcpServers": {
    "sqlite": {
      "command": "node",
      "args": ["${workspaceFolder}/dist/index.js"],
      "env": {
        "SQLITE_DB_PATH": "/absolute/path/to/database.db"
      }
    }
  }
}

Or use envFile pointing at a .env in the repo root. Paths are resolved relative to the workspace folder when Cursor starts the server.

Environment variables

Database

VariableDefaultDescription
SQLITE_DB_PATH:memory:Database file path or :memory:
SQLITE_MAX_ROWS500Max rows for SELECT results

Write access

VariableAllows
ALLOW_INSERT_OPERATIONINSERT, REPLACE
ALLOW_UPDATE_OPERATIONUPDATE
ALLOW_DELETE_OPERATIONDELETE
ALLOW_DDL_OPERATIONDDL (CREATE, ALTER, DROP, VACUUM)

Enabled values: true, 1, yes, on.

Tools

ToolStatementsEnv flag
sqlite_selectSELECT, PRAGMA, EXPLAINalways on
sqlite_insertINSERT, REPLACEALLOW_INSERT_OPERATION
sqlite_updateUPDATEALLOW_UPDATE_OPERATION
sqlite_deleteDELETEALLOW_DELETE_OPERATION
sqlite_ddlDDLALLOW_DDL_OPERATION

Each tool accepts one sql string.

Behavior and security

  • One SQL statement per request.
  • SQL is validated with a parser that handles string literals, quoted identifiers, and comments before extracting the statement keyword.
  • Always blocked: XP_CMDSHELL, EXEC, EXECUTE, PREPARE, DEALLOCATE, ATTACH DATABASE, LOAD_FILE, INTO OUTFILE, COPY ... PROGRAM.
  • SELECT results are capped by SQLITE_MAX_ROWS.

Package scripts

pnpm run build
pnpm test
pnpm start
Ver o original no GitHub

Bom para

Relacionados