{"id":50836980,"url":"https://github.com/achmadya-dev/mcp-mssql-query","last_synced_at":"2026-06-14T04:05:13.634Z","repository":{"id":359711701,"uuid":"1245222517","full_name":"achmadya-dev/mcp-mssql-query","owner":"achmadya-dev","description":"Model Context Protocol (MCP) server for Microsoft SQL Server (MSSQL) to run SQL queries via stdio","archived":false,"fork":false,"pushed_at":"2026-06-14T02:45:59.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T03:07:38.242Z","etag":null,"topics":["cursor","database","mcp","model-context-protocol","mssql","sql-server","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/achmadya-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":"2026-05-21T02:59:09.000Z","updated_at":"2026-06-14T02:46:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/achmadya-dev/mcp-mssql-query","commit_stats":null,"previous_names":["achmadya-dev/mcp-mssql-query"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/achmadya-dev/mcp-mssql-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mssql-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mssql-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mssql-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mssql-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/achmadya-dev","download_url":"https://codeload.github.com/achmadya-dev/mcp-mssql-query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mssql-query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34308667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cursor","database","mcp","model-context-protocol","mssql","sql-server","typescript"],"created_at":"2026-06-14T04:05:08.434Z","updated_at":"2026-06-14T04:05:13.626Z","avatar_url":"https://github.com/achmadya-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @achmadya-dev/mcp-mssql-query\n\nMCP server for Microsoft SQL Server. Runs a single T-SQL statement per tool call over **stdio**. **Read-only by default** — writes and DDL require explicit env flags.\n\n## Requirements\n\n- Node.js **≥ 20**\n- A reachable SQL Server instance\n\n## Install from npm\n\n```json\n{\n  \"mcpServers\": {\n    \"mssql\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@achmadya-dev/mcp-mssql-query\"],\n      \"env\": {\n        \"MSSQL_HOST\": \"localhost\",\n        \"MSSQL_PORT\": \"1433\",\n        \"MSSQL_USER\": \"sa\",\n        \"MSSQL_PASSWORD\": \"your_password\",\n        \"MSSQL_DATABASE\": \"your_database\",\n        \"MSSQL_TRUST_SERVER_CERTIFICATE\": \"true\"\n      }\n    }\n  }\n}\n```\n\nOr use `envFile` instead of inline `env`.\n\n## Develop from source\n\n```bash\ngit clone https://github.com/achmadya-dev/mcp-mssql-query.git\ncd mcp-mssql-query\npnpm install\npnpm run build\npnpm test\n```\n\nOpen the repo root in Cursor. You need a reachable SQL Server instance — set connection env in `.cursor/mcp.json` or via `envFile`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mssql\": {\n      \"command\": \"node\",\n      \"args\": [\"${workspaceFolder}/dist/index.js\"],\n      \"env\": {\n        \"MSSQL_HOST\": \"localhost\",\n        \"MSSQL_PORT\": \"1433\",\n        \"MSSQL_USER\": \"sa\",\n        \"MSSQL_PASSWORD\": \"your_password\",\n        \"MSSQL_DATABASE\": \"your_database\",\n        \"MSSQL_TRUST_SERVER_CERTIFICATE\": \"true\"\n      }\n    }\n  }\n}\n```\n\n## Environment variables\n\n### Connection\n\n| Variable                         | Default      | Description                          |\n| -------------------------------- | ------------ | ------------------------------------ |\n| `MSSQL_HOST`                     | `localhost`  | SQL Server host                      |\n| `MSSQL_PORT`                     | `1433`       | Port                                 |\n| `MSSQL_USER`                     | _(empty)_    | Username                             |\n| `MSSQL_PASSWORD`                 | _(empty)_    | Password                             |\n| `MSSQL_DATABASE`                 | _(optional)_ | Database name                        |\n| `MSSQL_INSTANCE_NAME`            | _(optional)_ | Instance name (e.g. `SQLEXPRESS`)    |\n| `MSSQL_ENCRYPT`                  | `true`       | Encrypt connection                   |\n| `MSSQL_TRUST_SERVER_CERTIFICATE` | `true`       | Trust server certificate (local dev) |\n| `MSSQL_CONNECTION_TIMEOUT_MS`    | `15000`      | Connection timeout (ms)              |\n| `MSSQL_REQUEST_TIMEOUT_MS`       | `15000`      | Request timeout (ms)                 |\n| `MSSQL_MAX_ROWS`                 | `500`        | Max rows for row-returning queries   |\n\n### Write access\n\n| Variable                 | Allows   |\n| ------------------------ | -------- |\n| `ALLOW_INSERT_OPERATION` | `INSERT` |\n| `ALLOW_UPDATE_OPERATION` | `UPDATE` |\n| `ALLOW_DELETE_OPERATION` | `DELETE` |\n| `ALLOW_DDL_OPERATION`    | DDL      |\n\nEnabled values: `true`, `1`, `yes`, `on`.\n\n## Tools\n\n| Tool           | Statements                  | Env flag                 |\n| -------------- | --------------------------- | ------------------------ |\n| `mssql_select` | `SELECT`, `VALUES`, `PRINT` | always on                |\n| `mssql_insert` | `INSERT`                    | `ALLOW_INSERT_OPERATION` |\n| `mssql_update` | `UPDATE`                    | `ALLOW_UPDATE_OPERATION` |\n| `mssql_delete` | `DELETE`                    | `ALLOW_DELETE_OPERATION` |\n| `mssql_ddl`    | DDL                         | `ALLOW_DDL_OPERATION`    |\n\nEach tool accepts one `sql` string.\n\n## Behavior and security\n\n- One T-SQL statement per request.\n- Results are JSON text; row-returning queries include truncation metadata.\n- Non-row commands return `kind: \"execute\"` with `affectedRows`.\n\n## Package scripts\n\n```bash\npnpm run build\npnpm test\npnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachmadya-dev%2Fmcp-mssql-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fachmadya-dev%2Fmcp-mssql-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachmadya-dev%2Fmcp-mssql-query/lists"}