- Home
- MCP servers
- SQLite
SQLite
- python
9
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"prayanks-mcp-sqlite-server": {
"command": "python",
"args": [
"sqlite_mcp_server.py"
]
}
}
}You run a Python-based MCP server that connects to a SQLite database containing startup funding data. It exposes table schemas as resources, provides a read-only SQL query tool, and offers prompt templates to help language models analyze data. The server communicates over the STDIO protocol, reading JSON-RPC messages from standard input and returning responses to standard output, making it easy to integrate with MCP clients and LLMs while keeping data access simple and secure.
How to use
You interact with the MCP server through an MCP client. Start the server and then request table schemas or run read-only SQL queries. Access a full set of table schemas with schema://sqlite/all or retrieve a specific table’s schema with schema://sqlite/{table}. Execute queries using the sql_query tool, which only permits SELECT statements to ensure read-only data access. Use the provided prompt templates to guide language models in generating insights or explaining queries.
How to install
Prerequisites you need before installing: Python is required to run the MCP server. You may also install Python’s package manager tools as needed for environment setup.
Create a virtual environment to isolate dependencies:
python -m venv venv
Activate the virtual environment:
# macOS/Linux
source venv/bin/activate
# Windows
venv\Scripts\activate
Install the MCP CLI extras for Python tooling:
pip install "mcp[cli]"
Prepare your sample database and server script. Ensure the SQLite database file is created and accessible to your server code. You will run the server file next.
Run the MCP server locally using Python:
python sqlite_mcp_server.py
For a development workflow using an executor, you can also run the server with the UV-based runner (if you prefer):
uv run sqlite_mcp_server.py
Configuration and runtime commands
Two MCP runtime configurations are commonly used from the local setup shown above. The HTTP approach is not required for local testing, but you can run the STDIO-based server directly as shown.
Additional setup for Claude Desktop integration
If you plan to integrate with Claude Desktop, save the following as a helper script and run it to register your server.
# Example content and usage depend on your environment. Replace placeholders with actual paths.
python install_to_claude.py
Update the Claude Desktop configuration with a simple JSON snippet that points to your local server script:
{
"mcpServers": {
"sqlite_mcp_server": {
"command": "python",
"args": ["-u", "/absolute/path/to/sqlite_mcp_server.py"]
}
}
}
Notes and troubleshooting
-
Ensure the SQLite database is created and accessible before starting the server. Verify the database file path used by your script matches where the file actually resides.
-
The built-in resources expose table schemas and a read-only SQL query tool. Only SELECT queries are allowed through the query tool to maintain data integrity.
-
Logging uses Python’s logging module. You can adjust the logging configuration to aid debugging or to capture activity in a file.
Testing
You can validate the server locally by running a test script that exercises listing resources, retrieving schemas, and executing valid or invalid queries along with prompt templates validation.
Available tools
schema_all
Expose all table schemas via schema://sqlite/all as a JSON mapping.
schema_table
Expose a specific table schema via schema://sqlite/{table}.
sql_query
Run read-only SQL queries using the sql_query tool; only SELECT statements are permitted.
analyze_table_prompt
Provide a prompt template to guide language models in generating analyses for a specific table.
describe_query_prompt
Provide a prompt template to explain or justify a given SQL query.