Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
One-click editor setup isnโt available for this listing yet โ we donโt have a confirmed install command, and weโd rather show nothing than point your editor at the wrong package or host. Follow the projectโs own setup instructions, linked above.
LINQ to DB is the fastest LINQ database access library offering a simple, light, fast, and type-safe layer between your POCOs and your database.
Architecturally it is one step above micro-ORMs like Dapper, Massive, or PetaPoco, in that you work with LINQ expressions, not with magic strings, while maintaining a thin abstraction layer between your code and the database. Your queries are checked by the C# compiler and allow for easy refactoring.
However, it's not as heavy as LINQ to SQL or Entity Framework. There is no change-tracking, so you have to manage that yourself, but on the positive side you get more control and faster access to your data.
In other words LINQ to DB is type-safe SQL.
LINQ to DB also very nice for F# developers (see Tests/FSharp and Source/LinqToDB.FSharp project for details).
Development version nugets feeds (how to use)
See Github.io documentation for more details.
Code examples and demos can be found here or in tests.
Release notes page.
Notable open-source users:
Unmantained projects:
You can simply pass connection string into DataConnection or DataContext constructor using DataOptions class.
Minimal configuration example:
Use connection configuration action to setup SqlClient-specific authentication token:
[!TIP] There are a lot of configuration methods on
DataOptionsyou can use.
[!TIP] It is recommended to create configured
DataOptionsinstance once and use it everywhere. E.g. you can register it in your DI container.
In your web.config or app.config make sure you have a connection string (check this file for supported providers):
Alternatively, you can implement custom settings provider with ILinqToDBSettings interface, for example:
And later just set on program startup before the first query is done (Startup.cs for example):
See article.
You can generate POCO classes from your database using linq2db.cli dotnet tool.
Alternatively, you can write them manually and map to database using mapping attributes or fluent mapping configuration. Also you can use POCO classes as-is without additional mappings if they use same naming for classes and properties as table and column names in database.
This approach involves attributes on all properties that should be mapped. This way lets you to configure all possible things linq2db ever supports. There is one thing to mention: if you add at least one attribute into POCO, all other properties should also have attributes, otherwise they will be ignored:
This method lets you configure your mapping dynamically at runtime. Furthermore, it lets you to have several different configurations if you need so. You will get all configuration abilities available with attribute configuration. These two approaches are interchangeable in their abilities. This kind of configuration is done through the class MappingSchema.
With Fluent approach you can configure only things that require it explicitly. All other properties will be inferred by linq2db:
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/linq-to-db)<a href="https://allmcps.com/mcp/linq-to-db"><img src="https://allmcps.com/api/badge/linq-to-db?style=directory" alt="LINQ to DB on AllMCPs" /></a>