SuperAPIAI Directory

elekto-mcp-sql

github.com · Other AI tools

elekto-mcp-sql is a read-only MCP server for SQL Server 2017+ that provides database schema metadata, object definitions, and data query capabilities to MCP clients such as GitHub Copilot and Claude via the MCP protocol (stdio), enabling AI assistants to understand database structures while avoiding storing credentials in code repositories. It supports installation as a .NET global tool, can also run without installation via dnx, and offers configuration methods such as connection files, environment variable expansion, and zero-configuration auto-discovery.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

elekto-mcp-sql is a read-only MCP server for SQL Server 2017+, tested on SQL Server 2019 and 2022. It exposes database schema metadata, object definitions, and data queries via the MCP protocol (stdio), enabling MCP clients such as GitHub Copilot and Claude to understand database structures without storing credentials in repositories.

Purpose and main capabilities The server is used for schema introspection and data sampling of SQL Server, providing read-only access. The tools it exposes can return table structures, stored procedure definitions, and actual row data, among other things. The materials mention that get_database_overview is the recommended tool to call first, and check_permissions reports permission status per tool group as complete, partial, or unavailable, along with the missing permissions and their corresponding GRANT statements, and also reports write_access to confirm whether the account is truly read-only. query_table returns results with an envelope structure, including fields such as truncated; top_requested appears only when max_query_rows overrides the requested value. Column types report both the raw max_length (bytes) and type_declaration, max_length_chars, avoiding misreading the 500 bytes of nvarchar(250) as a character count; columns also carry extended_properties and is_persisted. Failures are returned as normal results with ok: false rather than throwing exceptions.

Usage Installation as a .NET global tool is recommended, requiring the .NET 10 Runtime or SDK; after installation, the elekto-mcp-sql command is on the PATH and can be used directly in .mcp.json. It can also be run without installation via dnx, provided by the .NET 10 SDK, downloading from NuGet. Connection configuration supports --connections to specify a file, .elekto.mcp.sql.local.json in the project root or user directory, and ConnectionStr in appsettings.json/web.config/App.configings auto-discovery, as well as MCP_SQL_CONNECTIONS environment variable fallback; multiple sources are merged, and databases with the same name are used according to priority. Connection strings support %{VARIABLE_NAME} environment variable expansion. When no connection is configured, the server still starts and explains the issue and where to look in tool results; after a connection file is created later, it will take effect on the next call without requiring a restart. The material also provides registration methods for Claude Code (claude mcp add), Codex (codex mcp add), and Visual Studio 2026 (.mcp.json).

Applicable scenarios Suitable for letting AI coding assistants understand SQL Server database structures, view object definitions, and sample data during development and exploration; especially suitable for development environments using anonymous or synthetic data.

Limitations and security warnings The material explicitly warns: data read by AI agents calling tools (which may include table schemas, stored procedure definitions, or row data) will be sent to LLM providers (Microsoft, Anthropic, OpenAI, etc.), and the data will leave the local machine. It is recommended not to connect to databases containing sensitive data, use a least-privilege read-only account, use max_query_rows to limit the number of rows returned per call, and prefer anonymous or synthetic data. Although the server is designed to be read-only and validates input, there remains a risk that AI agents may produce unintended consequences; the consequences of use are borne by the user, and the software is provided as-is without any warranty. In addition, SQL Server metadata visibility silently filters objects that the login is not authorized to access, so check_permissions is needed to determine whether the results are complete.

Other For version change records, see CHANGELOG.md and GitHub Release; 2.0.0 changed the tool return content and the way parameters are declared, but connection files, .mcp.json, and CLI parameters do not need to be reconfigured. A specific tool list, fees, and pricing information are not yet provided.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools