sqlite
SQLiteデータベースをMCP (Model Context Protocol) 経由で操作できるサーバーです。 起動時に複数のDBを「エイリアス=パス」の形で登録しておき、ツール呼び出し時にはエイリアス名で DBを選択します。実行時に任意のファイルパスを受け付けないため安全です。
機能(ツール)
list_databases— 登録されているDBのエイリアス一覧を表示list_tables— 指定DB内の全テーブル名を一覧表示describe_table— 指定テーブルのスキーマ(カラム/型/外部キー/インデックス)を取得read_query— SELECT / WITH / PRAGMA を実行(読み取り専用)write_query— INSERT / UPDATE / DELETE / DDL を実行(データ変更)
list_tables/describe_table/read_query/write_query は任意の database 引数(エイリアス名)を
受け付けます。登録DBが1つだけの場合は省略可能(自動的にそれがデフォルトになります)。
2つ以上登録している場合は毎回 database の指定が必須です。
Related MCP server: MCP SQLite Server
セットアップ
npm install起動
エイリアス=パス の形式で、1つ以上のDBを指定して起動します。
node index.js main=/path/to/main.db logs=/path/to/logs.db1つだけ登録する場合(この場合は database 引数を省略できます):
node index.js main=/path/to/main.db環境変数
変数名 | 説明 |
| すべての接続を読み取り専用で開く( |
使用例
// 登録済み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" } }MCPクライアントへの登録
Claude Desktop
claude_desktop_config.json に以下を追加します(パスは環境に合わせて絶対パスで指定):
{
"mcpServers": {
"sqlite": {
"command": "node",
"args": [
"/絶対パス/sqlite-mcp-server/index.js",
"main=/絶対パス/main.db",
"logs=/絶対パス/logs.db"
]
}
}
}設定後、Claude Desktopを再起動すると sqlite サーバーのツールが利用可能になります。
Claude Code(CLI / VS Code拡張)
VS Code内のターミナル、または通常のターミナルから claude コマンドで登録します。
claude mcp add --transport stdio sqlite -- node /絶対パス/sqlite-mcp-server/index.js main=/絶対パス/main.db logs=/絶対パス/logs.db--の後ろがそのままサーバー起動コマンドとして渡されます。読み取り専用にしたい場合は
--env SQLITE_READONLY=1を追加します:claude mcp add --transport stdio --env SQLITE_READONLY=1 sqlite -- node /絶対パス/index.js main=/絶対パス/main.dbデフォルトはローカルスコープ(自分の現在のプロジェクトのみ)。全プロジェクトで使うには
--scope user、チームで.mcp.jsonとして共有するには--scope projectを付けます。claude mcp add --transport stdio --scope user sqlite -- node /絶対パス/index.js main=/絶対パス/main.db
登録内容の確認・削除:
claude mcp list
claude mcp remove sqliteVS CodeでClaude Codeパネルを開く(またはclaudeセッションを開始する)と、list_databasesやread_queryなどのツールが利用可能になります。
注意事項
write_queryはSQLインジェクション対策として?プレースホルダの利用を推奨します(params引数)。テーブル名は英数字とアンダースコアのみを許可するようにバリデーションしています。
エイリアス名は英数字・アンダースコア・ハイフンのみ使用できます。
各DBへの接続は初回アクセス時に開かれ、以降は使い回されます。サーバー終了時にすべてクローズされます。
起動時に登録したエイリアス以外のDBには一切アクセスできません(任意パスの受け付けなし)。
本番データベースに接続する場合は
SQLITE_READONLY=1での起動を検討してください。
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 Servers
- AlicenseNot gradedqualityCmaintenanceExposes sqlite3 database functionality as MCP tools, enabling SQL query execution, schema management, and CRUD operations.1MIT
- AlicenseNot gradedqualityCmaintenanceProvides comprehensive SQLite database interaction through MCP, enabling CRUD operations, custom SQL queries, and database exploration.497126MIT
- AlicenseAqualityCmaintenanceRead-only SQLite database explorer for MCP clients. Allows discovery of tables and columns via resources and running SELECT queries via a tool.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage and query SQLite databases through MCP tools, supporting CRUD operations, schema management, and saved views.4MIT
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.
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/nao9net/mcp-sqlite'
If you have feedback or need assistance with the MCP directory API, please join our Discord server