Allows coding agents to query SQL and NoSQL databases safely using read-only tools and policy-based access control.
Ayrıca bilinen adı valv-dev/valv, mcp, @valv/mcp
- Yıldızlar
- 5
- Araçlar
- —
- İndirmeler, 30 gün
- —
- En son sürüm
- 0.6.2
- Son commit
- 2 Eki 2026
- Lisans
- MIT
valv MCP nedir?
valv bir MCP sunucusudur. Allows coding agents to query SQL and NoSQL databases safely using read-only tools and policy-based access control.
Özet, projenin README dosyasından oluşturuldu
valv MCP sunucusu hakkında
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.
Neler yapabilirsiniz
- 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.
Projenin README dosyasından alınmıştır. Her kullanım durumu, oradaki bir alıntı ile kontrol edilir.
valv MCP nasıl yüklenir
Biçimler 10 Kas 2026 tarihinde doğrulandıvalv MCP'yi Claude Code içine yükleyin
$ claude mcp add --env DATABASE_URL=<YOUR_DATABASE_URL> mcp -- npx -y @valv/mcpvalv MCP'yi Cursor içine yükleyin
~/.cursor/mcp.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}valv MCP'yi VS Code içine yükleyin
.vscode/mcp.json
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}valv MCP'yi Claude Desktop içine yükleyin
claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}valv MCP'yi Codex içine yükleyin
~/.codex/config.toml
[mcp_servers.mcp] command = "npx" args = ["-y", "@valv/mcp"] [mcp_servers.mcp.env] DATABASE_URL = "<YOUR_DATABASE_URL>"
valv MCP'yi Gemini CLI içine yükleyin
~/.gemini/settings.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@valv/mcp"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}Yapılandırma
DATABASE_URLGerekliGizliDatabase 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.
| Ad | Açıklama | Sunucu |
|---|---|---|
| DATABASE_URL | Database connection string. PostgreSQL, MySQL, SQLite, CockroachDB, or a ClickHouse HTTP URL. | GerekliGizli |
| 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. |
Otomatik kontroller
Çalıştırıldı 14 Kas 2026Tam rapor →Otomatik kontrollerimizden geçti. Bu bir güvenlik denetimi değildir: kodu okuyun ve sunucuya ihtiyaç duyduğu en dar erişimi verin. Kontroller nasıl çalışır
- Kaynak deposu bağlantılı ve erişilebilirvalv-dev/valv is public and reachablegithub.com/valv-dev/valv ↗Geçti
- Paket bu depoyu kaynak olarak gösteriyor@valv/mcp names valv-dev/valv as sourcenpmjs.com/package/@valv/mcp ↗Geçti
- Derleme kaynağı (Sigstore onayı)No build attestation published for this releaseKontrol edilmedi
- Açık kaynak lisansı (OSI)MITspdx.org/licenses/MIT.html ↗Geçti
- Son bir yıl içinde commit veya sürüm mevcutLast commit or release 2026-10-02github.com/valv-dev/valv ↗Geçti
- OpenSSF ScorecardKontrol edilmedi
- Paket adı popüler bir pakete yakın değilNo popular package one edit away from @valv/mcpGeçti
- Pakette ve bağımlılıklarında kritik uyarı yok130 resolved dependencies checked; no critical advisoryosv.dev ↗Geçti
- Modele yönelik gizli talimat yok0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersGeçti
- Yıkıcı araçlar etiketlenmişKontrol edilmedi
- Uzak endpoint MCP el sıkışmasına yanıt veriyorKontrol edilmedi
@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 soruları
valv MCP'yi Claude Code'a nasıl eklerim?
Terminalinizde claude mcp add --env DATABASE_URL=<YOUR_DATABASE_URL> mcp -- npx -y @valv/mcp komutunu çalıştırın. Her projede kullanılabilir olması için --scope user ekleyin.
valv MCP'yi Cursor'a nasıl eklerim?
~/.cursor/mcp.json dosyasını açın ve yukarıdaki yükleme bölümünde gösterilen Cursor yapılandırmasını kullanarak sunucuyu mcpServers altına ekleyin.
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.