Provides read-only access to Datasette instances hosted on Heroku, allowing SQL query execution, full-text search, and schema exploration of Heroku-hosted databases.
Connects to Datasette instances built with Python, enabling AI assistants to explore databases, execute SQL queries, and perform full-text searches against Python-based Datasette deployments.
Supports YAML-formatted configuration files for defining multiple Datasette instances, their connection details, and global server settings.
Datasette MCP
A Model Context Protocol (MCP) server that provides read-only access to Datasette instances. This server enables AI assistants to explore, query, and analyze data from Datasette databases through a standardized interface.
Features
- SQL Query Execution: Run custom SQL queries against Datasette databases
- Full-Text Search: Search within tables using Datasette's FTS capabilities
- Schema Exploration: List databases, tables, and inspect table schemas
- Multiple Instances: Connect to multiple Datasette instances simultaneously
- Authentication: Support for Bearer token authentication
- Request Throttling: Configurable courtesy delays between requests
- Multiple Transports: stdio, HTTP, and Server-Sent Events support
Installation
Prerequisites
- Python 3.10+
- uv package manager
Install as a tool
Development installation
Configuration
The server supports two configuration methods:
1. Configuration File
Create a YAML or JSON configuration file with your Datasette instances:
The server automatically searches for config files in:
$DATASETTE_MCP_CONFIG
environment variable~/.config/datasette-mcp/config.{yaml,yml,json}
/etc/datasette-mcp/config.{yaml,yml,json}
2. Command Line (Single Instance)
For quick single-instance setup:
Usage
Basic Startup
Transport Options
Development Usage
When developing or testing:
All CLI Options
Claude Code Integration
To use this MCP server with Claude Code:
1. Install the server
2. Add to Claude Code
Or with a configuration file:
3. Use with scopes (optional)
Once added, Claude Code will have access to explore and query your Datasette instances directly within conversations.
Available Tools
The server provides these MCP tools for AI assistants:
list_instances()
List all configured Datasette instances and their details.
list_databases(instance)
List all databases in a Datasette instance with table counts.
describe_database(instance, database)
Get complete database schema including all table structures, columns, types, and relationships in one efficient call.
execute_sql(instance, database, sql, ...)
Execute custom SQL queries with options for:
shape
: Response format ("objects", "arrays", "array")json_columns
: Parse specific columns as JSONtrace
: Include performance trace informationtimelimit
: Query timeout in millisecondssize
: Maximum number of results per pagenext_token
: Pagination token for getting next page
search_table(instance, database, table, search_term, ...)
Perform full-text search within a table with options for:
search_column
: Search only in specific columncolumns
: Return only specific columns to reduce tokensraw_mode
: Enable advanced FTS operators (AND, OR, NOT)size
: Maximum number of results per pagenext_token
: Pagination token for getting next page
Usage Examples
Exploring Data Structure
Querying Data
Advanced Queries
Security Considerations
- The server provides read-only access to Datasette instances
- Authentication tokens are passed as Bearer tokens to Datasette
- No write operations are supported
- SQL queries are subject to Datasette's built-in security restrictions
- Request throttling helps prevent overwhelming target servers
Error Handling
The server provides detailed error messages for:
- Invalid SQL queries
- Missing or inaccessible databases/tables
- Authentication failures
- Network timeouts
- Configuration errors
Logging
Configure logging levels for debugging:
Log levels: DEBUG
, INFO
, WARNING
, ERROR
Tool Management
Contributing
This server is built with FastMCP, making it easy to extend with additional tools and functionality. The codebase follows MCP best practices for server development.
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Related Projects
- Datasette - Data exploration tool
- FastMCP - Python MCP framework
- Model Context Protocol - Standard for AI tool integration
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that provides read-only access to Datasette instances, enabling AI assistants to explore, query, and analyze data from Datasette databases through a standardized interface.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables Claude and other AI assistants to access and update Kintone data through natural language commands, supporting operations like record management, file handling, app administration, and space collaboration.Last updated -256JavaScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.Last updated -6TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to securely interact with Apache IoTDB databases through a controlled interface for listing tables, reading data, and executing SQL queries.Last updated -Python
- -securityAlicense-qualityA Model Context Protocol (MCP) server that provides read-only TDengine database queries for AI assistants, allowing users to execute queries, explore database structures, and investigate data directly from AI-powered tools.Last updated -4PythonMIT License