# LINQ to DB

An MCP server that gives your agent access to database schemas and SQL execution through LINQ to DB. Handy when you need to inspect tables or run a query without leaving the chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 3335
- Author: linq2db
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/linq2db/linq2db/tree/HEAD/source/linqtodb.cli
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/linq-to-db

## What it does

LINQ to DB is a C# database access library: a thin layer between your POCOs and the database, with queries written as LINQ expressions and checked by the compiler. The MCP server exposes that library to your agent so it can inspect schemas and run SQL across multiple database providers.

Inside is the same library you'd use in a normal project. Connections are described with `DataOptions`, and a connection string goes into the `DataConnection` or `DataContext` constructor. On .NET Framework you put it in `web.config` or `app.config`; there's also a custom settings provider via `ILinqToDBSettings`. The docs suggest building a configured `DataOptions` instance once and reusing it everywhere — registering it in your DI container, for example.

One thing to know: LINQ to DB has no change-tracking, so you manage that yourself. If your project already runs on Entity Framework, that's worth checking before you wire this up — there's a separate `linq2db.EntityFrameworkCore` package for EF projects.

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- inspect table structure and relations without opening a DB client
- run SQL against several database providers from one place
- compare the database schema against generated model code
- catch query errors at compile time instead of runtime
- configure a connection string once and reuse it in DI

## Example prompts
- Show me the schema of the Orders table and how it relates to Customers
- Run a query: how many orders came in last month
- Compare table structures across two databases and list the differences

## Similar
- [postgres-patterns](https://affpapa.org/en/nevibecode/skills/postgres-patterns.md) — skill · 5200 installs
- [mysql-patterns](https://affpapa.org/en/nevibecode/skills/mysql-patterns.md) — skill · 4700 installs
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 12927
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
