
valv
sh.valv由 valv.sh 发布v0.6.2更新于 Oct 24, 2026
Let coding agents query any SQL database safely. Read-only by default and scoped by your policies.
概览
本地 MCP 服务器,让编码助手以默认只读、按策略限定的方式浏览并查询 SQL 数据库。
- 可以做什么
- 列出并搜索所连数据库暴露的表和集合
- 描述资源结构,让助手了解其列与字段
- 在允许的表上执行查询,模型无需编写 SQL
- 通过表允许列表、排除列表或策略模块限制可见范围,隐藏列并过滤行
- 可选择以 Streamable HTTP 代替 stdio 提供服务,并提供引导式安装来写入客户端配置
- 适用场景
- 适合希望助手基于实时 PostgreSQL、MySQL、SQLite、CockroachDB、ClickHouse 或 MongoDB 数据库回答问题,又不想把原始 SQL 或完整写权限交给它的场景。
- 运行要求
- 通过 npx 在本地运行(需要 Node.js)。需要 DATABASE_URL 连接字符串;ClickHouse 或 MongoDB 的 URL 未指定数据库时还需 VALV_DATABASE。可选变量:VALV_PROVIDER、VALV_TABLES、VALV_EXCLUDE、VALV_POLICY_FILE、VALV_CONTEXT、VALV_HTTP_PORT。需要能访问该数据库的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 valv,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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.
Guided setup
The fastest way in — it probes your database, lets you choose access, and writes the config:
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):
For ClickHouse, use its HTTP URL and a database name:
For MongoDB, use a standard connection string. Set VALV_DATABASE when the
URL does not select a database:
Configuration
All via environment variables:
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:
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
来源:packages/mcp/README.md,提交 90d585d
工具
0版本历史
1- v0.6.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分