Skip to main content
Glama
nao9net
by nao9net

This is a server that allows you to operate SQLite databases via MCP (Model Context Protocol). At startup, you register multiple databases in the form of "alias=path", and when calling tools, you select the database by alias name. It is safe because it does not accept arbitrary file paths at runtime.

Features (Tools)

  • list_databases — Displays a list of aliases for registered databases

  • list_tables — Displays a list of all table names in the specified database

  • describe_table — Retrieves the schema of the specified table (columns/types/foreign keys/indexes)

  • read_query — Executes SELECT / WITH / PRAGMA (read-only)

  • write_query — Executes INSERT / UPDATE / DELETE / DDL (data changes)

list_tables/describe_table/read_query/write_query accept an optional database argument (alias name). If only one database is registered, it can be omitted (it automatically becomes the default). If two or more are registered, the database argument is required each time.

Related MCP server: MCP SQLite Server

Setup

npm install

Startup

Start by specifying one or more databases in the format alias=path.

node index.js main=/path/to/main.db logs=/path/to/logs.db

When registering only one (in this case, the database argument can be omitted):

node index.js main=/path/to/main.db

Environment Variables

Variable name

Description

SQLITE_READONLY=1

Opens all connections in read-only mode (write_query becomes unavailable)

Usage Examples

// 登録済みDB一覧を確認
{ "tool": "list_databases", "arguments": {} }

// "main" DBのテーブル一覧
{ "tool": "list_tables", "arguments": { "database": "main" } }

// "logs" DBに対してクエリ
{ "tool": "read_query", "arguments": { "sql": "SELECT * FROM events", "database": "logs" } }

// DBが1つしか登録されていない場合は database 省略可
{ "tool": "read_query", "arguments": { "sql": "SELECT * FROM users" } }

Registering with an MCP Client

Claude Desktop

Add the following to claude_desktop_config.json (specify paths as absolute paths according to your environment):

{
  "mcpServers": {
    "sqlite": {
      "command": "node",
      "args": [
        "/絶対パス/sqlite-mcp-server/index.js",
        "main=/絶対パス/main.db",
        "logs=/絶対パス/logs.db"
      ]
    }
  }
}

After configuration, restart Claude Desktop and the sqlite server tools will become available.

Claude Code (CLI / VS Code Extension)

Register using the claude command from a terminal in VS Code or a regular terminal.

claude mcp add --transport stdio sqlite -- node /絶対パス/sqlite-mcp-server/index.js main=/絶対パス/main.db logs=/絶対パス/logs.db
  • Everything after -- is passed as-is as the server startup command.

  • To make it read-only, add --env SQLITE_READONLY=1:

    claude mcp add --transport stdio --env SQLITE_READONLY=1 sqlite -- node /絶対パス/index.js main=/絶対パス/main.db
  • The default is local scope (only your current project). Use --scope user to use it across all projects, or --scope project to share it as .mcp.json with your team.

    claude mcp add --transport stdio --scope user sqlite -- node /絶対パス/index.js main=/絶対パス/main.db

Checking and deleting registered entries:

claude mcp list
claude mcp remove sqlite

When you open the Claude Code panel in VS Code (or start a claude session), tools such as list_databases and read_query become available.

Notes

  • For write_query, we recommend using ? placeholders as a measure against SQL injection (the params argument).

  • Table names are validated to allow only alphanumeric characters and underscores.

  • Alias names can only contain alphanumeric characters, underscores, and hyphens.

  • Connections to each database are opened on first access and reused thereafter. All are closed when the server terminates.

  • No databases other than the aliases registered at startup can be accessed (no arbitrary paths are accepted).

  • If connecting to a production database, consider starting with SQLITE_READONLY=1.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    C
    maintenance
    Exposes sqlite3 database functionality as MCP tools, enabling SQL query execution, schema management, and CRUD operations.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides comprehensive SQLite database interaction through MCP, enabling CRUD operations, custom SQL queries, and database exploration.
    497
    126
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage and query SQLite databases through MCP tools, supporting CRUD operations, schema management, and saved views.
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…

  • GibsonAI MCP server: manage your databases with natural language

  • MCP server for managing Prisma Postgres.

View all MCP Connectors

Latest Blog Posts

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/nao9net/mcp-sqlite'

If you have feedback or need assistance with the MCP directory API, please join our Discord server