Faucet

Self-hosted gateway that exposes SQL databases as MCP tools and a REST API under per-table roles

By FaucetDB Go Local · stdio, Streamable HTTP Databases

51 popularity score ★ 170 ↓ 79/wk

Connect your client

Local (once it is running)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add --transport http faucet http://localhost:8080/mcp
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "faucet": {
      "url": "http://localhost:8080/mcp"
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "faucet": {
      "type": "http",
      "url": "http://localhost:8080/mcp"
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.faucet]
url = "http://localhost:8080/mcp"
Gemini CLITerminal
gemini mcp add --scope user --transport http faucet http://localhost:8080/mcp
Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add faucet -- npx -y @faucetdb/faucet mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "faucet": {
      "command": "npx",
      "args": [
        "-y",
        "@faucetdb/faucet",
        "mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "faucet": {
      "command": "npx",
      "args": [
        "-y",
        "@faucetdb/faucet",
        "mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "faucet": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@faucetdb/faucet",
        "mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.faucet]
command = "npx"
args = ["-y", "@faucetdb/faucet", "mcp"]
Gemini CLITerminal
gemini mcp add --scope user faucet npx -- -y @faucetdb/faucet mcp

Settings 2

FAUCET_TELEMETRY Optional: Set to 0 to stop the anonymous usage data release binaries send to PostHog.
FAUCET_AUTH_JWT_SECRET Optional: Signing secret for admin sessions (alias FAUCET_JWT_SECRET); a random one is generated and stored on first start if unset.

What it does

Faucet is a single Go binary that connects to a SQL database you already run, reads its schema at runtime and serves it two ways: as a REST API with an OpenAPI 3.1 spec, and as an MCP server. It supports PostgreSQL, MySQL, MariaDB (through the MySQL driver), SQL Server, Oracle, Snowflake and SQLite. Connections, roles, API keys and admin accounts sit in an embedded SQLite file in its data directory (~/.faucet by default, /data in the Docker image); rows are read from your database directly and not copied elsewhere.

The MCP side has eight tools in v0.1.15: list connected databases, list and describe tables, query rows with filters and paging, insert, update and delete rows, and run raw SQL. It also offers two read-only resources, faucet://services and faucet://schema/{service}. In the tools source, faucet_query returns 25 rows by default and at most 1000 with limit; faucet_raw_sql returns 100 rows by default, at most 10000, with a 30-second query timeout by default (internal/mcp/tools.go).

There are two ways to connect. `faucet serve` hosts the MCP endpoint at /mcp on the same port as the REST API (8080 by default) and checks an X-API-Key header; the key's role decides which databases, tables and verbs an agent gets. `faucet mcp` runs over stdio as a subprocess of the client, reads the same local config store, and runs with admin rights, so roles do not apply. A third option, `faucet mcp --transport http`, runs a standalone authenticated HTTP server on port 3001 by default.

Release binaries send anonymous usage data to PostHog once at start-up and then hourly, unless FAUCET_TELEMETRY=0 or `faucet config set telemetry.enabled false` is set (TELEMETRY.md). Its makers describe it as under active development and suited to internal tools and prototypes.

What it needs

RuntimeNode.js 18+

At least one database connection added first, through the admin UI of `faucet serve` or with `faucet db add`; the MCP tools have nothing to work on otherwise. Reachable network access to that database (PostgreSQL 9.6-17, MySQL 5.7-9.x, MariaDB 10.2-11.x, SQL Server 2012-2022, Oracle 12c-26ai, Snowflake, or SQLite 3.35+). Node.js 18+ for the npx package, which downloads a prebuilt binary for Linux, macOS or Windows. For the HTTP endpoint: start `faucet serve` and create a role and an API key, sent as the X-API-Key header.

Limits

Row-level filter expressions on access rules are stored but not yet applied to queries. faucet_query returns at most 1000 rows per call and faucet_raw_sql at most 10000. faucet_raw_sql works only on services with raw_sql_allowed enabled and, over HTTP, for a role holding all five verbs on _sql. Mutation tools refuse services flagged read_only, and faucet_delete requires a filter. Stdio mode ignores roles and runs with admin rights. No OAuth sign-in, so ChatGPT connectors cannot use it directly. No GraphQL. Databases added with `faucet db add` are loaded only when the server next starts.

Who it suits

Suits a developer or team that wants an agent to read and change rows in an existing SQL database, especially one that is not PostgreSQL, with per-table verb control through API keys. The stdio mode suits one person on their own machine; anything shared should use the /mcp endpoint with a scoped key, since stdio bypasses roles. Those wanting row-level security enforced, OAuth sign-in or a hosted service should look elsewhere: Faucet is self-hosted and filters are not yet enforced.

Tools 8

faucet_list_services
Lists the connected databases the caller's role can reach, with read-only and raw SQL flags
faucet_list_tables
Lists the tables in one database with column summaries and approximate row counts
faucet_describe_table
Shows a table's columns, types, nullability, defaults, keys and constraints
faucet_query
Reads rows with filters, ordering and paging; 25 rows by default, up to 1000
faucet_insert
Adds one or more rows to a table
faucet_update
Changes rows that match a filter
faucet_delete
Removes rows that match a required filter
faucet_raw_sql
Runs any SQL on a database that allows raw SQL; 100 rows by default, up to 10000

Similar servers