SuperAPIAI Directory

mcp-sqlite

github.com · AI developer platforms

mcp-sqlite is an MCP server for SQLite database files, designed to let AI agents securely access local data without connecting to external systems. It provides three core tools: sqlite_get_catalog retrieves the structure of all tables and columns at once, and supports supplementing table and column descriptions via YAML or JSON metadata files; sqlite_execute allows agents to execute arbitrary SQL queries, with results returned as HTML tables; canned queries in the metadata are each converted into separate MCP tools, making it easy for agents to run predefined queries without writing SQL. The tool is compatible with the Datasette metadata format, and human users can also interactively explore the same database via Datasette or MCP Inspector. The project provides a VS Code quick start example using the Titanic sample database and metadata file. Note: hidden tables are only removed from the catalog; agents can still access them, so this should not be relied upon as a security feature.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

mcp-sqlite is an MCP (Model Context Protocol) server for providing AI agents with useful data from SQLite database files while avoiding granting agents permission to access external systems. Its metadata format is compatible with Datasette, making it easy for human users to explore data in the same way.

Purpose:

  • Let AI agents execute queries and obtain structure information on local SQLite databases.
  • Add descriptions to tables and columns via metadata files to improve agents' understanding of the data.
  • Predefine common queries as separate tools to reduce the burden of agents writing SQL.

Main capabilities:

  • sqlite_get_catalog(): Agents can call this tool to obtain the complete catalog of databases, tables, and columns, merged with descriptions from metadata files. In earlier versions the catalog was a resource, but it was changed to a tool because resource support was not widespread.
  • sqlite_execute(sql): Agents can call this tool to execute arbitrary SQL queries, with table results returned in HTML format (according to the materials, HTML is a better format for LLM processing).
  • Canned query tools: Each canned query in the metadata file is converted into a separate MCP tool, named sqlite_execute_main_{tool name} (in the materials, the example my_canned_query becomes the tool my_canned_query), and agents can call them directly without writing SQL.
  • Metadata support: A simple YAML or JSON metadata file can be used to add descriptions to tables and columns and to define canned queries.

Usage:

  • Quick start (Visual Studio Code): Install VS Code and enable GitHub Copilot; open the repository in VS Code; open the GitHub Copilot agent mode chat; check available tools, and you should see MCP Server: sqlite_sample and three available tools; you can ask Copilot questions such as "Get Titanic survivors of age 28" and get a response. The sample MCP configuration file mcp.json and sample metadata file titanic.yml can be used as a starting point for custom configuration.
  • Interactive exploration: Use MCP InspThe ector dashboard interacts with the SQLite database in the same way as the AI agent, running the command: npx @modelcontextprotocol/inspector uvx mcp-sqlite sample/titanic.db --metadata sample/titanic.yml. Because the metadata is Datasette-compatible, Datasette can also be used to explore the data.

Use cases:

  • Scenarios where an AI agent needs to query local SQLite data without exposing external systems.
  • Developers who want to provide agents with a structured data catalog and predefined queries.
  • Teams that need to support both AI agents and human users exploring the same local data.

Limitations and caveats:

  • Setting hidden: true in the metadata hides a table from the catalog returned by sqlite_get_catalog(), but the table can still be accessed by the AI agent, so hidden tables must never be treated as a security feature.
  • The preset query feature is still under active development, with more features planned.
  • The material does not provide specific information such as fees, pricing, or platform support scope.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools