- Home
- MCP servers
- DB MCP (HR CSV → SQLite)
DB MCP (HR CSV → SQLite)
- python
0
GitHub Stars
python
Language
4 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": {
"daviddata-cloud-mcp_db": {
"command": "python",
"args": [
"db_mcp_server.py"
],
"env": {
"HR_CSV_PATH": "path to HR CSV file (optional)"
}
}
}
}You can run a self-contained MCP server that loads a CSV of HR data, imports it into an in-memory SQLite database, and exposes read-only MCP tools over stdio. This enables you to perform metadata retrieval, schema inspection, and safe read-only queries against the data entirely from your command line or testing client.
How to use
You will start the server with Python and a script that reads your HR data from a CSV file. The server exposes a small set of read-only MCP tools over standard input and output, allowing you to retrieve metadata, view the database schema, run safe SELECT/WITH queries, and search for employees using structured filters. To test locally, run the provided client script that communicates via MCP over stdio.
How to install
Prerequisites: Python 3.8 or newer must be installed on your system.
Install Python dependencies if needed. In this case, the server relies on the standard Python library, so no external packages are required.
Run the server using the included script. If you have your own HR CSV path, provide it as an argument or set an environment variable.
python db_mcp_server.py
python db_mcp_server.py /path/to/your/hr_people.csv
HR_CSV_PATH=/path/to/your/hr_people.csv python db_mcp_server.py
Notes for running and testing
The server writes JSON-RPC responses to stdout and sends logs to stderr. It loads the HR CSV file, reads the first three metadata lines beginning with #, imports the data into an in-memory SQLite database, and exposes four MCP tools.
Additional content
Environment variable to specify the CSV path: HR_CSV_PATH. If this variable is set, it will override the default path when starting the server.
Test using the included client script to ensure the server is Ready and to exercise the exposed tools. The client performs an initialize handshake, lists tools, runs a sample query, and then allows interactive SELECT queries against the in-memory database.
Tools exposed
hr_metadata returns the 3-line metadata header read from the HR CSV file.
hr_schema returns the SQLite schema information for the employees table.
hr_query runs a read-only SQL query against the in-memory database; use SELECT and WITH statements only.
hr_find_people provides structured, filter-based search without writing SQL.
Available tools
hr_metadata
Return the 3-line metadata header read from the HR CSV file.
hr_schema
Return SQLite schema information for the employees table.
hr_query
Execute a read-only SQL query (SELECT/WITH only) against the in-memory SQLite database.
hr_find_people
Find employees by common HR filters without writing SQL.