run402-mcp 3.7.5 → 3.7.6
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.md +4 -5
- package/package.json +1 -1
- package/sdk/README.md +4 -5
- package/README.zh-CN.md +0 -169
package/README.md
CHANGED
|
@@ -16,15 +16,16 @@
|
|
|
16
16
|
|
|
17
17
|
This monorepo ships every surface an agent can pick up:
|
|
18
18
|
|
|
19
|
-
|
|
|
19
|
+
| Surface | Use when… |
|
|
20
20
|
|---------|-----------|
|
|
21
21
|
| [`@run402/sdk`](./sdk/) | Calling Run402 from TypeScript — typed kernel, isomorphic (Node 22 / Deno / Bun / V8 isolates) with a Node entry that auto-loads the local keystore + allowance + x402 fetch |
|
|
22
22
|
| [`run402` CLI](./cli/) | Terminal, scripts, CI, agent-controlled shells — JSON in, JSON out, exit code on failure |
|
|
23
23
|
| [`run402-mcp`](./src/) | Claude Desktop, Cursor, Cline, Claude Code — core Run402 operations as MCP tools |
|
|
24
24
|
| [OpenClaw skill](./openclaw/) | OpenClaw agents (no MCP server required) |
|
|
25
25
|
| [`@run402/functions`](https://www.npmjs.com/package/@run402/functions) | Imported _inside_ deployed functions (`db(req?)`, `adminDb()`, `auth.user()`, `email`, `ai`, `assets`) and for TypeScript autocomplete in your editor. Source lives in the public [`run402-core`](https://github.com/kychee-com/run402-core) repo under `packages/functions`; Run402 Cloud consumes the published npm package when it bundles function zips. |
|
|
26
|
+
| [`@run402/astro`](./astro/) | Astro integration for SSR, ISR cache, hosted auth components, and image variants |
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
These interfaces share a single typed kernel where appropriate: `@run402/sdk`. MCP tools, CLI subcommands, and OpenClaw scripts are thin shims over SDK calls. `@run402/functions` is the in-function helper that runs inside deployed code; the npm package on the registry is the artifact Cloud bundles. `@run402/astro` layers the SDK and functions runtime into Astro's build and SSR flow. Pick whichever interface fits your runtime.
|
|
28
29
|
|
|
29
30
|
## 30-second start
|
|
30
31
|
|
|
@@ -235,7 +236,7 @@ jobs:
|
|
|
235
236
|
steps:
|
|
236
237
|
- uses: actions/checkout@v4
|
|
237
238
|
- name: Deploy to run402
|
|
238
|
-
run: npx --yes run402@
|
|
239
|
+
run: npx --yes run402@3.7.5 deploy apply --manifest 'run402.deploy.json' --project 'prj_...'
|
|
239
240
|
```
|
|
240
241
|
|
|
241
242
|
CI deploys are intentionally narrow: `site`, `functions`, `database`, absent/current `base`, and route declarations only when the binding has covering `--route-scope` patterns. Without route scopes, CI cannot ship `routes`. Keep secrets, domains, subdomains, checks, non-current base, and broader trust changes in a local allowance-backed deploy. If the gateway returns `CI_ROUTE_SCOPE_DENIED`, re-link with exact scopes like `/admin` or final-wildcard scopes like `/api/*`, or deploy locally. Manage bindings with `run402 ci list` and `run402 ci revoke`.
|
|
@@ -617,8 +618,6 @@ Architecture: every tool / subcommand / skill script is a thin shim over an `@ru
|
|
|
617
618
|
- Status: <https://api.run402.com/status>
|
|
618
619
|
- Health: <https://api.run402.com/health>
|
|
619
620
|
|
|
620
|
-
[简体中文](./README.zh-CN.md)
|
|
621
|
-
|
|
622
621
|
## License
|
|
623
622
|
|
|
624
623
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402-mcp",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.6",
|
|
4
4
|
"description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
package/sdk/README.md
CHANGED
|
@@ -182,7 +182,7 @@ classify a field by the SHAPE it belongs to:
|
|
|
182
182
|
every `DeployEvent` variant's discriminator (`type`, plus per-variant
|
|
183
183
|
fields like `releaseId`, `urls`).
|
|
184
184
|
|
|
185
|
-
This split is intentional and
|
|
185
|
+
This split is intentional and stable across the `3.x` line. Doc examples in this
|
|
186
186
|
README and in `llms-sdk.txt` use the exact field names the types export —
|
|
187
187
|
copy them verbatim. CI fails any TypeScript-fenced example that accesses a
|
|
188
188
|
field that does not exist on the actual type.
|
|
@@ -680,19 +680,18 @@ The SDK never calls `process.exit`. Each interface (MCP tools, CLI, your code) w
|
|
|
680
680
|
|
|
681
681
|
## Stability
|
|
682
682
|
|
|
683
|
-
This package is on the `
|
|
683
|
+
This package is on the `3.x` line. The in-repo packages (`@run402/sdk`, `run402`, and `run402-mcp`) release in lockstep at the same version. Pin an exact version in production dependencies. `@run402/functions` and `@run402/astro` have independent release cadences.
|
|
684
684
|
|
|
685
685
|
## Other interfaces
|
|
686
686
|
|
|
687
|
-
`@run402/sdk` is the kernel that powers
|
|
687
|
+
`@run402/sdk` is the kernel that powers the CLI/MCP/OpenClaw edges and is used by adjacent integrations:
|
|
688
688
|
|
|
689
689
|
- [`run402`](https://www.npmjs.com/package/run402) — CLI (terminal / scripts / CI)
|
|
690
690
|
- [`run402-mcp`](https://www.npmjs.com/package/run402-mcp) — MCP server (Claude Desktop / Cursor / Cline / Claude Code)
|
|
691
691
|
- [`@run402/functions`](https://www.npmjs.com/package/@run402/functions) — in-function helper imported _inside_ deployed functions
|
|
692
|
+
- [`@run402/astro`](https://www.npmjs.com/package/@run402/astro) — Astro SSR, ISR cache, hosted auth, and image integration
|
|
692
693
|
- OpenClaw skill — script-based skill for OpenClaw agents
|
|
693
694
|
|
|
694
|
-
All five release in lockstep.
|
|
695
|
-
|
|
696
695
|
## Links
|
|
697
696
|
|
|
698
697
|
- HTTP API reference: <https://run402.com/llms.txt>
|
package/README.zh-CN.md
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
# run402-mcp
|
|
2
|
-
|
|
3
|
-
[Run402](https://run402.com) 的 MCP 服务器 — 从任何 MCP 兼容客户端创建和管理 AI 原生 Postgres 数据库。
|
|
4
|
-
|
|
5
|
-
> **免费试用 7 天完整后端(测试网)。进阶/团队版可用 USDC 或 Stripe 支付。**
|
|
6
|
-
> 数据库 + REST API + 鉴权 + 存储 + 静态站点 + 函数。无需云账号。
|
|
7
|
-
|
|
8
|
-
[English](./README.md) | 简体中文
|
|
9
|
-
|
|
10
|
-
## 快速开始
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npx run402-mcp
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## 工具列表
|
|
17
|
-
|
|
18
|
-
| 工具 | 说明 |
|
|
19
|
-
|------|------|
|
|
20
|
-
| `provision_postgres_project` | 创建新的 Postgres 数据库(prototype/hobby/team 等级) |
|
|
21
|
-
| `run_sql` | 对项目执行 SQL(DDL 或查询) |
|
|
22
|
-
| `rest_query` | 通过 PostgREST 查询/修改数据 |
|
|
23
|
-
| `renew_project` | 续期数据库租约 |
|
|
24
|
-
| `deploy_site` | 部署静态 HTML/CSS/JS 站点 |
|
|
25
|
-
| `deploy_function` | 部署 Node 22 Serverless 函数 |
|
|
26
|
-
| `invoke_function` | 调用已部署的函数 |
|
|
27
|
-
| `get_function_logs` | 获取函数日志,可按 `since` 和 routed `request_id` 过滤 |
|
|
28
|
-
| `set_secret` | 设置函数环境变量 |
|
|
29
|
-
|
|
30
|
-
## 定价
|
|
31
|
-
|
|
32
|
-
| 等级 | 价格 | 租期 | 存储 | API 调用 |
|
|
33
|
-
|------|------|------|------|----------|
|
|
34
|
-
| Prototype 原型 | 免费(测试网) | 7 天 | 250 MB | 50 万次 |
|
|
35
|
-
| Hobby 进阶 | $5 / ¥36 | 30 天 | 1 GB | 500 万次 |
|
|
36
|
-
| Team 团队 | $20 / ¥145 | 30 天 | 10 GB | 5000 万次 |
|
|
37
|
-
|
|
38
|
-
仅创建和续期需要付款。后续 REST/鉴权/存储请求使用返回的密钥,无需额外付费。
|
|
39
|
-
|
|
40
|
-
## 客户端配置
|
|
41
|
-
|
|
42
|
-
### Claude Desktop
|
|
43
|
-
|
|
44
|
-
添加到 `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"mcpServers": {
|
|
49
|
-
"run402": {
|
|
50
|
-
"command": "npx",
|
|
51
|
-
"args": ["-y", "run402-mcp"]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Cursor
|
|
58
|
-
|
|
59
|
-
添加到项目中的 `.cursor/mcp.json`:
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"mcpServers": {
|
|
64
|
-
"run402": {
|
|
65
|
-
"command": "npx",
|
|
66
|
-
"args": ["-y", "run402-mcp"]
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Cline
|
|
73
|
-
|
|
74
|
-
在 Cline MCP 设置中添加:
|
|
75
|
-
|
|
76
|
-
```json
|
|
77
|
-
{
|
|
78
|
-
"mcpServers": {
|
|
79
|
-
"run402": {
|
|
80
|
-
"command": "npx",
|
|
81
|
-
"args": ["-y", "run402-mcp"]
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Claude Code
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
claude mcp add run402 -- npx -y run402-mcp
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### OpenClaw
|
|
94
|
-
|
|
95
|
-
Run402 已发布为 OpenClaw Skill。支持所有 OpenClaw 兼容的模型和平台,包括:
|
|
96
|
-
|
|
97
|
-
- **豆包 Doubao**(字节跳动 ArkClaw)
|
|
98
|
-
- **Kimi**(月之暗面)
|
|
99
|
-
- **GLM**(智谱)
|
|
100
|
-
- **MiniMax**
|
|
101
|
-
|
|
102
|
-
## 工作流程
|
|
103
|
-
|
|
104
|
-
1. **创建项目** — 调用 `provision_postgres_project` 创建数据库。服务器自动处理 x402 支付协商,并在本地保存凭证。
|
|
105
|
-
2. **构建应用** — 用 `run_sql` 创建表结构,`rest_query` 插入/查询数据,`blob_put` 管理文件存储。
|
|
106
|
-
3. **部署上线** — 用 `deploy_site` 部署前端,`deploy_function` 部署后端函数。
|
|
107
|
-
4. **续期维护** — 在租约到期前调用 `renew_project`。
|
|
108
|
-
|
|
109
|
-
### 支付流程
|
|
110
|
-
|
|
111
|
-
创建和续期需要 x402 微支付。当需要付款时,工具会返回支付详情(而不是错误),以便 LLM 可以分析并引导用户完成支付。
|
|
112
|
-
|
|
113
|
-
### 密钥存储
|
|
114
|
-
|
|
115
|
-
项目凭证保存在 `~/.config/run402/projects.json`(权限 `0600`)。每个项目存储:
|
|
116
|
-
- `anon_key` — 公开查询用(遵循行级安全策略)
|
|
117
|
-
- `service_key` — 管理操作用(绕过行级安全策略)
|
|
118
|
-
- `tier` — prototype、hobby 或 team
|
|
119
|
-
- `expires_at` — 租约到期时间
|
|
120
|
-
|
|
121
|
-
## 智能体额度(Agent Allowance)
|
|
122
|
-
|
|
123
|
-
> 给智能体一个额度,不是钱包。
|
|
124
|
-
|
|
125
|
-
Run402 支持预付费、硬限额的智能体额度模式:
|
|
126
|
-
- **预付制** — 像充值卡一样预存额度
|
|
127
|
-
- **硬限额** — 智能体不会超支
|
|
128
|
-
- **可撤销** — 随时暂停或取消
|
|
129
|
-
- **可追溯** — 每笔交易都有记录
|
|
130
|
-
|
|
131
|
-
了解更多:[run402.com/agent-allowance](https://run402.com/agent-allowance)
|
|
132
|
-
|
|
133
|
-
## 应用模板(一键复制)
|
|
134
|
-
|
|
135
|
-
Run402 上的公开应用可以一键复制(Fork),每个副本拥有独立的数据库、鉴权、存储和 URL。
|
|
136
|
-
|
|
137
|
-
- 浏览可用应用:[run402.com/apps](https://run402.com/apps)
|
|
138
|
-
- API:`GET https://api.run402.com/v1/apps`
|
|
139
|
-
- 复制应用:`POST /v1/fork/:tier` + `{ "version_id": "...", "name": "my-copy" }`
|
|
140
|
-
|
|
141
|
-
模板发布者可获得下游实例续费的 **20% 持续分成**。
|
|
142
|
-
|
|
143
|
-
## 环境变量
|
|
144
|
-
|
|
145
|
-
| 变量 | 默认值 | 说明 |
|
|
146
|
-
|------|--------|------|
|
|
147
|
-
| `RUN402_API_BASE` | `https://api.run402.com` | API 基础 URL |
|
|
148
|
-
| `RUN402_CONFIG_DIR` | `~/.config/run402` | 密钥存储目录 |
|
|
149
|
-
|
|
150
|
-
## 相关链接
|
|
151
|
-
|
|
152
|
-
- **中文落地页**:[run402.com/zh-cn](https://run402.com/zh-cn)
|
|
153
|
-
- **完整 API 文档**:[run402.com/llms.txt](https://run402.com/llms.txt)
|
|
154
|
-
- **OpenAPI 规范**:[run402.com/openapi.json](https://run402.com/openapi.json)
|
|
155
|
-
- **应用市场**:[run402.com/apps](https://run402.com/apps)
|
|
156
|
-
- **API 状态**:[api.run402.com/health](https://api.run402.com/health)
|
|
157
|
-
- **npm**:[npmjs.com/package/run402-mcp](https://www.npmjs.com/package/run402-mcp)
|
|
158
|
-
- **GitHub**:[github.com/kychee-com/run402](https://github.com/kychee-com/run402)
|
|
159
|
-
|
|
160
|
-
## 开发
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
npm run build
|
|
164
|
-
npm run test:skill
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## 许可证
|
|
168
|
-
|
|
169
|
-
MIT
|