base44-remote-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Vendored from base44-dev/apper PR #11608 (docs/features/bring-your-own-model/base44-remote-dev/SKILL.md). Keep in sync with the upstream source if it changes. -->
<!-- 源自 base44-dev/apper PR #11608 (docs/features/bring-your-own-model/base44-remote-dev/SKILL.md)。 若上游源更新,请保持同步。 -->

Remotely develop a Base44 app over MCP

通过MCP远程开发Base44应用

Connect your own coding agent to a Base44 app's sandbox and develop in it directly — run commands, read and edit files, grep, list directories — while Base44 supplies the sandbox and you supply the agent and the LLM.
This works with any MCP-capable client. The examples use Claude Code.
Easiest start: in the Base44 app editor, click Send to Coding Agent. For a local agent it gives you a ready-to-paste prompt (which fetches a README and drives the sandbox over MCP or the
base44 sandbox
CLI — Section 10); for the web it gives a prompt to paste into a claude.ai chat (with the Base44 MCP connector) plus an Open Claude button. The button is the discovery surface — the rest of this skill is the reference.
Two transports: web agents use claude.ai with the Base44 MCP connector (Sections 1–9) — note this is the regular claude.ai chat, not Claude Code on the web (
claude.ai/code
), which runs in its own repo-backed sandbox. A local agent can connect that same MCP server, or drive the sandbox with the
base44 sandbox
CLI
(a Base44 CLI token, Section 10) — same tools, same behavior, same error codes; the CLI just exposes them under shorter command names (
sandbox read
,
sandbox ls
, …).

将你自己的编码代理连接到Base44应用的沙箱,直接在其中进行开发——运行命令、读写文件、grep检索、列出目录——由Base44提供沙箱,你提供代理和大语言模型(LLM)。
此功能适用于任何支持MCP的客户端,示例中使用Claude Code。
最简入门方式: 在Base44应用编辑器中,点击发送至编码代理。对于本地代理,它会提供一个可直接粘贴的提示(该提示会获取一份README,并通过MCP或
base44 sandbox
CLI操作沙箱——详见第10节); 对于网页端代理,它会提供一个可粘贴到claude.ai聊天框的提示(搭配Base44 MCP连接器),以及一个打开Claude按钮。该按钮是入口,本文其余内容为参考文档。
两种传输方式: 网页端代理使用claude.ai搭配Base44 MCP连接器(第1-9节)——注意这是常规的claude.ai聊天,不是网页端的Claude Code(
claude.ai/code
),后者运行在自身的仓库沙箱中。本地代理可连接同一MCP服务器,或通过**
base44 sandbox
CLI**(需Base44 CLI令牌,第10节)操作沙箱——工具、行为、错误码完全一致;只是CLI使用更短的命令名称(
sandbox read
sandbox ls
等)。

1. Connect the MCP server

1. 连接MCP服务器

The Base44 MCP endpoint is:
https://app.base44.com/mcp
Register it with Claude Code (run from any folder):
bash
claude mcp add --transport http base44 https://app.base44.com/mcp
Add
--scope user
if you want it available in every project rather than just the current folder.
claude mcp add
only writes the config — it does not authenticate yet.
Base44的MCP端点为:
https://app.base44.com/mcp
在Claude Code中注册该端点(可在任意文件夹下运行):
bash
claude mcp add --transport http base44 https://app.base44.com/mcp
若希望在所有项目中都可用,而非仅当前文件夹,可添加
--scope user
参数。
claude mcp add
仅写入配置——不会立即进行认证。

2. Authenticate

2. 认证

Start Claude Code and open the MCP menu:
bash
claude
then, inside Claude Code:
/mcp
Select base44Authenticate. A browser opens for the Base44 OAuth flow (PKCE) — log in and approve. When it succeeds,
/mcp
shows base44 as connected and lists its tools.
Pure-CLI / headless clients that can't open a browser use the OAuth device flow (
/oauth/device/code
) instead — request a code, approve it in a browser on another device, and the client receives the token.
启动Claude Code并打开MCP菜单:
bash
claude
然后在Claude Code内部执行:
/mcp
选择base44Authenticate。浏览器会打开Base44的OAuth流程(PKCE)——登录并授权。成功后,
/mcp
会显示base44已连接,并列出其可用工具。
纯CLI/无头客户端无法打开浏览器,需使用OAuth设备流(
/oauth/device/code
)——请求一个验证码,在另一设备的浏览器中授权,客户端将收到令牌。

Scopes

权限范围

ToolsRequired scope
read_file
,
grep
,
list_directory
,
get_app_preview_url
,
get_app_status
,
list_user_apps
apps:read
(granted by default)
write_file
,
edit_file
,
run_command
,
create_checkpoint
sandbox:write
sandbox:write
is not granted by default — shell and file mutation require it explicitly. If the read tools work but the mutating ones return
NOT_AUTHORIZED
, your token is missing
sandbox:write
; reconnect and grant sandbox access (the device flow can request it explicitly).

工具所需权限范围
read_file
,
grep
,
list_directory
,
get_app_preview_url
,
get_app_status
,
list_user_apps
apps:read
(默认授予)
write_file
,
edit_file
,
run_command
,
create_checkpoint
sandbox:write
sandbox:write
不会默认授予——Shell操作和文件修改需要显式授权。若只读工具正常工作,但修改类工具返回
NOT_AUTHORIZED
,说明你的令牌缺少
sandbox:write
权限;重新连接并授予沙箱访问权限(设备流可显式请求该权限)。

3. Pick the app and orient yourself

3. 选择应用并熟悉环境

Every tool takes a required
appId
. Find your apps with
list_user_apps
, then pin the id in your requests so the agent passes it on every call.
Start read-only to build a mental model before changing anything:
Using the base44 tools on appId <APP_ID>:
1. list_directory on the app root (recursive, depth 2)
2. read_file src/App.jsx and src/pages.config.js
3. grep for the component I want to change
Summarize the structure before editing.
Cold start: if the app has no running sandbox, the first tool call transparently brings one up from your last commit — it just takes a bit longer. Subsequent calls are fast.
CLI names: over the
base44 sandbox
CLI (Section 10) these read tools are
list_directory
sandbox ls
,
read_file
sandbox read
, and
grep
sandbox grep
.

每个工具都需要必填参数
appId
。使用
list_user_apps
查找你的应用,然后在请求中固定该ID,以便代理在每次调用时传递。
在进行任何修改前,先以只读模式构建对应用的认知:
使用base44工具操作appId <APP_ID>:
1. 递归列出应用根目录(深度2)
2. 读取src/App.jsx和src/pages.config.js文件
3. 检索我想要修改的组件
在编辑前总结应用结构。
冷启动: 如果应用没有运行中的沙箱,首次工具调用会自动从你上次提交的内容启动沙箱——仅需稍作等待。后续调用速度会很快。
CLI命令名称: 通过
base44 sandbox
CLI(第10节)操作时,这些只读工具对应:
list_directory
sandbox ls
read_file
sandbox read
grep
sandbox grep

4. Make changes

4. 进行修改

  • edit_file
    (
    sandbox edit
    in the CLI) — preferred for changing existing files. Provide exact
    old_text
    new_text
    edits. Each
    old_text
    must be unique in the file unless you set
    replace_all
    . All edits in a call apply atomically (all-or-nothing) and you get a unified diff back. Pass
    dry_run: true
    to preview the diff without writing.
  • write_file
    (
    sandbox write
    in the CLI) — for creating new files. To overwrite an existing file you must pass
    overwrite: true
    (it never silently clobbers).
  • run_command
    (
    sandbox run
    in the CLI) — run any bash command in the sandbox (build, install, scaffolding, codemods). The working directory defaults to the app root;
    cd
    does not persist across calls, so use the
    cwd
    parameter or chain commands (
    cd sub && cmd
    ). Timeout defaults to 120s (max 600s); output is capped at ~1 MB.
  • create_checkpoint
    (
    sandbox checkpoint
    in the CLI) — save a named restore point the user can later roll back to. Takes an optional
    name
    (message/title; auto-generated if omitted). Any pending changes are flushed and committed first so the checkpoint anchors to your latest code; it then returns the checkpoint id, name, and git commit hash. Use it to mark a known-good state before or after a chunk of edits. (If a recent auto-commit can't be confirmed durable yet, it refuses with the retryable
    COMMIT_FLUSH_PENDING
    rather than checkpoint stale state — retry shortly.)
Example:
On appId <APP_ID>, use edit_file to change the homepage heading in
src/pages/Home.jsx from "Welcome" to "Welcome back". Show me the diff first
with dry_run, then apply it.

  • edit_file
    (CLI中为
    sandbox edit
    )——修改现有文件的首选方式。提供精确的
    old_text
    new_text
    编辑内容。除非设置
    replace_all
    ,否则每个
    old_text
    在文件中必须唯一。单次调用中的所有编辑会原子性生效(要么全部成功,要么全部失败),并返回统一的差异结果。传递
    dry_run: true
    可预览差异而不写入文件。
  • write_file
    (CLI中为
    sandbox write
    )——用于创建新文件。若要覆盖现有文件,必须传递
    overwrite: true
    (不会静默覆盖)。
  • run_command
    (CLI中为
    sandbox run
    )——在沙箱中运行任意bash命令(构建、安装、脚手架、代码转换等)。工作目录默认为应用根目录;
    cd
    命令不会在调用间持久生效,因此需使用
    cwd
    参数或链式命令(
    cd sub && cmd
    )。默认超时时间为120秒(最长600秒);输出上限约为1MB。
  • create_checkpoint
    (CLI中为
    sandbox checkpoint
    )——保存一个命名的恢复点,用户后续可回滚到该状态。可选参数
    name
    (消息/标题;若省略则自动生成)。创建前会先刷新并提交所有待处理变更,以便检查点锚定到最新代码;随后返回检查点ID、名称和Git提交哈希。在进行大量编辑前后,使用它标记已知的良好状态。(若最近的自动提交尚未确认持久化,会返回可重试的
    COMMIT_FLUSH_PENDING
    错误,而非基于过时状态创建检查点——稍后重试即可。)
示例:
针对appId <APP_ID>,使用edit_file将src/pages/Home.jsx中的主页标题从"Welcome"修改为"Welcome back"。先通过dry_run显示差异,再应用修改。

5. Preview and verify (the edit → check loop)

5. 预览与验证(编辑→检查循环)

There is no live log-streaming tool, but you can close the feedback loop:
  • See it live:
    get_app_preview_url
    brings up the dev server and returns the preview URL. Vite HMR reflects your edits as you make them.
  • Build status:
    get_app_status
    returns
    ready
    /
    processing
    /
    error
    .
  • Surface build/type/lint errors on demand with
    run_command
    :
    bash
    npm run build       # bundler/compile errors
    npx tsc --noEmit    # type errors
    npm run lint        # lint errors
  • Read the dev-server (Vite) logs — the managed dev server writes to
    /tmp/vite.log
    . Tail it via
    run_command
    to see HMR/compile errors:
    bash
    tail -c 32000 /tmp/vite.log
    (This is outside the app tree, so it's only reachable through
    run_command
    , not the file tools — and therefore needs
    sandbox:write
    .)
A solid loop:
edit_file
npm run build
(or tail
/tmp/vite.log
) → fix any errors →
get_app_preview_url
to eyeball it.
Browser-runtime errors (a component that compiles but throws on render, a failing client API call) appear in the browser console, not in
/tmp/vite.log
. Open the preview URL to catch those.

虽然没有实时日志流工具,但你可以形成反馈闭环:
  • 实时查看:
    get_app_preview_url
    会启动开发服务器并返回预览URL。Vite HMR会在你进行编辑时实时反映变更。
  • 构建状态:
    get_app_status
    返回
    ready
    /
    processing
    /
    error
  • 按需查看构建/类型检查/ lint错误:使用
    run_command
    执行:
    bash
    npm run build       # 打包/编译错误
    npx tsc --noEmit    # 类型错误
    npm run lint        # lint错误
  • 读取开发服务器(Vite)日志——托管的开发服务器会写入
    /tmp/vite.log
    。通过
    run_command
    查看尾部内容,了解HMR/编译错误:
    bash
    tail -c 32000 /tmp/vite.log
    (该文件位于应用目录外,因此只能通过
    run_command
    访问,无法通过文件工具操作——因此需要
    sandbox:write
    权限。)
可靠的循环流程:
edit_file
npm run build
(或查看
/tmp/vite.log
尾部)→ 修复错误 →
get_app_preview_url
直观验证。
浏览器运行时错误(编译通过但渲染时抛出的组件错误、失败的客户端API调用)会显示在浏览器控制台中,而非
/tmp/vite.log
。打开预览URL即可捕获此类错误。

6. How your changes persist

6. 变更的持久化方式

You don't need to "save." Every mutating call schedules a debounced auto-commit (~5 seconds): the change is committed and pushed to Base44's code storage, so it:
  • survives sandbox death (the sandbox is recreated from the last commit),
  • appears in the builder's Library/Data tabs,
  • keeps backend-function deploys consistent, and
  • is included when you publish the app.
Practical implications:
  • There's a small loss window (~5s) — don't kill the session immediately after the last edit; give it a moment to commit.
  • Edits to entities, agents, workflows, backend functions, and page routing are synced into Base44 automatically after the commit. Plain page/component/CSS edits live in git and need nothing extra.

你无需手动「保存」。每次修改调用都会触发防抖自动提交(约5秒):变更会被提交并推送到Base44的代码存储中,因此:
  • 即使沙箱终止,变更也会保留(沙箱会从上次提交的内容重新创建),
  • 变更会显示在构建器的Library/Data标签页中,
  • 确保后端函数部署的一致性,
  • 发布应用时会包含这些变更。
实际影响:
  • 存在一个小的丢失窗口(约5秒)——不要在最后一次编辑后立即终止会话;给它一点时间完成提交。
  • 对实体、Agent、工作流、后端函数和页面路由的编辑会在提交后自动同步到Base44中。普通页面/组件/CSS编辑存储在Git中,无需额外操作。

7. Concurrency: you vs. the Base44 builder

7. 并发:你与Base44构建器

You and the in-app Base44 builder can't mutate the same app at once:
  • While you're actively using the sandbox tools, the Base44 builder chat is blocked ("An external agent is currently working on this app"). Your session is implicit — recent tool calls are the session; it ends after a short idle period (~10 min).
  • If the Base44 builder is mid-build, your mutating tools return
    BUILDER_BUSY
    . Poll
    get_app_status
    and retry once it's
    ready
    . Read-only tools still work during a build.

你和Base44应用内构建器无法同时修改同一应用:
  • 当你正在使用沙箱工具时,Base44构建器聊天会被阻止(「外部代理当前正在处理此应用」)。你的会话是隐式的——最近的工具调用即代表会话;闲置一段时间后(约10分钟)会话结束。
  • 如果Base44构建器正在构建中,你的修改类工具会返回
    BUILDER_BUSY
    。轮询
    get_app_status
    ,当状态变为
    ready
    后重试。构建期间只读工具仍可正常使用。

8. Guardrails & limits

8. 防护措施与限制

  • Paths are confined to the app. File tools operate only within the app directory; traversal/absolute paths are rejected (
    PATH_OUTSIDE_SANDBOX
    ).
  • .agents/
    is off-limits to file tools
    (
    PROTECTED_PATH
    ) — it holds agent-managed config and secrets (
    .agents/.env
    ). Don't try to read or edit it through the file tools.
  • Rate limits apply per app: reads ~120/min, mutations ~60/min, commands ~30/min. If you hit
    RATE_LIMITED
    , slow down.
  • delete_file
    isn't a dedicated tool
    — delete via
    run_command rm
    .
  • 路径限制在应用内部。文件工具仅能在应用目录内操作;遍历/绝对路径会被拒绝(
    PATH_OUTSIDE_SANDBOX
    )。
  • .agents/
    目录禁止文件工具访问
    PROTECTED_PATH
    )——该目录包含代理管理的配置和密钥(
    .agents/.env
    )。不要尝试通过文件工具读取或编辑该目录。
  • 速率限制:每个应用的读取操作约120次/分钟,修改操作约60次/分钟,命令操作约30次/分钟。若收到
    RATE_LIMITED
    错误,请降低操作频率。
  • 没有专门的
    delete_file
    工具
    ——通过
    run_command rm
    命令删除文件。

Error codes you may see

可能遇到的错误码

NOT_AUTHORIZED
(missing scope/flag) ·
APP_NOT_FOUND
(wrong id or no access) ·
PATH_OUTSIDE_SANDBOX
·
PROTECTED_PATH
·
NOT_FOUND
·
BINARY_FILE
·
EDIT_TEXT_NOT_FOUND
·
EDIT_TEXT_NOT_UNIQUE
(make
old_text
unique or use
replace_all
) ·
OVERWRITE_NOT_ALLOWED
(pass
overwrite: true
) ·
TIMEOUT
·
OUTPUT_TRUNCATED
·
BUILDER_BUSY
·
COMMIT_FLUSH_PENDING
(a pending auto-commit isn't durable yet; retry shortly — e.g. on
create_checkpoint
) ·
RATE_LIMITED
·
BACKEND_ERROR
.
Messages are written so the agent can self-correct — read them and adjust.

NOT_AUTHORIZED
(缺少权限范围/标志)·
APP_NOT_FOUND
(ID错误或无访问权限) ·
PATH_OUTSIDE_SANDBOX
·
PROTECTED_PATH
·
NOT_FOUND
·
BINARY_FILE
·
EDIT_TEXT_NOT_FOUND
·
EDIT_TEXT_NOT_UNIQUE
(使
old_text
唯一或使用
replace_all
)·
OVERWRITE_NOT_ALLOWED
(传递
overwrite: true
)·
TIMEOUT
·
OUTPUT_TRUNCATED
·
BUILDER_BUSY
·
COMMIT_FLUSH_PENDING
(待处理的自动提交尚未持久化;稍后重试——例如在
create_checkpoint
时)·
RATE_LIMITED
·
BACKEND_ERROR
错误消息设计为便于代理自我修正——请阅读并调整操作。

9. Tips & tricks

9. 技巧与窍门

  • Read before you write. A quick
    list_directory
    +
    read_file
    (or
    grep
    ) pass costs little and dramatically improves edit accuracy.
  • Use
    dry_run
    on
    edit_file
    to confirm the diff before committing to a change, especially for multi-edit calls.
  • Prefer
    edit_file
    over
    write_file
    for existing files — surgical edits avoid clobbering and produce a reviewable diff.
  • Read line ranges with
    read_file
    's
    offset
    /
    limit
    on large files instead of pulling the whole thing into context.
  • When something "looks broken," tail
    /tmp/vite.log
    before guessing — it usually names the exact file and line.
  • Let it commit. Pause a few seconds after your final edit so the auto-commit lands before you disconnect or publish.
  • Checkpoint known-good states. Use
    create_checkpoint
    (
    sandbox checkpoint
    ) to mark a restore point before or after a risky chunk of edits — it flushes pending changes first, so the user can always roll back to that point.
  • One agent at a time. The feature is designed for a single external agent per app; don't run parallel sessions against the same app.

  • 先读后写。快速执行
    list_directory
    +
    read_file
    (或
    grep
    )的成本很低,但能大幅提高编辑的准确性。
  • edit_file
    中使用
    dry_run
    ——在提交变更前确认差异,尤其是多编辑调用时。
  • 修改现有文件优先使用
    edit_file
    而非
    write_file
    ——精准编辑避免覆盖,并生成可审核的差异。
  • 读取大文件时使用
    read_file
    offset
    /
    limit
    参数读取行范围
    ,而非将整个文件加载到上下文。
  • 当出现「看起来异常」的情况时,先查看
    /tmp/vite.log
    尾部
    ——它通常会明确指出问题文件和行号。
  • 等待提交完成。最后一次编辑后暂停几秒,让自动提交完成后再断开连接或发布应用。
  • 为已知良好状态创建检查点。在风险较大的编辑前后,使用
    create_checkpoint
    sandbox checkpoint
    )标记恢复点——它会先刷新待处理变更,因此用户始终可以回滚到该状态。
  • 同一时间仅使用一个代理。该功能设计为每个应用对应一个外部代理;不要针对同一应用运行并行会话。

10. Local agents via the
base44 sandbox
CLI

10. 通过
base44 sandbox
CLI使用本地代理

If your agent runs on your machine, it can drive the same sandbox through the Base44 CLI instead of MCP, authenticating with the Base44 CLI instead of OAuth. Same tools, same behavior, same error codes (Section 8) — only the surface and auth differ.
Auth. Log in with the Base44 CLI (
base44 login
) — the same credential used for
base44 functions deploy
. Like the projectless
base44 connectors
commands, the sandbox subcommands resolve the app id from
--app-id
, then
BASE44_APP_ID
, then a local
.app.jsonc
; no
config.jsonc
is required.
Command names. The CLI exposes each sandbox tool under a shorter name:
MCP toolCLI command
list_directory
base44 sandbox ls
read_file
base44 sandbox read
write_file
base44 sandbox write
edit_file
base44 sandbox edit
run_command
base44 sandbox run
grep
base44 sandbox grep
create_checkpoint
base44 sandbox checkpoint
bash
npx base44 sandbox read --app-id <APP_ID> src/App.jsx
base44 sandbox checkpoint
takes an optional
--name
(message/title) and saves a restore point:
bash
npx base44 sandbox checkpoint --app-id <APP_ID> --name "before refactor"
Hand an agent the full reference for a specific app (instructions, public, no auth needed to fetch):
https://app.base44.com/api/sandbox/<APP_ID>/local-agent/readme.md
(The cloud/MCP equivalent is
.../api/sandbox/<APP_ID>/claude-web/readme.md
.)
Everything else in this skill — the edit→preview→verify loop (Section 5), persistence (Section 6), concurrency (Section 7), and guardrails (Section 8) — applies identically; only the surface and auth differ.

如果你的代理在本地机器上运行,它可以通过Base44 CLI而非MCP操作同一沙箱,使用Base44 CLI而非OAuth进行认证。工具、行为、错误码(第8节)完全一致——仅交互方式和认证方式不同。
认证。使用Base44 CLI登录(
base44 login
)——与
base44 functions deploy
使用相同的凭据。与无项目的
base44 connectors
命令类似,沙箱子命令会从
--app-id
BASE44_APP_ID
、本地
.app.jsonc
文件中解析应用ID;无需
config.jsonc
文件。
命令名称。CLI使用更短的名称暴露每个沙箱工具:
MCP工具CLI命令
list_directory
base44 sandbox ls
read_file
base44 sandbox read
write_file
base44 sandbox write
edit_file
base44 sandbox edit
run_command
base44 sandbox run
grep
base44 sandbox grep
create_checkpoint
base44 sandbox checkpoint
bash
npx base44 sandbox read --app-id <APP_ID> src/App.jsx
base44 sandbox checkpoint
接受可选参数
--name
(消息/标题),用于保存恢复点:
bash
npx base44 sandbox checkpoint --app-id <APP_ID> --name "before refactor"
为代理提供特定应用的完整参考文档(说明文档,公开访问,无需认证即可获取):
https://app.base44.com/api/sandbox/<APP_ID>/local-agent/readme.md
(云端/MCP对应的链接为
.../api/sandbox/<APP_ID>/claude-web/readme.md
。)
本文其余内容——编辑→预览→验证循环(第5节)、持久化(第6节)、并发(第7节)、防护措施(第8节)——完全适用;仅交互方式和认证方式不同。

11. Connectors (OAuth integrations)

11. 连接器(OAuth集成)

Beyond the sandbox file/shell tools, the Base44 MCP server exposes two tools for managing a third-party OAuth connector (Google Calendar, Gmail, Slack, …) on an app. They don't touch the sandbox filesystem — they operate on the app's connector state directly. Both take
appId
.
ToolScopePurpose
list_connectors
apps:read
List the app's connectors. With no
integrationTypes
, returns the full catalog (name, description, connected?, and — if connected — status and granted scopes). Pass
integrationTypes
for detail on specific ones.
initiate_connector_connection
apps:write
Connect (or re-scope) a connector. Inputs:
appId
,
integrationType
,
scopes
, optional
connectionConfig
.
Two semantics to get right:
  • Declarative scopes (replace, not merge).
    initiate_connector_connection
    sets the connector to exactly the
    scopes
    you pass. Omitted scopes are removed and the user is re-prompted to consent. Always call
    list_connectors
    first
    , then pass the complete desired set (existing scopes you want to keep plus any new ones).
  • OAuth needs a human. The tool returns either
    already_authorized: true
    (nothing to do) or a
    redirect_url
    the user must open in a browser to sign in and consent — you can't complete it yourself. After they finish, call
    list_connectors
    again to verify and read the granted scopes (a provider may grant fewer than requested).
These need only
apps:read
/
apps:write
not
sandbox:write
. Over the CLI surface (Section 10), the equivalent is the projectless
base44 connectors
commands (
list-available
,
initiate --integration-type <t> --scopes <s...> --app-id <id>
,
pull
), which print the same authorization URL.
除沙箱文件/Shell工具外,Base44 MCP服务器还提供两个工具,用于管理应用中的第三方OAuth连接器(Google日历、Gmail、Slack等)。它们不会触及沙箱文件系统——直接操作应用的连接器状态。两个工具都需要
appId
参数。
工具权限范围用途
list_connectors
apps:read
列出应用的连接器。若未指定
integrationTypes
,返回完整目录(名称、描述、是否已连接——若已连接,还包括状态和已授予的权限范围)。传递
integrationTypes
可获取特定连接器的详细信息。
initiate_connector_connection
apps:write
连接(或重新授权)连接器。输入参数:
appId
integrationType
scopes
、可选
connectionConfig
需要注意两个语义:
  • 声明式权限范围(替换,而非合并)
    initiate_connector_connection
    会将连接器的权限范围设置为完全匹配你传递的
    scopes
    。未包含的权限范围会被移除,用户需重新授权。务必先调用
    list_connectors
    ,然后传递完整的期望权限范围(包含你想保留的现有权限范围以及任何新权限范围)。
  • OAuth需要人工操作。该工具会返回
    already_authorized: true
    (无需操作)或一个
    redirect_url
    用户必须在浏览器中打开该链接进行登录和授权——你无法自行完成此操作。用户完成后,再次调用
    list_connectors
    验证并读取已授予的权限范围(提供商可能授予的权限范围少于请求的范围)。
这些工具仅需要
apps:read
/
apps:write
权限——不需要
sandbox:write
。通过CLI(第10节)操作时,对应的是无项目的
base44 connectors
命令(
list-available
initiate --integration-type <t> --scopes <s...> --app-id <id>
pull
),这些命令会打印相同的授权URL。