Skip to content
VS Code

text2sql for VS Code

io.github.cpenniman12/text2sql-mcp

Ask any SQL database in natural language. Agent explores schema, writes SQL, self-corrects.

client:VS Code transport:stdio runtime:pypi

Install text2sql in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "text2sql-database-url",
      "description": "TEXT2SQL_DATABASE_URL",
      "password": true
    },
    {
      "type": "promptString",
      "id": "anthropic-api-key",
      "description": "ANTHROPIC_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "openai-api-key",
      "description": "OPENAI_API_KEY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "text2sql-model",
      "description": "TEXT2SQL_MODEL",
      "password": true
    }
  ],
  "servers": {
    "text2sql-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "text2sql-mcp"
      ],
      "env": {
        "TEXT2SQL_DATABASE_URL": "${input:text2sql-database-url}",
        "ANTHROPIC_API_KEY": "${input:anthropic-api-key}",
        "OPENAI_API_KEY": "${input:openai-api-key}",
        "TEXT2SQL_MODEL": "${input:text2sql-model}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

text2sql in other clients