valv

sh.valvPublished by valv.shv0.6.2Updated Oct 24, 2026

Let coding agents query any SQL database safely. Read-only by default and scoped by your policies.

VerifiedSTDIODesktop onlyDatabasesDeveloper Tools

Overview

AI-generated overview

Local MCP server that lets a coding agent explore and query SQL databases read-only by default, with table and column policies.

What you can do
  • List and search the tables and collections exposed by the connected database
  • Describe a resource's schema so the agent knows its columns and fields
  • Run queries against allowed tables without the model writing SQL
  • Restrict exposure with a table allow-list, a deny-list, or a policy module that hides columns and filters rows
  • Optionally serve over Streamable HTTP instead of stdio, and install a guided setup that writes client config
When to use it
Useful when you want an assistant to answer questions from a live PostgreSQL, MySQL, SQLite, CockroachDB, ClickHouse or MongoDB database without handing it raw SQL or full write access.
Requirements
Runs locally via npx (Node.js). Requires a DATABASE_URL connection string, plus VALV_DATABASE for ClickHouse or MongoDB when the URL does not name a database. Optional variables: VALV_PROVIDER, VALV_TABLES, VALV_EXCLUDE, VALV_POLICY_FILE, VALV_CONTEXT, VALV_HTTP_PORT. Network access to the database is needed.
Before you install
DATABASE_URL usually contains database credentials, so use a least-privilege account. Without VALV_POLICY_FILE the server is read-only across all tables, so scope access with VALV_TABLES, VALV_EXCLUDE or a policy module. A policy module is code that takes full control of access. Query results are sent to the model provider. The init command modifies client configuration files.

Installation

In SourceWeft

  1. Open valv in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@valv/mcp

Point it at a database URL. Your agent queries it safely. No SQL, no code.

A zero-config MCP server built on valv. Give it a connection string and it introspects your live schema, serves four tools (list_resources, search_resources, describe_resource, query) read-only by default, and enforces your policies — no SQL ever reaches the model, and it can only read what you allow.

Works with PostgreSQL, MySQL, SQLite, CockroachDB, ClickHouse, and MongoDB.

[npm] [license]

Guided setup

The fastest way in — it probes your database, lets you choose access, and writes the config:

bash
npx @valv/mcp init

It takes either a connection string or individual fields (host, port, user, password, database), confirms the dialect, connects and shows your tables, then offers read-only / pick-tables / a policy-file stub. It then merges the server entry into the client of your choice — Claude Code, Claude Desktop, Cursor, or Codex — at project or global scope, leaving any existing config in place. Lastly it offers to install the valv skill, which teaches the agent how to query valv and turn results into interactive chart-report HTML files — as a skill for Claude Code (.claude/skills), Codex (.agents/skills), or Cursor (.cursor/skills), at project or global scope. Finally it can copy a kickstart prompt to your clipboard — paste it into your agent to explore the schema (seeding .valv/notes.md for future queries) and generate a single interactive valv-map.html overview of the database.

Manual setup

Add it to your .mcp.json (or Claude Desktop config):

json
{  "mcpServers": {    "db": {      "command": "npx",      "args": ["-y", "@valv/mcp"],      "env": { "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb" }    }  }}

For ClickHouse, use its HTTP URL and a database name:

json
"env": { "DATABASE_URL": "http://localhost:8123", "VALV_DATABASE": "analytics" }

For MongoDB, use a standard connection string. Set VALV_DATABASE when the URL does not select a database:

json
"env": { "DATABASE_URL": "mongodb://localhost:27017", "VALV_DATABASE": "analytics" }

Configuration

All via environment variables:

VariableDescription
DATABASE_URLConnection string (required; or pass as the first CLI arg).
VALV_PROVIDERpostgresql | mysql | sqlite | mongodb | clickhouse. Inferred from the URL when omitted.
VALV_DATABASEDatabase name for ClickHouse or MongoDB.
VALV_TABLESComma-separated allow-list — only these tables are exposed.
VALV_EXCLUDEComma-separated deny-list, applied after the allow-list.
VALV_POLICY_FILEPath to a policy module (below) for tenant scoping / hidden fields.
VALV_CONTEXTJSON context the policy reads (e.g. {"tenant":{"id":"acme"}}).
VALV_HTTP_PORTServe over Streamable HTTP on this port instead of stdio.

Policy file

Without one, access is read-only across all tables. To restrict what the agent can see — which tables, which columns — point VALV_POLICY_FILE at a module that receives the configured valv instance:

js
// valv.policy.cjsmodule.exports = (valv) => {  valv.policy("orders", () => ({    read:   true,                          // allow reads (or { column: value } to filter rows)    fields: { deny: ["internal_notes"] },  // hide columns from the agent  }))  // Tables without a policy are denied (deny-all).}

Need per-request row scoping by tenant/user? That belongs in the app-controlled path, where your code supplies real identity per request — use @valv/mcp-sdk (or pass a fixed VALV_CONTEXT and read it in the policy here).

License

MIT

Source: packages/mcp/README.md at commit 90d585d

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.6.2LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts