Allows coding agents to query SQL and NoSQL databases safely using read-only tools and policy-based access control.
Auch bekannt als valv-dev/valv, mcp, @valv/mcp
- Stars
- 5
- Tools
- —
- Downloads, 30 Tage
- —
- Neueste Version
- 0.6.2
- Letzter Commit
- 2. Okt. 2026
- Lizenz
- MIT
Was ist valv MCP?
valv ist ein MCP server. Allows coding agents to query SQL and NoSQL databases safely using read-only tools and policy-based access control.
Zusammenfassung generiert aus dem README des Projekts
Über valv MCP server
Querying live databases through coding agents without exposing raw SQL or risking data modification is what valv enables. Developers can connect this server to PostgreSQL, MySQL, SQLite, CockroachDB, ClickHouse, or MongoDB using a connection string. It functions as a read-only bridge that introspects your schema and provides four specific tools: list_resources, search_resources, describe_resource, and query.
Setup is handled via npx or manual configuration in files like .mcp.json for clients such as Claude Desktop, Claude Code, Cursor, or Codex. You can control access through environment variables like VALV_TABLES to allow-list specific tables or VALV_EXCLUDE to deny-list them. For more granular security, a policy file can hide specific columns or restrict row access based on a provided JSON context. This ensures the model only interacts with the data you explicitly permit while preventing it from ever seeing or executing raw SQL commands.
Was du damit machen kannst
- 1Secure database schema explorationAsk an AI agent to discover the structure and available tables within a production database.
- 2Restricted data retrievalInstruct an agent to fetch specific records while ensuring sensitive columns remain hidden from the model.
- 3Automated data reportingHave a coding agent transform database query results into interactive HTML charts and reports.
- 4Multi-tenant data isolationUse policy files to ensure an agent only accesses data belonging to a specific tenant or user.
Geschrieben aus dem README des Projekts. Jeder Use Case wurde gegen ein Zitat daraus geprüft.
So installierst du valv MCP
Formate geprüft am 10. Nov. 2026valv MCP in Claude Code installieren
$ claude mcp add --env DATABASE_URL=<YOUR_DATABASE_URL> mcp -- npx -y @valv/mcpvalv MCP in Cursor installieren
~/.cursor/mcp.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}valv MCP in VS Code installieren
.vscode/mcp.json
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}valv MCP in Claude Desktop installieren
claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}valv MCP in Codex installieren
~/.codex/config.toml
[mcp_servers.mcp] command = "npx" args = ["-y", "@valv/mcp"] [mcp_servers.mcp.env] DATABASE_URL = "<YOUR_DATABASE_URL>"
valv MCP in Gemini CLI installieren
~/.gemini/settings.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}Konfiguration
DATABASE_URLErforderlichSecretDatabase connection string. PostgreSQL, MySQL, SQLite, CockroachDB, or a ClickHouse HTTP URL.
VALV_CONTEXTJSON context object the policy reads, e.g. {"tenant":{"id":"acme"}}.
VALV_DATABASEDatabase name. Required for ClickHouse, whose URL does not carry one.
VALV_EXCLUDEComma-separated deny-list of tables, applied after the allow-list.
VALV_HTTP_PORTServe over Streamable HTTP on this port instead of stdio.
VALV_POLICY_FILEPath to a policy module that takes full control of access. Without it, the server is read-only across all tables.
VALV_PROVIDERDatasource provider: postgresql, mysql, sqlite, or clickhouse. Inferred from DATABASE_URL when omitted.
VALV_TABLESComma-separated allow-list of tables. When set, only these are exposed to the agent.
| Name | Beschreibung | Typ |
|---|---|---|
| DATABASE_URL | Database connection string. PostgreSQL, MySQL, SQLite, CockroachDB, or a ClickHouse HTTP URL. | ErforderlichSecret |
| VALV_CONTEXT | JSON context object the policy reads, e.g. {"tenant":{"id":"acme"}}. | |
| VALV_DATABASE | Database name. Required for ClickHouse, whose URL does not carry one. | |
| VALV_EXCLUDE | Comma-separated deny-list of tables, applied after the allow-list. | |
| VALV_HTTP_PORT | Serve over Streamable HTTP on this port instead of stdio. | |
| VALV_POLICY_FILE | Path to a policy module that takes full control of access. Without it, the server is read-only across all tables. | |
| VALV_PROVIDER | Datasource provider: postgresql, mysql, sqlite, or clickhouse. Inferred from DATABASE_URL when omitted. | |
| VALV_TABLES | Comma-separated allow-list of tables. When set, only these are exposed to the agent. |
Automatisierte Checks
Geluften am 14. Nov. 2026Vollständiger Bericht →Unsere automatisierten Checks bestanden. Das ist kein Security-Audit: Lies den Code und gib dem Server nur den minimal notwendigen Zugriff. Wie die Checks funktionieren
- Source Repository verknüpft und erreichbarvalv-dev/valv is public and reachablegithub.com/valv-dev/valv ↗Bestanden
- Paket nennt dieses Repository als Quelle@valv/mcp names valv-dev/valv as sourcenpmjs.com/package/@valv/mcp ↗Bestanden
- Build-Herkunft (Sigstore-Attestierung)No build attestation published for this releaseNicht geprüft
- Open Source Lizenz (OSI)MITspdx.org/licenses/MIT.html ↗Bestanden
- Commit oder Release im letzten JahrLast commit or release 2026-10-02github.com/valv-dev/valv ↗Bestanden
- OpenSSF ScorecardNicht geprüft
- Package-Name ähnelt keinem populären PackageNo popular package one edit away from @valv/mcpBestanden
- Kein kritischer Hinweis im Paket oder seinen Abhängigkeiten130 resolved dependencies checked; no critical advisoryosv.dev ↗Bestanden
- Keine versteckten Anweisungen an das Modell0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersBestanden
- Destruktive Tools sind markiertNicht geprüft
- Remote-Endpoint beantwortet den MCP-HandshakeNicht geprüft
README
Auf GitHub ansehen@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.
Guided setup
The fastest way in — it probes your database, lets you choose access, and writes the config:
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):
{
"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:
"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:
"env": { "DATABASE_URL": "mongodb://localhost:27017", "VALV_DATABASE": "analytics" }
Configuration
All via environment variables:
| Variable | Description |
|---|---|
DATABASE_URL |
Connection string (required; or pass as the first CLI arg). |
VALV_PROVIDER |
postgresql | mysql | sqlite | mongodb | clickhouse. Inferred from the URL when omitted. |
VALV_DATABASE |
Database name for ClickHouse or MongoDB. |
VALV_TABLES |
Comma-separated allow-list — only these tables are exposed. |
VALV_EXCLUDE |
Comma-separated deny-list, applied after the allow-list. |
VALV_POLICY_FILE |
Path to a policy module (below) for tenant scoping / hidden fields. |
VALV_CONTEXT |
JSON context the policy reads (e.g. {"tenant":{"id":"acme"}}). |
VALV_HTTP_PORT |
Serve 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:
// valv.policy.cjs
module.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
valv MCP Fragen
Wie füge ich valv MCP zu Claude Code hinzu?
Führe claude mcp add --env DATABASE_URL=<YOUR_DATABASE_URL> mcp -- npx -y @valv/mcp in deinem Terminal aus. Füge --scope user hinzu, damit der Server in jedem Projekt verfügbar ist.
Wie füge ich valv MCP zu Cursor hinzu?
Öffne ~/.cursor/mcp.json und füge den Server unter mcpServers hinzu, mit der Cursor-Config aus dem Installationsabschnitt oben.
Which databases are supported?
The server works with PostgreSQL, MySQL, SQLite, CockroachDB, ClickHouse, and MongoDB.
Is the database access read-only?
Yes, the server provides tools that are read-only by default to ensure safety.
How can I restrict which tables or columns an agent can see?
You can use a policy file to define specific access rules, such as allowing reads on certain tables or denying specific columns.
Can I use this with MongoDB?
Yes, you can use a standard connection string for MongoDB and set the VALV_DATABASE variable if the URL does not select a database.