SQL Data MCP Server
A custom MCP server that gives Claude Desktop direct access to a SQLite database, enabling natural language questions to be answered through real SQL execution.
README
SQL Data MCP Server
A custom Model Context Protocol (MCP) server that gives Claude Desktop direct access to a SQLite database — enabling natural language questions to be answered through real, live SQL execution.
What This Does
Instead of copy-pasting data into a chat, this server exposes a local SQLite database as a set of tools Claude can call directly. Ask a question in plain English, and Claude decides which tool to use, writes the SQL, executes it against the real database, and returns the results.
Tools Exposed
list_tables()— Lists all tables in the databasedescribe_table(table_name)— Shows column names and types for a given tablerun_query(sql)— Executes a read-only SELECT query and returns the results
Tech Stack
- Python with the official
mcpSDK (FastMCP) - SQLite for the local database
- Claude Desktop as the MCP Host
How It Works
Claude Desktop is configured (via claude_desktop_config.json) to launch this server as a subprocess. Each Python function decorated with @mcp.tool() is automatically exposed to Claude — the decorator reads the function's name, type hints, and docstring to build the tool schema, so no manual JSON schema writing is required.
When a user asks a question, Claude reasons about which tool to call, requests permission to run it, executes it, and uses the real result to answer — genuine tool use, not a simulated response.
Setup
- Clone this repo
- Install dependencies:
pip install -r requirements.txt - Build the database:
python create_db.py - Add this server to your
claude_desktop_config.json:
{
"mcpServers": {
"sql-data-server": {
"command": "/path/to/python.exe",
"args": ["/path/to/server.py"]
}
}
}
- Fully restart Claude Desktop
- Ask Claude a question about your data — e.g. "What tables are available, and what's the average purchase amount by customer segment?"
Note on Paths
server.py computes the database path relative to its own file location (os.path.dirname(os.path.abspath(__file__))) rather than assuming a working directory — this ensures it works correctly regardless of what directory the MCP Host launches the process from.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.