{"id":31830813,"url":"https://github.com/gemini-cli-extensions/sql-server","last_synced_at":"2026-02-25T00:02:17.035Z","repository":{"id":316317829,"uuid":"1055661993","full_name":"gemini-cli-extensions/sql-server","owner":"gemini-cli-extensions","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-29T00:18:53.000Z","size":149,"stargazers_count":17,"open_issues_count":4,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-29T13:25:18.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gemini-cli-extensions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-12T15:49:34.000Z","updated_at":"2026-01-28T22:39:33.000Z","dependencies_parsed_at":"2025-10-27T20:17:26.658Z","dependency_job_id":"d6de87fa-f387-4078-a9d3-3edd1a627fea","html_url":"https://github.com/gemini-cli-extensions/sql-server","commit_stats":null,"previous_names":["gemini-cli-extensions/sql-server"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gemini-cli-extensions/sql-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemini-cli-extensions%2Fsql-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemini-cli-extensions%2Fsql-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemini-cli-extensions%2Fsql-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemini-cli-extensions%2Fsql-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gemini-cli-extensions","download_url":"https://codeload.github.com/gemini-cli-extensions/sql-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemini-cli-extensions%2Fsql-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28919469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-11T21:26:07.292Z","updated_at":"2026-01-30T21:09:18.094Z","avatar_url":"https://github.com/gemini-cli-extensions.png","language":null,"funding_links":[],"categories":["Databases","Databases and Data"],"sub_categories":[],"readme":"# Gemini CLI Extension - SQL Server\n\n\u003e [!NOTE]\n\u003e This extension is currently in beta (pre-v1.0), and may see breaking changes until the first stable release (v1.0).\n\nThis Gemini CLI extension provides a set of tools to interact with [Microsoft SQL Server](https://docs.microsoft.com/en-us/sql/) instances. It allows you to manage your databases, execute queries, and explore schemas directly from the [Gemini CLI](https://google-gemini.github.io/gemini-cli/), using natural language prompts.\n\nLearn more about [Gemini CLI Extensions](https://github.com/google-gemini/gemini-cli/blob/main/docs/extensions/index.md).\n\u003e [!IMPORTANT]\n\u003e **We Want Your Feedback!**\n\u003e Please share your thoughts with us by filling out our feedback [form][form]. \n\u003e Your input is invaluable and helps us improve the project for everyone.\n\n[form]: https://docs.google.com/forms/d/e/1FAIpQLSfEGmLR46iipyNTgwTmIDJqzkAwDPXxbocpXpUbHXydiN1RTw/viewform?usp=pp_url\u0026entry.157487=sql-server\n\n## Why Use the SQL Server Extension?\n\n* **Natural Language Management:** Stop wrestling with complex commands. Explore schemas and query data by describing what you want in plain English.\n* **Seamless Workflow:** As a Google-developed extension, it integrates seamlessly into the Gemini CLI environment. No need to constantly switch contexts for common database tasks.\n* **Code Generation:** Accelerate development by asking Gemini to generate data classes and other code snippets based on your table schemas.\n\n\n## Prerequisites\n\nBefore you begin, ensure you have the following:\n\n* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed with version **+v0.6.0**.\n* Setup Gemini CLI [Authentication](https://github.com/google-gemini/gemini-cli/tree/main?tab=readme-ov-file#-authentication-options).\n* A running SQL Server instance.\n* A user with database-level permissions to execute queries.\n\n## Getting Started\n\n### Installation\n\nTo install the extension, use the command:\n\n```bash\ngemini extensions install https://github.com/gemini-cli-extensions/sql-server\n```\n\n### Configuration\n\nYou will be prompted to configure the following settings during installation. These settings are saved in an `.env` file within the extension's directory.\n\n*   `MSSQL_HOST`: (Optional) The SQL Server host. Defaults to `localhost`.\n*   `MSSQL_PORT`: (Optional) The SQL Server port. Defaults to `1433`.\n*   `MSSQL_DATABASE`: The name of the database to connect to.\n*   `MSSQL_USER`: The database username.\n*   `MSSQL_PASSWORD`: The password for the database user.\n\nTo view or update your configuration:\n\n**List Settings:**\n*   Terminal: `gemini extensions list`\n*   Gemini CLI: `/extensions list`\n\n**Update Settings:**\n*   Terminal: `gemini extensions config sql-server [setting name] [--scope \u003cscope\u003e]`\n    *   `setting name`: (Optional) The single setting to configure.\n    *   `scope`: (Optional) The scope of the setting in (`user` or `workspace`). Defaults to `user`.\n*   Currently, you must restart the Gemini CLI for changes to take effect. We recommend using `gemini --resume` to resume your session.\n\nAlternatively, you can manually set these environment variables before starting the Gemini CLI:\n\n#### PowerShell\n```powershell\n$env:MSSQL_HOST = '\u003cyour-sql-server-host\u003e'  # Optional: defaults to localhost\n$env:MSSQL_PORT = '\u003cyour-sql-server-port\u003e'  # Optional: defaults to 1433\n$env:MSSQL_DATABASE = '\u003cyour-database-name\u003e'\n$env:MSSQL_USER = '\u003cyour-database-user\u003e'\n$env:MSSQL_PASSWORD = '\u003cyour-database-password\u003e'\n```\n\n#### Bash\n```bash\nexport MSSQL_HOST=\"\u003cyour-sql-server-host\u003e\"  # Optional: defaults to localhost\nexport MSSQL_PORT=\"\u003cyour-sql-server-port\u003e\"  # Optional: defaults to 1433\nexport MSSQL_DATABASE=\"\u003cyour-database-name\u003e\"\nexport MSSQL_USER=\"\u003cyour-database-user\u003e\"\nexport MSSQL_PASSWORD=\"\u003cyour-database-password\u003e\"\n```\n\n\u003e [!NOTE]\n\u003e See [Troubleshooting](#troubleshooting) for debugging your configuration.\n\n### Start Gemini CLI\n\nTo start the Gemini CLI, use the following command:\n\n```bash\ngemini\n```\n\n\u003e [!WARNING]\n\u003e **Changing Instance \u0026 Database Connections**\n\u003e Currently, the database connection must be configured before starting the Gemini CLI and can not be changed during a session.\n\u003e To save and resume conversation history use command: `/chat save \u003ctag\u003e` and `/chat resume \u003ctag\u003e`.\n\n## Usage Examples\n\nInteract with SQl Server using natural language right from your IDE:\n\n* **Explore Schemas and Data:**\n  * \"Show me all tables in the 'orders' database.\"\n  * \"What are the columns in the 'products' table?\"\n  * \"How many orders were placed in the last 30 days, and what were the top 5 most purchased items?\"\n* **Generate Code:**\n  * \"Generate a Python dataclass to represent the 'customers' table.\"\n\n## Supported Tools\n\n* `list_tables`: lists schema information for all or specified tables in a SQL server database.\n* `execute_sql`: executes a SQL statement against a SQL Server database.\n\n## Additional Extensions\n\nFind additional extensions to support your entire software development lifecycle at [github.com/gemini-cli-extensions](https://github.com/gemini-cli-extensions), including:\n* [Cloud SQL for SQL Server extension](https://github.com/gemini-cli-extensions/cloud-sql-sqlserver)\n* and more!\n\n## Troubleshooting\n\nUse `gemini --debug` to enable debugging.\n\nCommon issues:\n\n* \"✖ Error during discovery for server: MCP error -32000: Connection closed\": The database connection has not been established. Ensure your configuration is set via environment variables.\n* \"✖ MCP ERROR: Error: spawn /Users/USER/.gemini/extensions/sql-server/toolbox ENOENT\": The Toolbox binary did not download correctly. Ensure you are using Gemini CLI v0.6.0+.\n* \"cannot execute binary file\": The Toolbox binary did not download correctly. Ensure the correct binary for your OS/Architecture has been downloaded. See [Installing the server](https://googleapis.github.io/genai-toolbox/getting-started/introduction/#installing-the-server) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemini-cli-extensions%2Fsql-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgemini-cli-extensions%2Fsql-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemini-cli-extensions%2Fsql-server/lists"}