Faucet

v0.1.15
io.github.faucetdb/faucet Checked 8 hours ago Published 1 month ago

SQL database to MCP tools and REST API: PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

faucet_delete

Delete records from a database table that match a filter expression. A filter is required to prevent accidental full-table deletes. Returns the number of deleted records. Requires DELETE permission on the table.

ParameterTypeDescription
filter *stringFilter expression to select records to delete (e.g. "status = 'expired'")
service *stringName of the database service
table *stringName of the table to delete from

faucet_describe_table

Get the detailed schema for a specific table, including all columns with their types, nullability, defaults, primary keys, foreign keys, and indexes. Use this to understand table structure before writing queries. Requires GET permission on the table's schema (_schema/{table}).

ParameterTypeDescription
service *stringName of the database service
table *stringName of the table to describe

faucet_insert

Insert one or more records into a database table. Each record is a JSON object mapping column names to values. Returns the inserted records (with auto-generated fields like IDs) if the database supports RETURNING. Requires POST permission on the table.

ParameterTypeDescription
records *arrayArray of record objects to insert (e.g. [{"name": "Alice", "age": 30}])
service *stringName of the database service
table *stringName of the table to insert into

faucet_list_services

List all database services configured in Faucet. Returns each service's name, driver type, active status, and access mode. Use this first to discover available databases before querying. Only services your role has access to are listed.

faucet_list_tables

List all tables in a database service, including approximate row counts and column summaries. Use this to explore what data is available before querying specific tables. Requires GET permission on _table.

ParameterTypeDescription
service *stringName of the database service to list tables for

faucet_query

Query records from a database table with optional filtering, field selection, ordering, and pagination. Returns results as JSON. Requires GET permission on the table. Filter syntax (DreamFactory-compatible): - Simple: name = 'John' - Comparison: age > 21, price <= 100 - Logical: status = 'active' AND role = 'admin' - IN: status IN ('active', 'pending') - LIKE: name LIKE 'J%' - NULL: email IS NOT NULL - BETWEEN: age BETWEEN 18 AND 65 - CONTAINS: name CONTAINS 'smith' Order syntax: 'column ASC, other_column DESC'

ParameterTypeDescription
service *stringName of the database service
table *stringName of the table to query
fieldsarrayList of columns to return, each either a plain column or an aggregate such as "SUM(amount)", "COUNT(*)", or "AVG(price) AS avg_price". Omit for all columns.
filterstringFilter expression (e.g. "status = 'active' AND age > 21")
groupstringComma-separated columns to GROUP BY (e.g. "region,status"). Aggregate in 'fields' to compute per group; order by an aggregate's alias.
limitnumberMaximum number of records to return (default 25, max 1000)
offsetnumberNumber of records to skip for pagination
orderstringOrder clause (e.g. "created_at DESC, name ASC")

faucet_raw_sql

Execute a raw SQL query against a database service. Only available for services with raw_sql_allowed enabled. Use faucet_list_services to check which services allow raw SQL. Because arbitrary SQL can touch any object, it requires a role rule granting all verbs (GET, POST, PUT, PATCH, DELETE) on the _sql component of the service. The statement is executed as-is and may modify data; it is refused on services flagged read_only. Parameters should be passed as an array and referenced with positional placeholders ($1, $2 for PostgreSQL; ?, ? for MySQL).

ParameterTypeDescription
service *stringName of the database service
sql *stringSQL query to execute
limitnumberMaximum number of rows to return (default 100, max 10000)
paramsarrayPositional parameters for the SQL query
timeoutnumberQuery timeout in seconds (default 30)

faucet_update

Update records in a database table that match a filter expression. The record object contains the column values to set. A filter is required to prevent accidental full-table updates. Requires PATCH permission on the table.

ParameterTypeDescription
filter *stringFilter expression to select records to update (e.g. "id = 42")
record *objectObject with column names and new values (e.g. {"status": "archived"})
service *stringName of the database service
table *stringName of the table to update