run402-mcp
Enables users to provision, manage, and query AI-native Postgres databases directly from MCP-compatible clients using x402 micropayments. It supports executing SQL, performing REST API interactions via PostgREST, and managing database leases and file storage.
README
<p align="center"> <img src=".github/logo.svg" width="120" alt="run402 logo"> </p>
<h1 align="center">run402 — MCP Server, CLI & OpenClaw Skill</h1>
Developer tools for Run402 — provision Postgres databases, deploy static sites, serverless functions, generate images, and manage x402 wallets. Available as an MCP server, an OpenClaw skill, and a CLI.
English | 简体中文
Integrations
| Interface | Use when... |
|---|---|
cli/ |
Terminal, scripts, CI/CD |
openclaw/ |
OpenClaw agent (no MCP required) |
| MCP server (this package) | Claude Desktop, Cursor, Cline, Claude Code |
Quick Start
npx run402-mcp
MCP Tools
| Tool | Description |
|---|---|
provision_postgres_project |
Provision a Postgres database. Handles x402 payment. Saves credentials locally. |
run_sql |
Execute SQL (DDL or queries). Returns markdown table. |
rest_query |
Query/mutate via PostgREST. GET/POST/PATCH/DELETE with query params. |
setup_rls |
Apply row-level security templates to tables. |
get_schema |
Introspect database schema — tables, columns, types, constraints, RLS policies. |
get_usage |
Get project usage report — API calls, storage, limits, lease expiry. |
upload_file |
Upload text content to project storage. |
download_file |
Download a file from project storage. |
delete_file |
Delete a file from project storage. |
list_files |
List files in a storage bucket. |
deploy_function |
Deploy a serverless function (Node 22) to a project. |
invoke_function |
Invoke a deployed function via HTTP. |
get_function_logs |
Get recent logs from a deployed function. |
list_functions |
List all deployed functions for a project. |
delete_function |
Delete a deployed function. |
set_secret |
Set a project secret. Injected as process.env in functions. |
list_secrets |
List secret keys for a project (values not shown). |
delete_secret |
Delete a secret from a project. |
deploy_site |
Deploy static site. $0.05/deployment. Returns live URL. |
claim_subdomain |
Claim custom subdomain (e.g. myapp.run402.com). Free. |
delete_subdomain |
Release a subdomain. |
list_subdomains |
List all subdomains claimed by a project. |
bundle_deploy |
One-call full-stack deploy: database + migrations + RLS + secrets + functions + site + subdomain. |
browse_apps |
Browse public apps available for forking. |
fork_app |
Fork a published app into a new project. |
publish_app |
Publish a project as a forkable app. |
list_versions |
List published versions of a project. |
get_quote |
Get tier pricing. Free, no auth required. |
renew_project |
Renew lease. Handles x402 payment. |
archive_project |
Archive a project and remove from local key store. |
check_balance |
Check billing account balance for a wallet address. |
list_projects |
List all active projects for a wallet address. |
wallet_status |
Check local wallet status — address, network, funding. |
wallet_create |
Create a new local wallet (Base Sepolia testnet). |
wallet_export |
Export the local wallet address. |
request_faucet |
Request free testnet USDC from the Run402 faucet. |
generate_image |
Generate a PNG image from a text prompt. $0.03 via x402. |
Client Configuration
CLI
A standalone CLI is available in the cli/ directory.
npm install -g run402
run402 wallet create
run402 wallet fund
run402 deploy --tier prototype --manifest app.json
See cli/README.md for full usage.
OpenClaw
A standalone skill is available in the openclaw/ directory — no MCP server required. It calls the Run402 API directly via Node.js scripts.
cp -r openclaw ~/.openclaw/skills/run402
cd ~/.openclaw/skills/run402/scripts && npm install
See openclaw/README.md for details.
MCP Clients
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"run402": {
"command": "npx",
"args": ["-y", "run402-mcp"]
}
}
}
Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"run402": {
"command": "npx",
"args": ["-y", "run402-mcp"]
}
}
}
Cline
Add to Cline MCP settings:
{
"mcpServers": {
"run402": {
"command": "npx",
"args": ["-y", "run402-mcp"]
}
}
}
Claude Code
claude mcp add run402 -- npx -y run402-mcp
How It Works
- Provision — Call
provision_postgres_projectto create a database. The server handles x402 payment negotiation and stores credentials locally. - Build — Use
run_sqlto create tables,rest_queryto insert/query data, andupload_filefor storage. - Deploy — Use
deploy_sitefor static sites,deploy_functionfor serverless functions, orbundle_deployfor a full-stack app in one call. - Renew — Call
renew_projectbefore your lease expires.
Payment Flow
Provisioning, renewing, site deployment, bundle deploy, and image generation require x402 micropayments. When payment is needed, tools return payment details (not errors) so the LLM can reason about them and guide the user through payment.
Key Storage
Project credentials are saved to ~/.config/run402/projects.json with 0600 permissions. Each project stores:
anon_key— for public-facing queries (respects RLS)service_key— for admin operations (bypasses RLS)tier— prototype, hobby, or teamexpires_at— lease expiration timestamp
Environment Variables
| Variable | Default | Description |
|---|---|---|
RUN402_API_BASE |
https://api.run402.com |
API base URL |
RUN402_CONFIG_DIR |
~/.config/run402 |
Config directory for key storage |
Development
npm run build # tsc → dist/
npm test # all tests (SKILL + sync + unit)
npm run test:sync # check MCP/CLI/OpenClaw stay in sync
npm run test:skill # validate SKILL.md structure
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。