# AgentSQL MCP server

> Acts as a security gateway for AI agents to access PostgreSQL and MySQL databases through SQL auditing, authentication, and data masking.

- Repository: https://github.com/cuipengdba/agentsql
- Page: https://hostedmcp.org/servers/cuipengdba/agentsql
- Transport: remote
- Stars: 20
- License: Apache-2.0
- Latest version: 0.4.0

## Install

### Claude Code

```sh
claude mcp add --transport http agentsql https://demo.agentsql.cn/mcp
```

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

```json
{
  "mcpServers": {
    "agentsql": {
      "url": "https://demo.agentsql.cn/mcp"
    }
  }
}
```

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

```json
{
  "servers": {
    "agentsql": {
      "type": "http",
      "url": "https://demo.agentsql.cn/mcp"
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"agentsql","type":"http","url":"https://demo.agentsql.cn/mcp"}'
```

### Codex

```sh
codex mcp add agentsql --url https://demo.agentsql.cn/mcp
```

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

```toml
[mcp_servers.agentsql]
url = "https://demo.agentsql.cn/mcp"
```

### Gemini CLI

```sh
gemini mcp add -s user --transport http agentsql https://demo.agentsql.cn/mcp
```

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

```json
{
  "mcpServers": {
    "agentsql": {
      "url": "https://demo.agentsql.cn/mcp",
      "type": "http"
    }
  }
}
```
