Elekto MCP for SQL Server
Read-only SQL Server schema inspection and querying for AI assistants
Elekto MCP for SQL Server is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- CLI, Self-hosted, Windows
- Runs
- Locally
- Version
- 2.3.5
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add elekto-mcp-sql -- dnx Elekto.Mcp.Sql --yesAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"elekto-mcp-sql": {
"command": "dnx",
"args": [
"Elekto.Mcp.Sql",
"--yes"
]
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"elekto-mcp-sql": {
"command": "dnx",
"args": [
"Elekto.Mcp.Sql",
"--yes"
]
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"elekto-mcp-sql": {
"command": "dnx",
"args": [
"Elekto.Mcp.Sql",
"--yes"
]
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"elekto-mcp-sql": {
"type": "stdio",
"command": "dnx",
"args": [
"Elekto.Mcp.Sql",
"--yes"
]
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add elekto-mcp-sql -- dnx Elekto.Mcp.Sql --yesOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.elekto-mcp-sql]
command = "dnx"
args = ["Elekto.Mcp.Sql", "--yes"]Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"elekto-mcp-sql": {
"command": "dnx",
"args": [
"Elekto.Mcp.Sql",
"--yes"
]
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Or run: gemini mcp add -s user elekto-mcp-sql dnx -- Elekto.Mcp.Sql --yes
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "elekto-mcp-sql": { "command": "dnx", "args": [ "Elekto.Mcp.Sql", "--yes" ] } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
About Elekto MCP for SQL Server
Mostly it answers "what is in this database" before it answers anything else. Twenty-one tools cover schemas, tables, views, procedures, functions, extended properties, dependency graphs, index health and column profiles, and a check_permissions tool tells the model what the login cannot see and which GRANT would fix it. Results the login can only partly see say so rather than passing a guess as fact.
Queries go through query_table, which supports filtering, grouping, aggregates, sorting, sampling and pagination, with a max_query_rows setting to cap what leaves the database. compare_schemas diffs two configured databases and generate_dependency_dot emits a Graphviz graph. It targets SQL Server 2017 and later, tested on 2019 and 2022, and ships as a .NET package on NuGet under GPL-3.0.
The README opens with a data warning: rows and definitions returned to the assistant are sent on to the LLM provider. It recommends minimum-privilege accounts, masked or synthetic data and says responsibility rests with the user.
Tools this server provides (21)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 19 of 21 tools read data; 2 names don't say.
From the server's own tool labels and tool names; not verified by us.
- list_databasesName suggests: reads
- Databases registered in the configuration.
- get_database_overviewName suggests: reads
- High-level summary of a database and whether the login sees everything.
- check_permissionsName suggests: reads
- Shows what the login can and cannot see and the GRANT that completes it.
- get_schema_summaryName suggests: reads
- Aggregated metrics by schema.
- list_schemasName suggests: reads
- Schemas in a database, excluding system schemas.
- list_tablesName suggests: reads
- User tables with dates, approximate rows and size.
- list_viewsName suggests: reads
- User views, filterable by schema and name.
- find_columnsName suggests: reads
- Tables and views holding a column matching a pattern.
- list_proceduresName suggests: reads
- User stored procedures with basic complexity metrics.
- list_functionsName suggests: reads
- User-defined functions with basic complexity metrics.
- get_table_schemaName suggests: reads
- Columns, keys, checks, uniques and indexes of a table.
- get_view_definitionName suggests: reads
- DDL and columns of a view.
- get_procedure_definitionName suggests: reads
- CREATE PROCEDURE text.
- get_function_definitionName suggests: reads
- CREATE FUNCTION text.
- get_dependency_graphName suggests: reads
- Object dependency edges from foreign keys and SQL dependencies.
- get_table_usageName suggests: reads
- References to a table across foreign keys and SQL modules.
- get_data_profileName suggests: reads
- Column profile with null ratio, distinct count, min, max and top values.
- get_index_healthName suggests: reads
- Duplicate and unused index diagnostics and missing-index suggestions.
- compare_schemas
- Compares table and column structure between two databases.
- generate_dependency_dot
- Graphviz DOT dependency graph.
- query_tableName suggests: reads
- SELECT with filtering, grouping, aggregates, sorting, sampling and pagination.
What it does
- Schema discovery
- List databases, schemas, tables, views, procedures and functions.
- Definitions and DDL
- Fetch view, procedure and function source and detailed table schemas.
- Dependency analysis
- Dependency edges, table usage and Graphviz DOT output.
- Data profiling
- Null ratio, distinct counts, min and max, and top values per column.
- Index health
- Duplicate and unused index diagnostics plus missing-index suggestions.
- Permission check
- Shows what the login cannot see and the GRANT that completes it.
- Capped queries
- query_table with a row limit and a truncated flag.
Good for
- Let an assistant learn an unfamiliar SQL Server schema
- Trace where a table is referenced across procedures and views
- Compare structure between two databases
- Review index problems on a database
Pricing
Open source
GPL-3.0 package on NuGet
Elekto MCP for SQL Server FAQ
Can Elekto MCP for SQL Server change data?
It is described as read-only and validates inputs, but the README warns there is always some risk and advises a read-only database account.
Which SQL Server versions work?
2017 and later; tested on 2019 and 2022.
Does my data leave my machine?
Results returned to the assistant go to the LLM provider's infrastructure, which the README flags as a privacy risk.
How can I limit returned data?
Use the max_query_rows setting and a least-privilege login.
Is Elekto MCP for SQL Server free?
Yes. Elekto MCP for SQL Server is open source, so you can use and self-host it for free.
How do I add Elekto MCP for SQL Server to Claude Code?
Run this command in your terminal: claude mcp add elekto-mcp-sql -- dnx Elekto.Mcp.Sql --yes
What are the best alternatives to Elekto MCP for SQL Server?
The closest alternatives to Elekto MCP for SQL Server are Midplane, Datatomcp, Gulliver, GaussDB Read-Only MCP and Zektor.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.