dbgraph 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ZH-cn.md CHANGED
@@ -43,6 +43,59 @@ npx dbgraph serve
43
43
 
44
44
  AI 代理连接 MCP 后自动发现 `dbgraph_*` 工具,用于 schema 感知的 SQL 生成。
45
45
 
46
+ ## MCP 配置
47
+
48
+ 在 AI 代理的配置文件中添加 DBGraph 作为 MCP 服务器:
49
+
50
+ **opencode**(`~/.config/opencode/opencode.json`):
51
+ ```json
52
+ {
53
+ "mcp": {
54
+ "dbgraph": {
55
+ "type": "local",
56
+ "command": ["npx", "dbgraph", "serve", "--auto-refresh"],
57
+ "enabled": true
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ **Cursor** → 设置 → MCP Servers → 添加:
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "dbgraph": {
68
+ "command": "npx",
69
+ "args": ["dbgraph", "serve", "--auto-refresh"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ **Claude Code**(`~/.claude/settings.json`):
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "dbgraph": {
80
+ "command": "npx",
81
+ "args": ["dbgraph", "serve", "--auto-refresh"]
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ **Codex CLI**(`~/.codexclirc.json`):
88
+ ```json
89
+ {
90
+ "mcpServers": {
91
+ "dbgraph": {
92
+ "type": "local",
93
+ "command": ["npx", "dbgraph", "serve", "--auto-refresh"]
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
46
99
  ## 为什么用 DBGraph?
47
100
 
48
101
  LLM 写 SQL 出错的最大原因是**不知道库表结构**——表名靠猜、列名靠蒙、JOIN 条件靠碰运气。DBGraph 把数据库 schema(表、列、类型、外键、约束、索引)提取为**可搜索的知识图谱**存在 `.dbgraph/` 中。AI 代理通过 MCP 工具直接查询,无需数据库直连。
package/README.md CHANGED
@@ -43,6 +43,59 @@ npx dbgraph serve
43
43
 
44
44
  AI agents connected to MCP automatically discover `dbgraph_*` tools for schema-aware SQL generation.
45
45
 
46
+ ## MCP Configuration
47
+
48
+ Add DBGraph as an MCP server in your agent's config:
49
+
50
+ **opencode** (`~/.config/opencode/opencode.json`):
51
+ ```json
52
+ {
53
+ "mcp": {
54
+ "dbgraph": {
55
+ "type": "local",
56
+ "command": ["npx", "dbgraph", "serve", "--auto-refresh"],
57
+ "enabled": true
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ **Cursor** → Settings → MCP Servers → Add:
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "dbgraph": {
68
+ "command": "npx",
69
+ "args": ["dbgraph", "serve", "--auto-refresh"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ **Claude Code** (`~/.claude/settings.json`):
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "dbgraph": {
80
+ "command": "npx",
81
+ "args": ["dbgraph", "serve", "--auto-refresh"]
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ **Codex CLI** (`~/.codexclirc.json`):
88
+ ```json
89
+ {
90
+ "mcpServers": {
91
+ "dbgraph": {
92
+ "type": "local",
93
+ "command": ["npx", "dbgraph", "serve", "--auto-refresh"]
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
46
99
  ## Why DBGraph?
47
100
 
48
101
  LLMs write wrong SQL because they **don't know your schema** — guessing table names, column names, and JOIN conditions. DBGraph extracts your complete database schema (tables, columns, types, foreign keys, constraints, indexes) into a **searchable knowledge graph** stored in `.dbgraph/`. AI agents query it via MCP tools directly — no live database connection needed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbgraph",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Database knowledge graph for LLM-powered SQL generation. Introspect database schemas into a local-first knowledge graph, exposed over MCP.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",