datasette-mcp
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@datasette-mcplist the databases available"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
datasette-mcp
Adds a /-/mcp MCP server to any Datasette instance
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-mcpRelated MCP server: paycoreDb
Usage
Start Datasette as normal, then configure an MCP client to connect to:
http://localhost:8001/-/mcpThe endpoint uses MCP Streamable HTTP and exposes three read-only tools by default:
list_databaseslists the databases available to the current Datasette actor.get_database_schemareturns the complete SQL schema for a database, including tables, indexes, views, and triggers.execute_sqlexecutes one read-only SQL statement and returns structured columns, rows, and a truncation indicator.
Datasette database visibility and execute-sql permissions are enforced for
every tool call. SQL uses the same validate_sql_select() and read-only
Database.execute() path as Datasette's custom SQL interface.
Registering additional MCP tools
Other Datasette plugins can add tools to this MCP server by implementing the
register_mcp_tools(datasette, mcp) plugin hook. The mcp argument is the
MCPServer for that Datasette instance, so implementations use the MCP Python
SDK's normal @mcp.tool() decorator:
from datasette import hookimpl
@hookimpl
def register_mcp_tools(datasette, mcp):
@mcp.tool()
async def database_count() -> int:
"""Return the number of user-facing databases."""
return len(
[name for name in datasette.databases if name != "_internal"]
)The hook itself is synchronous because tools are registered while the MCP server is being constructed. Tool functions can be synchronous or asynchronous and can use all of the input, output, context, and annotation features provided by the MCP Python SDK.
Datasette-mcp registers list_databases, get_database_schema, and
execute_sql through this same hook.
Development
To set up this plugin locally, first checkout the code. You can confirm it is available like this:
cd datasette-mcp
# Confirm the plugin is visible
uv run datasette pluginsTo run the tests:
uv run pytestThis 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.
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/datasette/datasette-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server