{"id":24841368,"url":"https://github.com/j4c0bs/mcp-server-sql-analyzer","last_synced_at":"2026-08-27T23:55:09.221Z","repository":{"id":274879502,"uuid":"921263450","full_name":"j4c0bs/mcp-server-sql-analyzer","owner":"j4c0bs","description":"MCP server for SQL static analysis.","archived":false,"fork":false,"pushed_at":"2025-07-01T14:37:41.000Z","size":38,"stargazers_count":20,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T15:41:55.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/j4c0bs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2025-01-23T16:33:06.000Z","updated_at":"2025-07-01T14:37:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bad6fe5-d105-45b4-9a09-8f2cb5cab6c9","html_url":"https://github.com/j4c0bs/mcp-server-sql-analyzer","commit_stats":null,"previous_names":["j4c0bs/mcp-server-sql-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/j4c0bs/mcp-server-sql-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4c0bs%2Fmcp-server-sql-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4c0bs%2Fmcp-server-sql-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4c0bs%2Fmcp-server-sql-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4c0bs%2Fmcp-server-sql-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j4c0bs","download_url":"https://codeload.github.com/j4c0bs/mcp-server-sql-analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4c0bs%2Fmcp-server-sql-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36947771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-08-27T02:00:07.166Z","response_time":96,"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":[],"created_at":"2025-01-31T07:17:13.699Z","updated_at":"2026-08-27T23:55:09.216Z","avatar_url":"https://github.com/j4c0bs.png","language":"Python","funding_links":[],"categories":["Developer Tools","Development Tools MCP Servers","🤖 AI/ML","پیاده‌سازی‌های سرور","Legend","Databases","🛠️ DevOps Tooling","Table of Contents","💻 Developer Tools (164 servers)","Server Implementations","Contributing"],"sub_categories":["Code Analysis","💻 \u003ca name=\"developer-tools\"\u003e\u003c/a\u003eابزارهای توسعه‌دهنده","💻 \u003ca name=\"developer-tools\"\u003e\u003c/a\u003eDeveloper Tools","Databases","🛠️ Utilities"],"readme":"# mcp-server-sql-analyzer\n\nA Model Context Protocol (MCP) server that provides SQL analysis, linting, and dialect conversion capabilities using [SQLGlot](https://sqlglot.com/sqlglot.html).\n\n## Overview\n\nThe SQL Analyzer MCP server provides tools for analyzing and working with SQL queries. It helps with:\n\n- SQL syntax validation and linting\n- Converting queries between different SQL dialects (e.g., MySQL to PostgreSQL)\n- Extracting and analyzing table references and dependencies\n- Identifying column usage and relationships\n- Discovering supported SQL dialects\n\n### How Claude Uses This Server\n\nAs an AI assistant, this server enhances my ability to help users work with SQL efficiently by:\n\n1. **Query Validation**: I can instantly validate SQL syntax before suggesting it to users, ensuring I provide correct and dialect-appropriate queries.\n\n2. **Dialect Conversion**: When users need to migrate queries between different database systems, I can accurately convert the syntax while preserving the query's logic.\n\n3. **Code Analysis**: The table and column reference analysis helps me understand complex queries, making it easier to explain query structure and suggest optimizations.\n\n4. **Compatibility Checking**: By knowing the supported dialects and their specific features, I can guide users toward database-specific best practices.\n\nThis toolset allows me to provide more accurate and helpful SQL-related assistance while reducing the risk of syntax errors or dialect-specific issues.\n\n### Tips\n\nUpdate your personal preferences in Claude Desktop settings to request that generated SQL is first validated using the `lint_sql` tool.\n\n## Tools\n\n1. lint_sql\n   - Validates SQL query syntax and returns any errors\n   - Input:\n     - sql (string): SQL query to analyze\n     - dialect (string, optional): SQL dialect (e.g., 'mysql', 'postgres')\n   - Returns: ParseResult containing:\n     - is_valid (boolean): Whether the SQL is valid\n     - message (string): Error message or \"No syntax errors\"\n     - position (object, optional): Line and column of error if present\n\n2. transpile_sql\n   - Converts SQL between different dialects\n   - Inputs:\n     - sql (string): SQL statement to transpile\n     - read_dialect (string): Source SQL dialect\n     - write_dialect (string): Target SQL dialect\n   - Returns: TranspileResult containing:\n     - is_valid (boolean): Whether transpilation succeeded\n     - message (string): Error message or success confirmation\n     - sql (string): Transpiled SQL if successful\n\n3. get_all_table_references\n   - Extracts table and CTE references from SQL\n   - Inputs:\n     - sql (string): SQL statement to analyze\n     - dialect (string, optional): SQL dialect\n   - Returns: TableReferencesResult containing:\n     - is_valid (boolean): Whether analysis succeeded\n     - message (string): Status message\n     - tables (array): List of table references with type, catalog, database, table name, alias, and fully qualified name\n\n4. get_all_column_references\n   - Extracts column references with table context\n   - Inputs:\n     - sql (string): SQL statement to analyze\n     - dialect (string, optional): SQL dialect\n   - Returns: ColumnReferencesResult containing:\n     - is_valid (boolean): Whether analysis succeeded\n     - message (string): Status message\n     - columns (array): List of column references with column name, table name, and fully qualified name\n\n## Resources\n\n### SQL Dialect Discovery\n\n```\ndialects://all\n```\n\nReturns a list of all supported SQL dialects for use in all tools.\n\n## Configuration\n\n### Using uvx (recommended)\n\nAdd this to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n      \"sql-analyzer\": {\n          \"command\": \"uvx\",\n          \"args\": [\n              \"--from\",\n              \"git+https://github.com/j4c0bs/mcp-server-sql-analyzer.git\",\n              \"mcp-server-sql-analyzer\"\n          ]\n      }\n  }\n}\n```\n\n### Using uv\n\nAfter cloning this repo, add this to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n      \"sql-analyzer\": {\n          \"command\": \"uv\",\n          \"args\": [\n              \"--directory\",\n              \"/path/to/mcp-server-sql-analyzer\",\n              \"run\",\n              \"mcp-server-sql-analyzer\"\n          ]\n      }\n  }\n}\n```\n\n## Development\n\nTo run the server in development mode:\n\n```bash\n# Clone the repository\ngit clone git@github.com:j4c0bs/mcp-server-sql-analyzer.git\n\n# Run the server\nnpx @modelcontextprotocol/inspector uv --directory /path/to/mcp-server-sql-analyzer run mcp-server-sql-analyzer\n```\n\nTo run unit tests:\n\n```bash\nuv run pytest .\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj4c0bs%2Fmcp-server-sql-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj4c0bs%2Fmcp-server-sql-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj4c0bs%2Fmcp-server-sql-analyzer/lists"}