S

Schemagate

by ashishsinha1602 · io.github.ashishsinha1602/schemagate

Access control for text-to-SQL agents. Before the model sees the schema, schemagate keeps only the tables and columns the caller may read, picks the few a question needs, and refuses hidden ones at query time. Postgres, Oracle, MySQL, SQL Server, SQLite. Quantum-safe signed audit log. Try it in your browser: https://ashishsinha1602.github.io/schemagate/

pypi Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-ashishsinha1602-schemagate": {
      "command": "uvx",
      "args": [
        "schemagate"
      ],
      "env": {
        "SCHEMAGATE_DATABASE_URL": "<YOUR_VALUE>",
        "SCHEMAGATE_CATALOG_CONFIG": "<VALUE>",
        "SCHEMAGATE_MEMORY": "<VALUE>",
        "SCHEMAGATE_MCP_PORT": "<VALUE>",
        "SCHEMAGATE_AUDIT_LOG": "<VALUE>",
        "SCHEMAGATE_AUTO_EMBEDDER": "<VALUE>",
        "SCHEMAGATE_MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-ashishsinha1602-schemagate": {
      "command": "uvx",
      "args": [
        "schemagate"
      ],
      "env": {
        "SCHEMAGATE_DATABASE_URL": "<YOUR_VALUE>",
        "SCHEMAGATE_CATALOG_CONFIG": "<VALUE>",
        "SCHEMAGATE_MEMORY": "<VALUE>",
        "SCHEMAGATE_MCP_PORT": "<VALUE>",
        "SCHEMAGATE_AUDIT_LOG": "<VALUE>",
        "SCHEMAGATE_AUTO_EMBEDDER": "<VALUE>",
        "SCHEMAGATE_MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-ashishsinha1602-schemagate": {
      "command": "uvx",
      "args": [
        "schemagate"
      ],
      "env": {
        "SCHEMAGATE_DATABASE_URL": "<YOUR_VALUE>",
        "SCHEMAGATE_CATALOG_CONFIG": "<VALUE>",
        "SCHEMAGATE_MEMORY": "<VALUE>",
        "SCHEMAGATE_MCP_PORT": "<VALUE>",
        "SCHEMAGATE_AUDIT_LOG": "<VALUE>",
        "SCHEMAGATE_AUTO_EMBEDDER": "<VALUE>",
        "SCHEMAGATE_MCP_TRANSPORT": "stdio"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-ashishsinha1602-schemagate": {
      "command": "uvx",
      "args": [
        "schemagate"
      ],
      "env": {
        "SCHEMAGATE_DATABASE_URL": "<YOUR_VALUE>",
        "SCHEMAGATE_CATALOG_CONFIG": "<VALUE>",
        "SCHEMAGATE_MEMORY": "<VALUE>",
        "SCHEMAGATE_MCP_PORT": "<VALUE>",
        "SCHEMAGATE_AUDIT_LOG": "<VALUE>",
        "SCHEMAGATE_AUTO_EMBEDDER": "<VALUE>",
        "SCHEMAGATE_MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-ashishsinha1602-schemagate": {
      "command": "uvx",
      "args": [
        "schemagate"
      ],
      "env": {
        "SCHEMAGATE_DATABASE_URL": "<YOUR_VALUE>",
        "SCHEMAGATE_CATALOG_CONFIG": "<VALUE>",
        "SCHEMAGATE_MEMORY": "<VALUE>",
        "SCHEMAGATE_MCP_PORT": "<VALUE>",
        "SCHEMAGATE_AUDIT_LOG": "<VALUE>",
        "SCHEMAGATE_AUTO_EMBEDDER": "<VALUE>",
        "SCHEMAGATE_MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-ashishsinha1602-schemagate": {
      "command": "uvx",
      "args": [
        "schemagate"
      ],
      "env": {
        "SCHEMAGATE_DATABASE_URL": "<YOUR_VALUE>",
        "SCHEMAGATE_CATALOG_CONFIG": "<VALUE>",
        "SCHEMAGATE_MEMORY": "<VALUE>",
        "SCHEMAGATE_MCP_PORT": "<VALUE>",
        "SCHEMAGATE_AUDIT_LOG": "<VALUE>",
        "SCHEMAGATE_AUTO_EMBEDDER": "<VALUE>",
        "SCHEMAGATE_MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
SCHEMAGATE_DATABASE_URL secret Yes Database URL to connect to. Set to 'demo' to serve the bundled sample schema.
SCHEMAGATE_CATALOG_CONFIG No Path to a catalog configuration JSON file. Can contain 'restrict', 'hint', and 'groups' blocks.
SCHEMAGATE_MEMORY No Enables memory of question-SQL pairs. Set to a path or '1' for ~/.schemagate/memory/<db>.jsonl. Off by default.
SCHEMAGATE_MCP_PORT No Port for the streamable-http transport. Used when SCHEMAGATE_MCP_TRANSPORT=streamable-http.
SCHEMAGATE_AUDIT_LOG No Enables audit logging. Set to a file path, or '1' for ~/.schemagate/audit.jsonl. Off by default.
SCHEMAGATE_AUTO_EMBEDDER No Set to '0' to force the hashed embedder even if schemagate[huggingface] is installed.
SCHEMAGATE_MCP_TRANSPORT No MCP transport. Use 'stdio' (default) or 'streamable-http' for HTTP. Default: stdio

Similar servers