# DataGate MCP server

> Provides a secure, read-only gateway for AI tools to access databases through policy-driven, structured queries instead of raw SQL.

- Repository: https://github.com/afurlane/copilot-datagate
- Page: https://hostedmcp.org/servers/afurlane/copilot-datagate
- Transport: stdio
- Stars: 0
- License: Apache-2.0
- Latest version: 0.4.0

## Install

### Claude Code

```sh
claude mcp add copilot-datagate -- npx -y @copilot-datagate/cli
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "copilot-datagate": {
      "command": "npx",
      "args": [
        "-y",
        "@copilot-datagate/cli"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "copilot-datagate": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@copilot-datagate/cli"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"copilot-datagate","type":"stdio","command":"npx","args":["-y","@copilot-datagate/cli"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "copilot-datagate": {
      "command": "npx",
      "args": [
        "-y",
        "@copilot-datagate/cli"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add copilot-datagate -- npx -y @copilot-datagate/cli
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.copilot-datagate]
command = "npx"
args = ["-y", "@copilot-datagate/cli"]
```

### Gemini CLI

```sh
gemini mcp add -s user copilot-datagate npx -- -y @copilot-datagate/cli
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "copilot-datagate": {
      "command": "npx",
      "args": [
        "-y",
        "@copilot-datagate/cli"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DATAGATE_PROJECT_ROOT` | no | no | Workspace root used to resolve .datagate/datagate.toml, datagate.toml, or user-level config. |

## FAQ

### Can the AI execute arbitrary SQL queries?

No, the server prevents direct database access and arbitrary queries; instead, it uses a controlled query builder to construct safe, validated queries.

### Which databases are supported?

DataGate supports PostgreSQL, MySQL/MariaDB, and SQLite.

### How are database credentials handled for PostgreSQL?

Credentials are not stored in configuration files; the service reads the connection from the runtime environment via variables like DB_URL or individual components.
