# Faucet

Faucet connects to a SQL database and exposes its data through MCP tools and a REST API. Use it when an agent needs role-controlled access to database records.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 165
- Author: faucetdb
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/faucetdb/faucet
- Updated: 2026-10-18
- HTML: https://affpapa.org/en/nevibecode/mcp/faucet

## What it does

Faucet inspects a connected SQL database and builds MCP tools and REST endpoints from its schema. It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, Snowflake, and SQLite. Schema inspection happens at runtime, so you do not need to generate API code separately.

Access controls include roles and API keys, with JWT authentication also available. Faucet generates OpenAPI 3.1 documentation and includes an admin UI. Roles and keys need configuration; the access controls do not configure themselves.

To add it to Claude Code, run `claude mcp add faucet -- npx -y @faucetdb/faucet`. An alternate command sets `FAUCET_DATA_DIR` with `--env`; replace its placeholder with the data directory path. Faucet is distributed as a single Go binary, while this setup command runs it through `npx`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `FAUCET_DATA_DIR` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env FAUCET_DATA_DIR=<FAUCET_DATA_DIR> --transport stdio faucet -- npx -y @faucetdb/faucet
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add faucet --env FAUCET_DATA_DIR=<FAUCET_DATA_DIR> -- npx -y @faucetdb/faucet
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "faucet": {
            "command": "npx",
            "args": [
                "-y",
                "@faucetdb/faucet"
            ],
            "env": {
                "FAUCET_DATA_DIR": "<FAUCET_DATA_DIR>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "faucet": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@faucetdb/faucet"
            ],
            "env": {
                "FAUCET_DATA_DIR": "<FAUCET_DATA_DIR>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e FAUCET_DATA_DIR=<FAUCET_DATA_DIR> faucet npx -y @faucetdb/faucet
```
Replace <…> with your own values

## When to use it
- give an agent MCP access to a SQL database
- generate CRUD REST endpoints from a database schema
- create OpenAPI 3.1 documentation for database endpoints
- connect supported databases through one server

## Example prompts
- Inspect the tables available in the connected database.
- Find database records that match this condition.
- Add a new record to the table using these values.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
