
LINQ to DB MCP Server: Setup for Claude, Cursor and Other Apps
Lets your assistant look at your database structure and run read-only SQL on many database types through LINQ to DB.
This server is the mcp command of the LINQ to DB command-line tool, made by the linq2db project. It runs on your computer and reads database logins from a local config file, so no connection string goes into your app settings.
The default tools only read. A write tool exists but stays off unless you turn it on twice, at startup and in the config profile.
Good for
- .NET developers who already use LINQ to DB
- Developers who work with several database types
- Teams who want read-only database access for an assistant
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install LINQ to DB MCP
Claude Code
- 1
Copy this prompt.
Add the LINQ to DB MCP server to Claude Code. Run this command: claude mcp add --transport stdio linq2db -- dnx linq2db.cli --yes -- mcp --config /absolute/path/to/query.json Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires .NET 10 SDK, A linq2db query/MCP config file with a database profile.
Read-only mode: Leave out --enable-execute-tool, which is off by default. The query tool rejects SQL it cannot classify as read-only.
Needs the .NET 10 SDK, which provides the dnx command. First create the config file with dotnet linq2db config-init (see the readme page), because the server will not start without a path to it. Replace /absolute/path/to/query.json with that file. It can hold several database profiles, and the optional --profile picks a default. Do not put connection strings in your app config. The write tool is off unless you also add --enable-execute-tool and set enableExecute in the profile.
Built from the package data we hold. Not yet tested by us.
Tools
Shows which database profiles are set up
Returns the non-secret settings of your config file: profiles, database providers, SQL dialects, row limits and whether writing is allowed. It never returns connection strings or passwords.
Try: “Which database profiles are available?”
Read ·
linq2db_infoLists tables, views and columns
Reads the structure of your database, with filters by schema, catalog or table name and a short names-only mode for large databases.
Try: “What tables does the sales database have?”
Network ·
linq2db_schemaRuns a read-only SQL query
Runs one SQL statement against a configured profile. It rejects several statements and anything it cannot classify as read-only.
Try: “Show the 10 newest orders.”
Network ·
linq2db_queryReads the built-in usage guide
Returns the embedded guide on configuration, providers, SQL safety, output and timeouts. It does not touch a database.
Try: “Read the linq2db guide before you start.”
Read ·
linq2db_skill
Read from the source code
Permissions
low risk · 3 things to watch
Low risk
By default it can read your database structure and run read-only SQL. If you turn on the optional write tool, it can run one write statement at a time, so give the database user only the rights you want.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
Optional write tool can change data
The linq2db_execute tool exists only if you start the server with --enable-execute-tool and set enableExecute to true in the profile. It then runs one write statement at a time. Keep both off unless you need it. github.com
Read-only check is a classifier
The query tool rejects SQL it cannot classify as read-only, but a database user without write rights is the stronger protection. github.com
Credentials live in a config file
The config file holds database connection details. Keep it private and out of Git. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | The default. The write tool is only registered with --enable-execute-tool, and it also needs enableExecute set to true in the profile. |
|---|---|
| Talks to | Your database host |
| Sign-in and keys | Connection details sit in the local config file you create with config-init. |
| Scopes |
|
Questions
Is the LINQ to DB MCP server official?
Yes for LINQ to DB. The linq2db project ships it in its own repository as part of the linq2db.cli tool. It is not made by the database vendors.
Which databases does it support?
The ones LINQ to DB supports. Each profile in your config file picks a provider and SQL dialect.
Can it change my data?
Not by default. The write tool is off unless you start the server with --enable-execute-tool and set enableExecute in the profile.
What do I need before installing?
The .NET 10 SDK and a config file made with the config-init command. The server needs the path to that file.
Where do I put my database password?
In the local config file, not in your app settings. The info tool never returns it.
Is the tool list complete?
It lists the 4 tools registered by default. A fifth, linq2db_execute, only exists in write mode.
Information
updated Nov 2, 2026
- Publisher
- Official
- Transport
- stdio
- Auth
- None
- Version
- 6.5.1
- License
- MIT
- Last commit
- Oct 31, 2026
- Open issues
- 468
- Listed in
- Official MCP registry
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 4Hide
- McpQueryTool.cs · github.com
- readme.md · github.com
- MCP-REGISTRY.md · github.com
- McpExecuteTool.cs · github.com