{"_id":"@elad-nofy/mssql-mcp","_rev":"7-907cb6778b715eff4ede22955fd19bdc","name":"@elad-nofy/mssql-mcp","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@elad-nofy/mssql-mcp","version":"1.0.0","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/mssql-mcp@1.0.0","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"bin":{"mssql-mcp":"dist/index.js"},"dist":{"shasum":"bc21000505ea1e72e60b52d6dbf0b0fb1ab74c07","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.0.0.tgz","fileCount":43,"integrity":"sha512-/Rc/ahAWA3XvnNk0nSphFDD/9Ju3Pgxwf8nvJCbQ3gz9PM8VZN3K+SoEnZcGYRulXsgtz1kmYok9q8zs95Rggg==","signatures":[{"sig":"MEYCIQCxbKhi23XMlJzEhuJeNFpIDoFiBulRsxNrbBc33f989QIhAI5Xkq/YV1eK8Dv1cfz8cAsV85E/EjX6bheh1qHkcLBa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":88679},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"95044cf85b3527c17068ce50a687e447c0cd610a","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"elad-nofy","email":"nofy@elad-health.com"},"repository":{"url":"git+https://github.com/elad-nofy/mssql-mcp.git","type":"git"},"_npmVersion":"11.7.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","mssql":"^11.0.1","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5","@types/mssql":"^9.1.5"},"_npmOperationalInternal":{"tmp":"tmp/mssql-mcp_1.0.0_1769154089039_0.23161664124419246","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@elad-nofy/mssql-mcp","version":"1.0.1","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/mssql-mcp@1.0.1","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"bin":{"mssql-mcp":"dist/index.js"},"dist":{"shasum":"c0ac6dc6b87a800643660fca75e436fffd4ee6a0","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.0.1.tgz","fileCount":43,"integrity":"sha512-dKcZlNpLuPNpDy6t8799vjVjz6bB+6CunLap8tt1txti/tQPnuuNn76eUCdQk2nyGluBNVfAqTopUOefUaUFXA==","signatures":[{"sig":"MEUCIB0TC94jDIaFEE7JfUILHqzt+evKImHtBkaYIGSz4kOLAiEAtdYP0nXTBngF4u/cCqry5/WqxK75/1ArxQ415QAAexw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@elad-nofy%2fmssql-mcp@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":88687},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"72ecf12e49331ef8f245884a7177267f5afd63df","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fdc75589-dc91-40ef-9248-dbee58ec7956"}},"repository":{"url":"git+https://github.com/elad-nofy/mssql-mcp.git","type":"git"},"_npmVersion":"11.8.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.24.1","mssql":"^11.0.1","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5","@types/mssql":"^9.1.5"},"_npmOperationalInternal":{"tmp":"tmp/mssql-mcp_1.0.1_1769154488574_0.44383495143200724","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@elad-nofy/mssql-mcp","version":"1.0.2","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/mssql-mcp@1.0.2","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"bin":{"mssql-mcp":"dist/index.js"},"dist":{"shasum":"3b067e8e037ed7c4e1940de2c03b0499926baafb","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.0.2.tgz","fileCount":47,"integrity":"sha512-FyNDdHzUCFGOpoCgoo+UPpC385e//Unf0NDsnEJ9RCoUWD9BQ98IVqJ2jwI2IqvGMKVaUXcj/5xcMwEZMFM61Q==","signatures":[{"sig":"MEUCIB71ojptmFhr87GKNDhsTBSfZF5S/LfIG0/ithpAV5NaAiEAu8oKHvtNDqAYGIhSDpe8lpXQd8J+cwca/kTiLNgQWEQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@elad-nofy%2fmssql-mcp@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":123858},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"5dda2577ee74dedf6c3b77dbb3b95e8e064fbdc5","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fdc75589-dc91-40ef-9248-dbee58ec7956"}},"repository":{"url":"git+https://github.com/elad-nofy/mssql-mcp.git","type":"git"},"_npmVersion":"11.8.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.24.1","mssql":"^11.0.1","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5","@types/mssql":"^9.1.5"},"_npmOperationalInternal":{"tmp":"tmp/mssql-mcp_1.0.2_1769158520212_0.48085579475649154","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@elad-nofy/mssql-mcp","version":"1.0.3","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/mssql-mcp@1.0.3","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"bin":{"mssql-mcp":"dist/index.js"},"dist":{"shasum":"7f6d365120368e0f2675e5b356f6440377fb6a4b","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.0.3.tgz","fileCount":47,"integrity":"sha512-7lDzPkqbfDwM1ejTf+SNxLMJE1Ctt8Lv7X9QDp6dnq/lQTc41uvWF57W13/x5ZXQScMKQamlOdMXs9/WGKWsDQ==","signatures":[{"sig":"MEUCIH+IRvCff2mohI8+mnnIrpVFt0tcbO+SlvqKeeXd8KRlAiEA8YBM2xD7TkZ5j47oa3u21XNQqPuOV4I/FVr04l2IoKE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@elad-nofy%2fmssql-mcp@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":138195},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"4e2e414d7750916dfefff3735e669b78723de0d5","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fdc75589-dc91-40ef-9248-dbee58ec7956"}},"repository":{"url":"git+https://github.com/elad-nofy/mssql-mcp.git","type":"git"},"_npmVersion":"11.8.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.24.1","mssql":"^11.0.1","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5","@types/mssql":"^9.1.5"},"_npmOperationalInternal":{"tmp":"tmp/mssql-mcp_1.0.3_1769160406699_0.3215346629459239","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@elad-nofy/mssql-mcp","version":"1.0.4","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/mssql-mcp@1.0.4","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"bin":{"mssql-mcp":"dist/index.js"},"dist":{"shasum":"9a4ed0a83c0eb2065c396e15bf91428182f2cf09","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.0.4.tgz","fileCount":47,"integrity":"sha512-eKmmPwdOXCJXCoEOn++2JAOkLTTQFhjK42zqE6HVV2b5ZDYB7eRqmWSrdyFknb7ZTJY1LKG6zs0G7ikT5xW0jA==","signatures":[{"sig":"MEQCIFyL88k+An0rW4OKjd+Abo3vrY7OuOJSX1dB9bYM877iAiBmbVpQSgD8Uq3PFfJYGIDLIf9Tq0Qi+W7UEpzzG+w9tw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@elad-nofy%2fmssql-mcp@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":138702},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"8964c12e86dcf7366c2803ab5b3d50c80ce95177","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fdc75589-dc91-40ef-9248-dbee58ec7956"}},"repository":{"url":"git+https://github.com/elad-nofy/mssql-mcp.git","type":"git"},"_npmVersion":"11.8.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.24.1","mssql":"^11.0.1","msnodesqlv8":"^5.1.3","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5","@types/mssql":"^9.1.5"},"_npmOperationalInternal":{"tmp":"tmp/mssql-mcp_1.0.4_1769161007260_0.7869367805380116","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@elad-nofy/mssql-mcp","version":"1.0.6","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","_id":"@elad-nofy/mssql-mcp@1.0.6","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"bin":{"mssql-mcp":"dist/index.js"},"dist":{"shasum":"97992d51535a0e9ebf161bfc8bc0d5906bfe6180","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.0.6.tgz","fileCount":47,"integrity":"sha512-O+qOIMEmhNjpIycSMWAfOYyi8hSRZ2VuTD7MOc8UhqpTLCQBRpcy/EWQlyXoddzobtM507oe9Y8E8dqJI180Ng==","signatures":[{"sig":"MEYCIQClaYQflWoA5np/VYqFWsrJAMd/qbFDMRLQ6WUPWBAtrwIhAJBHmIIPGzwMykOZru4j10VXpjRybQGAu9X2bB2f/zOz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@elad-nofy%2fmssql-mcp@1.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":138546},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"6032bd183bb905f8c15b6e02e055206d64b037f8","scripts":{"dev":"tsc --watch","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fdc75589-dc91-40ef-9248-dbee58ec7956"}},"repository":{"url":"git+https://github.com/elad-nofy/mssql-mcp.git","type":"git"},"_npmVersion":"11.8.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.24.1","mssql":"^11.0.1","zod-to-json-schema":"^3.25.1","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.5","@types/mssql":"^9.1.5"},"_npmOperationalInternal":{"tmp":"tmp/mssql-mcp_1.0.6_1769174681800_0.25617327614362706","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@elad-nofy/mssql-mcp","version":"1.1.0","description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","main":"dist/index.js","type":"module","bin":{"mssql-mcp":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsc --watch","prepublishOnly":"npm run build"},"keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"author":{"name":"Nof Yonany"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/elad-nofy/mssql-mcp.git"},"bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"homepage":"https://github.com/elad-nofy/mssql-mcp#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","mssql":"^11.0.1","zod":"^3.24.1","zod-to-json-schema":"^3.25.1"},"optionalDependencies":{"msnodesqlv8":"^4.2.1"},"devDependencies":{"@types/mssql":"^9.1.5","@types/node":"^22.10.5","typescript":"^5.7.2"},"engines":{"node":">=18.0.0"},"_id":"@elad-nofy/mssql-mcp@1.1.0","gitHead":"c80da3c0e86f03e4d45308ba8dd29264d23ab44a","types":"./dist/index.d.ts","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-zlyqekuPZ07UEHjadCQNbLXSH22Gz3RlQBRph08Kwt+gKI1n6lPRPbjTtTH9p+h5ve1Ih+h6x+iBYR9BoPCZ/A==","shasum":"a957421f4756a7ca72d79c44751f5f08391c061d","tarball":"https://registry.npmjs.org/@elad-nofy/mssql-mcp/-/mssql-mcp-1.1.0.tgz","fileCount":47,"unpackedSize":141868,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDVSJAR6BLfxFhqzmwzMwQ/UUzMZDfN4emaHfdl35jCAwIhAOhwzqvf55ZKbfxB05rpFzrmuqYTHmpNYvsBT6GPrme7"}]},"_npmUser":{"name":"elad-nofy","email":"nofy@elad-health.com"},"directories":{},"maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mssql-mcp_1.1.0_1782389398895_0.8112985755096727"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-23T07:41:28.940Z","modified":"2026-06-25T12:09:59.184Z","1.0.0":"2026-01-23T07:41:29.180Z","1.0.1":"2026-01-23T07:48:08.712Z","1.0.2":"2026-01-23T08:55:20.368Z","1.0.3":"2026-01-23T09:26:46.845Z","1.0.4":"2026-01-23T09:36:47.399Z","1.0.6":"2026-01-23T13:24:41.934Z","1.1.0":"2026-06-25T12:09:59.052Z"},"bugs":{"url":"https://github.com/elad-nofy/mssql-mcp/issues"},"author":{"name":"Nof Yonany"},"license":"MIT","homepage":"https://github.com/elad-nofy/mssql-mcp#readme","keywords":["mcp","mssql","sql-server","database","model-context-protocol","claude","ai","observability","monitoring"],"repository":{"type":"git","url":"git+https://github.com/elad-nofy/mssql-mcp.git"},"description":"MCP server for Microsoft SQL Server - Query execution, performance analysis, health monitoring","maintainers":[{"name":"elad-nofy","email":"nofy@elad-health.com"}],"readme":"# MSSQL MCP Server\n\nMCP (Model Context Protocol) server for Microsoft SQL Server. Provides AI assistants with read-only access to SQL Server for query execution, performance analysis, health monitoring, and troubleshooting.\n\n## Features\n\n### Connection & Discovery\n- **test_connection** - Verify SQL Server connectivity and authentication\n- **list_databases** - List all databases with status and size\n- **get_server_info** - Server version, edition, and configuration\n\n### Query Execution\n- **execute_query** - Run read-only SELECT queries (INSERT/UPDATE/DELETE blocked)\n- **get_expensive_queries** - Find resource-intensive queries from plan cache\n- **get_running_queries** - View currently executing queries\n\n### Schema Exploration\n- **get_tables** - List tables with row counts, sizes, and metadata\n- **get_columns** - Column definitions for a table (types, keys, defaults)\n- **get_stored_procedures** - List and view stored procedure code\n- **get_functions** - List and view user-defined function code\n- **get_views** - List and view definitions\n- **get_foreign_keys** - Table relationships and constraints\n- **get_indexes** - Index definitions with included columns\n- **get_triggers** - Table triggers with event types\n- **get_connected_users** - Active sessions and connections\n\n### Performance Analysis\n- **get_blocking** - Identify blocking chains and deadlocks\n- **get_wait_stats** - Analyze wait statistics for bottlenecks\n- **get_cpu_usage** - CPU usage history from ring buffer\n- **get_index_usage** - Find unused or missing indexes\n\n### Health Monitoring\n- **get_database_states** - Database health and status\n- **get_disk_space** - Data and log file space usage\n- **get_memory_usage** - Buffer pool and memory clerk stats\n- **get_log_space** - Transaction log usage\n- **get_backup_status** - Last backup times and status\n\n### SQL Agent Jobs\n- **list_jobs** - All SQL Agent jobs with status\n- **get_running_jobs** - Currently executing jobs\n- **get_failed_jobs** - Recent job failures\n- **get_job_history** - Execution history for a job\n\n### Availability Groups\n- **get_ag_status** - Always On AG health and sync status\n- **get_replica_states** - Detailed replica information\n- **get_cluster_status** - WSFC cluster status\n\n## Installation\n\n```bash\nnpx @elad-nofy/mssql-mcp\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\n# Required\nMSSQL_HOST=your-server.domain.com\n\n# Optional\nMSSQL_PORT=1433                          # Default: 1433\nMSSQL_DATABASE=master                    # Default: master\n\n# Authentication - Windows Auth (default)\n# Leave MSSQL_USER and MSSQL_PASSWORD empty for Windows Authentication\n\n# Authentication - SQL Auth\nMSSQL_USER=your_username\nMSSQL_PASSWORD=your_password\n\n# Connection Options\nMSSQL_ENCRYPT=false                      # Default: false\nMSSQL_TRUST_SERVER_CERTIFICATE=true      # Default: true\nMSSQL_CONNECTION_TIMEOUT=30000           # Default: 30000ms\nMSSQL_REQUEST_TIMEOUT=30000              # Default: 30000ms\n```\n\n### Claude Code CLI\n\n**Windows:**\n```json\n{\n  \"mcpServers\": {\n    \"mssql\": {\n      \"command\": \"cmd\",\n      \"args\": [\"/c\", \"npx\", \"@elad-nofy/mssql-mcp\"],\n      \"env\": {\n        \"MSSQL_HOST\": \"your-server.domain.com\"\n      }\n    }\n  }\n}\n```\n\n**macOS/Linux:**\n```json\n{\n  \"mcpServers\": {\n    \"mssql\": {\n      \"command\": \"npx\",\n      \"args\": [\"@elad-nofy/mssql-mcp\"],\n      \"env\": {\n        \"MSSQL_HOST\": \"your-server.domain.com\"\n      }\n    }\n  }\n}\n```\n\n### Windows Authentication\n\nFor Windows Authentication, run the MCP server under an account with SQL Server access. The server will use the process credentials automatically.\n\n### Required Permissions\n\nThe SQL Server login needs these permissions:\n- `VIEW SERVER STATE` - For DMVs (wait stats, blocking, etc.)\n- `VIEW DATABASE STATE` - For database-level DMVs\n- `SELECT` on `msdb` - For SQL Agent job information\n\nExample:\n```sql\nUSE master;\nCREATE LOGIN [DOMAIN\\ServiceAccount] FROM WINDOWS;\nGRANT VIEW SERVER STATE TO [DOMAIN\\ServiceAccount];\nGRANT VIEW ANY DATABASE TO [DOMAIN\\ServiceAccount];\n\nUSE msdb;\nCREATE USER [DOMAIN\\ServiceAccount] FOR LOGIN [DOMAIN\\ServiceAccount];\nGRANT SELECT ON SCHEMA::dbo TO [DOMAIN\\ServiceAccount];\n```\n\n## Example Usage\n\n### Explore Database Schema\n\n```\n\"What tables are in the Orders database?\"\n→ Uses get_tables to list all tables with row counts\n\n\"Show me the columns in the Customers table\"\n→ Uses get_columns to show column definitions\n\n\"What stored procedures exist for order processing?\"\n→ Uses get_stored_procedures with name filter\n\n\"How are the tables related?\"\n→ Uses get_foreign_keys to map relationships\n```\n\n### Investigate Performance Issues\n\n```\n\"Check for blocking on PROD-SQL-01\"\n→ Uses get_blocking to show blocking chains\n\n\"What are the top CPU-consuming queries?\"\n→ Uses get_expensive_queries sorted by CPU\n\n\"Show me the wait stats\"\n→ Uses get_wait_stats to identify bottlenecks\n```\n\n### Health Check\n\n```\n\"Are all databases healthy?\"\n→ Uses get_database_states to check status\n\n\"When was the last backup for each database?\"\n→ Uses get_backup_status to show backup times\n\n\"Check disk space on SQL Server\"\n→ Uses get_disk_space for file usage\n```\n\n### Troubleshoot Jobs\n\n```\n\"What jobs failed in the last 24 hours?\"\n→ Uses get_failed_jobs to show failures\n\n\"Is the nightly backup job running?\"\n→ Uses get_running_jobs to check status\n```\n\n## Troubleshooting\n\n### Connection Issues\n\n**\"Login failed for user\"**\n- Verify SQL Server allows the authentication type (Windows/SQL)\n- Check the account has server-level permissions\n- For Windows Auth, ensure the process runs as the correct user\n\n**\"Connection timeout\"**\n- Verify network connectivity to SQL Server\n- Check firewall allows port 1433 (or custom port)\n- Increase `MSSQL_CONNECTION_TIMEOUT` if needed\n\n**\"Cannot open database\"**\n- Verify the account has access to the database\n- Check database is online: `SELECT state_desc FROM sys.databases`\n\n### Permission Errors\n\n**\"The server principal is not able to access the database\"**\n- Create a user in the target database for the login\n- Grant appropriate permissions\n\n**\"VIEW SERVER STATE permission denied\"**\n- Grant at server level: `GRANT VIEW SERVER STATE TO [login]`\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Run in development (watch mode)\nnpm run dev\n```\n\n## Security Notes\n\n- **Read-only by design** - Only SELECT queries are allowed\n- **No secrets in code** - All credentials via environment variables\n- **Parameterized queries** - Protection against SQL injection\n- **Blocked dangerous operations** - INSERT, UPDATE, DELETE, EXEC prevented\n- **Graceful shutdown** - Connection pool properly closed on exit\n\n## License\n\nMIT\n","readmeFilename":"README.md"}