MCP Configs2026年4月8日·1 分钟阅读

Sqlite MCP — Local Database for AI Agents

Official MCP server for SQLite databases. Let Claude Code query, analyze, and modify local SQLite databases through natural language. Zero-config, instant setup.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
Sqlite MCP — Local Database for AI Agents
安全暂存命令
npx -y tokrepo@latest install f67139b3-1666-4c8a-93d9-29c9c29e6ab2 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
SQLite MCP gives AI agents direct access to query and modify local SQLite databases through the Model Context Protocol.
§01

What it is

SQLite MCP is the official Model Context Protocol server for SQLite databases. It gives AI agents like Claude Code the ability to query, analyze, and modify SQLite databases through natural language. The server exposes database operations as MCP tools, so the agent can run SQL queries, inspect schemas, and write data without you writing any code.

This server is for developers who use SQLite as a local database and want their AI coding assistant to interact with it directly. It is particularly useful for data exploration, quick analysis, and prototyping database-backed features.

§02

How it saves time or tokens

Without the MCP server, you would need to write SQL queries manually, copy results into your conversation, and iterate. With SQLite MCP, the agent reads the schema, writes queries, executes them, and interprets results in one step. This workflow provides the MCP configuration JSON that you paste into your project config file.

§03

How to use

  1. Add the SQLite MCP server to your .mcp.json:
{
  "mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "./data/app.db"]
    }
  }
}
  1. Restart Claude Code or your MCP-compatible client.
  1. Ask the agent to interact with your database:
'Show me the schema of the users table'
'Find the top 10 orders by total amount'
'Create a new table for tracking events'
§04

Example

{
  "mcpServers": {
    "sqlite": {
      "command": "uvx",
      "args": [
        "mcp-server-sqlite",
        "--db-path", "./analytics.db"
      ]
    }
  }
}

Once configured, the agent can run queries like:

SELECT date, COUNT(*) as visits, AVG(duration) as avg_duration
FROM page_views
WHERE date >= date('now', '-7 days')
GROUP BY date
ORDER BY date;
§05

Related on TokRepo

§06

Common pitfalls

  • The database file path must be accessible from the directory where the MCP server runs. Relative paths are resolved from the project root.
  • SQLite MCP gives the agent write access by default. For read-only exploration, add --read-only to the args array to prevent accidental modifications.
  • Large databases with millions of rows can cause slow query responses. The agent should use LIMIT clauses for initial exploration.

常见问题

What is the SQLite MCP server?+

It is an official Model Context Protocol server that exposes SQLite database operations as tools. AI agents can query schemas, run SQL, and modify data through the MCP interface without you writing code.

Do I need to install SQLite separately?+

No. The MCP server includes SQLite bindings. You only need uvx (the Python package runner) installed. The server handles database connections internally.

Can the agent modify my database?+

Yes, by default the server has read-write access. To prevent modifications, add the --read-only flag to the args array in your MCP configuration. This restricts the agent to SELECT queries only.

Does this work with any AI agent or just Claude?+

It works with any MCP-compatible client. Claude Code, Cursor, and other tools that implement the Model Context Protocol can use this server. The MCP standard ensures interoperability.

Can I connect to multiple SQLite databases?+

Yes. Add multiple entries in your mcpServers configuration with different names and database paths. Each entry creates an independent server instance connected to its own database file.

引用来源 (3)
🙏

来源与感谢

modelcontextprotocol/servers — official MCP server, MIT

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产