home / mcp / mcp database server
Provides a local MCP server to interact with a SQLite database, enabling SQL queries, CSV imports, and table schemas.
Configuration
View docs{
"mcpServers": {
"jakubbuskiewicz-mcp-test": {
"command": "node",
"args": [
"/path/to/mcp-test/dist/index.js"
],
"env": {
"DB_PATH": "REQUIRED: path to the SQLite database file"
}
}
}
}You run a lightweight MCP server that interfaces with a SQLite database, exposing practical tools to query data, import CSV files, and inspect table schemas. It’s designed to be embedded in client workflows so you can perform common data operations quickly from your app or desktop client.
Install and build the server, then connect your client to the local process. The server exposes tools you can call from an MCP client to run SQL, import CSV data, and list table schemas. For local development, you typically run the server as a stdio process and configure your client to start it with the appropriate command and environment.
To run locally and connect from a client, start by building the project and then launching the server as a local process. The client will communicate with the server using standard MCP calls for the available tools.
{
"mcpServers": {
"database": {
"command": "node",
"args": ["/path/to/mcp-test/dist/index.js"],
"env": {
"DB_PATH": "/path/to/your/database.db"
}
}
}
}Use the following tool interfaces to interact with the database through the MCP server.
{
"query_database": {
"query": "SELECT * FROM users WHERE id = ?",
"params": ["1"]
}
}{
"import_csv": {
"file_path": "/path/to/data.csv",
"table_name": "my_table",
"delimiter": ","
}
}{
"list_tables": {}
}The server uses an environment variable to locate the SQLite database file.
Execute SQL queries on the database. Use a prepared statement style with parameters to safely pass values.
Import a CSV file into a database table by providing the file path, target table name, and delimiter.
List all tables in the database along with their schemas.