About USQLMCP
USQLMCP is a universal SQL MCP server for applications that need database access. It lets MCP clients query and modify data, create tables, and inspect table schemas.
Key features
- 01Run SELECT queries
- 02Run INSERT, UPDATE, DELETE, and ALTER queries
- 03Create database tables
- 04Retrieve table schemas as JSON
- 05Expose schemas as MCP resources
Use cases
- 01Read database records through an MCP client
- 02Modify rows and check affected-row counts
- 03Create tables and inspect their column types
MCP support
USQLMCP exposes SQL operations as MCP tools and table schemas as resources. MCP clients can connect using stdio.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEusqlmcp
A universal SQL MCP (Model Context Protocol).
Features
-
Tools
read_query: Execute aSELECTquery and return the results.write_query: Execute anINSERT,UPDATE,DELETE, orALTERquery and return the number of affected rows.create_table: Execute aCREATE TABLEquery to define new tables in the database.describe_table_schema: Get the JSON schema for a given table, including column names and data types, for all supported databases.
-
Resources
usqlmcp://<table>/schema: Access table schema as JSON resource for any table in the database.- Individual table schema resources are automatically discovered and registered for each table.
Installing
usqlmcp is available via Release
Installing via Release
- Download a release for your platform
- Extract the
usqlmcporusqlcmp.exefile from the.tar.bz2or.zipfile - Move the extracted executable to somewhere on your
$PATH(Linux/macOS) or%PATH%(Windows)
Setup
MCP Integration in Cursor
Add the following configuration to your ~/.cursor/mcp.json file or configure via the settings menu in Cursor.
{
"mcpServers": {
"usqlmcp": {
"command": "usqlmcp",
"args": ["--dsn", "sqlite3:///your/db/dsn/file.db"]
}
}
}
Other tools
{
"servers": {
"usqlmcp": {
"type": "stdio",
"command": "usqlmcp",
"args": ["--dsn", "sqlite3:///your/db/dsn/file.db"]
}
}
}
Docker Usage
You can configure usqlmcp to run via Docker in Cursor by specifying the appropriate command and arguments in your MCP JSON configuration.
Example: Postgres (Docker)
Add the following to your ~/.cursor/mcp.json:
{
"mcpServers": {
"usqlmcp": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"ghcr.io/thesoulless/usqlmcp:latest",
"--dsn", "postgres://username:[email protected]:5432/dbname?sslmode=disable"
]
}
}
}
Note: When connecting to a database on your host machine, use host.docker.internal instead of localhost or 127.0.0.1.
Example: SQLite with Volume Mounting (Docker)
To use a SQLite database file from your local machine, add the following to your ~/.cursor/mcp.json:
{
"mcpServers": {
"usqlmcp": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/path/to/local/mydatabase.db:/data/mydatabase.db",
"ghcr.io/thesoulless/usqlmcp:latest",
"--dsn", "sqlite3:///data/mydatabase.db"
]
}
}
}
This mounts your local SQLite database file directly into the container, providing access to only what's needed.
Acknowledgments
This project depends on usql, a universal command-line interface for SQL databases.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.