SQLite

by panasenco

Not rated
GitHub

About

MCP server for SQLite files. Supports Datasette-compatible metadata!

Details

Author
panasenco
Categories
Database, Community, Other

Setup

Install SQLite in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/panasenco/mcp-sqlite

Follow the installation instructions in the repository README, then restart your MCP client.

Provide useful data to AI agents without giving them access to external systems. Compatible with Datasette for human users!

- AI agents can get the structure of all tables and columns in the SQLite database in one command -sqlite_get_catalog.

- The catalog can be enriched with descriptions for the tables and columns using a simple YAML or JSON metadata file.

InstallVisual Studio Codeif you don't already have it. Turn on GitHub Copilot.

Open this repo in VS Code. Open a GitHub Copilot agent mode chat. Check the available tools - you should see MCP Server: sqlite_sample with three available tools.

You should be able to ask Copilot in agent mode a question like "Get Titanic survivors of age 28" and get a response.

Use the sample MCP configuration filemcp.jsonand the sample metadata filetitanic.ymlas a starting point for your own configuration.

Interactive exploration with MCP Inspector and Datasette

The same database and metadata files can be used to explore the data interactively with MCP Inspector and Datasette.

Use theMCP Inspectordashboard to interact with the SQLite database the same way that an AI agent would:
- Install
npm.
- Run:

npx @modelcontextprotocol/inspector uvx mcp-sqlite sample/titanic.db --metadata sample/titanic.yml

Sincemcp-sqlitemetadata is compatible with the Datasette metadata file, you can also explore your data with Datasette:

uvx datasette serve sample/titanic.db --metadata sample/titanic.yml

Compatibility with Datasette allows both AI agents and humans to easily explore the same local data!

- sqlite_get_catalog(): Tool the agent can call to get the complete catalog of the databases, tables, and columns in the data, combined with metadata from the metadata file. In an earlier iteration ofmcp-sqlite, this was a resource instead of a tool, but resources are not as widely supported, so it got turned into a tool. If you have a usecase for the catalog as a resource, open an issue and we'll bring it back!
- sqlite_execute(sql): Tool the agent can call to execute arbitrary SQL. The table results are returned as HTML. For more information about why HTML is the best format for LLMs to process, see
Siu et al.
- {canned query name}({canned query args}): A tool is created for each canned query in the metadata, allowing the agent to run predefined queries without writing any SQL.

usage: mcp-sqlite [-h] [-m METADATA] [-p PREFIX] [-v] sqlite_file CLI command to start an MCP server for interacting with SQLite data. positional arguments: sqlite_file Path to SQLite file to serve the MCP server for. options: -h, --help show this help message and exit -m, --metadata METADATA Path to Datasette-compatible metadata YAML or JSON file. -p, --prefix PREFIX Prefix for MCP tools. Defaults to no prefix. -v, --verbose Be verbose. Include once for INFO output, twice for DEBUG output.

Hiding a tablewithhidden: truewill hide it from the catalog returned by the MCP toolsqlite_get_catalog(). However, note that the table will still be accessible by the AI agent! Never rely on hiding a table from the catalog as a security feature.

Canned queriesare each turned into a separate callable MCP tool by mcp-sqlite.

For example, a query namedmy_canned_querywill become a toolmy_canned_query.

The canned queries functionality is still in active development with more features planned for development soon:

Read and write access to Airtable databases.

BigQuery database integration with schema inspection and query capabilities

Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities

A MCP server that provides real-time cryptocurrency market data through CoinCap's public API without requiring authentication

Universal database MCP server supporting multiple database types including PostgreSQL, Redshift, CockroachDB, MySQL, RDS MySQL, Microsoft SQL Server, BigQuery, Oracle DB, and SQLite

MCP server for autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort.

Universal database MCP server supporting mainstream databases.

MCP server for dbt-core (OSS) users as the official dbt MCP only supports dbt Cloud. Supports project metadata, model and column-level lineage and dbt documentation.

Leverages your Schemas and Access Patterns to interact with your DynamoDB Database using natural language.

MCP server acting as an interface to the Frankfurter API for currency exchange data.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.