Skip to main content
Glama
cookieark7

DevVault MCP

by cookieark7

devvault-mcp

一个轻量级 MCP 服务器,为 Claude Code 提供对 DevVault 本地 Postgres 数据库的结构化访问——检查 schema、运行只读查询、执行受保护的写入,以及为测试填充模拟数据。

连接

DATABASE_URL 按以下顺序解析:

  1. process.env.DATABASE_URL

  2. DEVVAULT_ENV_PATH(指向 .env 文件的路径),如果已设置

  3. ../devvault-backend/.env

因此数据库密码保留在后端 .env 中,不会重复写入任何 MCP 配置。

Related MCP server: PostgreSQL MCP Server

工具

工具

用途

db_info

显示我们连接的是哪个数据库/用户(不显示凭据)。

list_tables

公共表 + 近似行数。

describe_table

表的列(名称、类型、是否可空、默认值)。

count_rows

DevVault 主要表的精确行数。

run_query

一条只读语句(SELECT/WITH/EXPLAIN/SHOW),在 READ ONLY 事务中运行。支持 $1,$2… 参数。

run_write

一条 INSERT/UPDATE/DELETE。除非 allowDangerous=true,否则拒绝 DDL 和无范围(无 WHERE)的 UPDATE/DELETE。

seed_dummy

向 snippets/bookmarks/notes/commands/prompts 插入模拟行(有效的 cuid id + 时间戳),并关联到现有用户。

安全防护

  • run_query 拒绝任何非只读内容,并阻止语句堆叠(;)。

  • run_write 拒绝 DROP/TRUNCATE/ALTER/CREATE/GRANT/…,并拒绝没有 WHERE 子句的 UPDATE/DELETE,除非传入 allowDangerous: true

  • 写入在事务内执行,出错时回滚。

注册到 Claude Code

已通过 ../.mcp.json(项目范围)完成配置:

{
  "mcpServers": {
    "devvault-db": {
      "command": "node",
      "args": ["/Users/cookie/project-git/devvault_2/devvault-mcp/server.js"]
    }
  }
}

MCP 服务器在 Claude Code 启动时加载,因此需要重启/重新连接会话,devvault-db 工具才会出现。

本地检查(无需 MCP 客户端)

npm install
node smoke.js     # connectivity + row counts
node mcptest.js   # full MCP handshake: list tools + call a few

模拟数据

seed_dummy 创建的种子行,其标题均以 Dummy 开头。 要删除它们:

DELETE FROM prompts  WHERE title LIKE 'Dummy %';
DELETE FROM commands WHERE title LIKE 'Dummy %';
DELETE FROM snippets WHERE title LIKE 'Dummy %';
DELETE FROM bookmarks WHERE title LIKE 'Dummy %';
DELETE FROM notes    WHERE title LIKE 'Dummy %';
Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides read-only access to PostgreSQL databases with schema inspection, query execution in multiple formats (JSON, CSV, Markdown), and query history tracking with built-in security features.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to query and manage local PostgreSQL databases through SQL execution and schema exploration tools. It supports both read-only queries and write operations including table creation and data modification via natural language.
    34
    ISC
  • A
    license
    A
    quality
    D
    maintenance
    Enables Claude to interact with a local PostgreSQL database through SQL queries, schema inspection, and CRUD operations.
    8
    225
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables safe interaction with PostgreSQL databases through read-only queries, schema exploration, and performance analysis.
    225
    MIT

View all related MCP servers

Related MCP Connectors

  • Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.

  • Comprehensive PostgreSQL documentation and best practices, including ecosystem tools

  • MCP server for managing Prisma Postgres.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cookieark7/devvault-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server