Get the FREE Ultimate OpenClaw Setup Guide →

Text2Sql.Net

Text2Sql.Net 是一个使用DotNet和Semantic Kernel开发的Text2Sql工具

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio shuyu-labs-text2sql.net docker run -i text2sqlnet:latest \
  --env ASPNETCORE_URLS="http://0.0.0.0:5000" \
  --env TEXT2SQL_CONFIG_PATH="/app/config/text2sql.json"

How to use

Text2Sql.Net is a .NET-based MCP server that exposes natural language to SQL generation capabilities alongside schema exploration, execution, and chat history features. It integrates with MCP-enabled IDEs (such as Cursor or Trae) to allow you to retrieve database connections, inspect schema, generate SQL from natural language, and execute SQL directly from your development environment. The server also supports vector-based context for enhanced accuracy and a QA example system to improve SQL generation over time. You can access standard MCP endpoints such as get_database_connections, get_database_schema, generate_sql, execute_sql, get_chat_history, get_table_structure, and get_all_tables to perform end-to-end data querying and exploration from within your IDE.

How to install

Prerequisites:

  • Docker and Docker Compose installed on your machine
  • Internet access to pull the Text2Sql.Net docker image (or build the image locally if provided)

Install steps:

  1. Pull and run the MCP-enabled Text2Sql.Net image (example):

    docker pull text2sqlnet/text2sqlnet:latest docker run -d --name text2sqlnet -p 5000:5000 text2sqlnet/text2sqlnet:latest

  2. If you want to configure a specific config file, mount it into the container:

    docker run -d --name text2sqlnet -p 5000:5000 -v /path/to/config:/app/config text2sqlnet/text2sqlnet:latest

  3. Validate the MCP endpoints are reachable (default port 5000):

    curl http://localhost:5000/mcp/sse?connectionId=xxxxxx

  4. Alternative: if you prefer running from source (requires .NET tooling and building the app):

    git clone <repository-url> cd Text2Sql.Net dotnet restore dotnet run --project Text2Sql.Net.Server.csproj --urls http://0.0.0.0:5000

  5. Ensure environment variables are set as needed (see additional notes) and that your IDE can connect to the MCP SSE endpoint.

Additional notes

Notes and tips:

  • The MCP endpoints are designed for IDE integrations. Use get_database_connections to fetch available connections, get_database_schema or get_all_tables for schema exploration, and generate_sql to produce SQL from natural language queries.
  • To execute SQL directly from the MCP server, use execute_sql. When testing locally, ensure your database drivers and network rules permit connections from the container or runtime environment.
  • If you use vector/context features, ensure your vector store is properly configured (e.g., SQLite or PostgreSQL with pgvector) according to your environment.
  • Common environment variables: ASPNETCORE_URLS (server URL), TEXT2SQL_CONFIG_PATH (path to your configuration), and database connection strings in the server config.
  • If you run into port conflicts, adjust the host port (default 5000) in the docker run command or in the application configuration.
  • For IDE integration, the Text2Sql.Net MCP description in your integration settings should match the provided mcpServers configuration (name, type, url).
  • If you encounter authentication or API key issues with OpenAI or embedding providers, ensure you have valid keys configured in the Text2SqlOpenAI and Text2SqlConnection sections of your configuration file.

Related MCP Servers

Sponsor this space

Reach thousands of developers