---
name: mergeek-link-deploy
description: >
  Publish web applications to Mergeek Link (mergeek.com), update existing
  Mergeek-hosted Apps, and integrate Mergeek account login. Published App
  URLs remain subject to their configured access policy.
  Use only when the user explicitly chooses Mergeek, for example "deploy this
  app to mergeek.com", "publish to Mergeek" or "部署到 Mergeek", or when the
  current task has already selected Mergeek. Generic requests such as
  "上线这个应用" apply only within that established Mergeek context.
  Includes first-time registration, App selection and authorization, and
  recovery of an existing deployment.
---

# Mergeek Link publishing and App integration

Last updated: **2026-10-30 (Asia/Shanghai)**.

Fetch the current guide at the start of a task and read changes since any saved copy. This timestamp identifies documentation, not the server's deployed version. Actual tool schemas and the anonymous HTTP contract define publishing operations. The App URL's capability response versions the serving behaviors it lists; application login follows its dedicated integration guide and App-specific checks below.

Execute technical work yourself. The user completes browser login/consent, documented client loading steps and decisions requiring confirmation. Use plain language and verified instructions for the active client. Keep credentials, device codes and signed upload instructions private; the official HTTP approval link/user code may be shown.

## Choose the task

| Request | Read next | Completion |
| --- | --- | --- |
| Add or replace App login with Mergeek accounts | [Mergeek login integration](https://www.mergeek.cn/link/agent/references/mergeek-login.md) first; inspect the confirmed App's session endpoint | Browser login/logout and the App's user mapping/permissions verified; publish changes through the chosen path when requested |
| Configure application variables | [Application configuration](https://www.mergeek.cn/link/agent/references/publish.md#application-configuration), then the selected protocol | Required names configured and a reviewed deployment activates them |
| Connect or verify MCP only | [Connect and verify](https://www.mergeek.cn/link/agent/references/connect.md) | Report configuration, authorization, tools and any App check; stop without deploying |
| First release without an App ID | [Registration and App authorization](https://www.mergeek.cn/link/agent/references/onboarding.md) | Local compatibility preflight first; select protocol, confirm the App, then continue that MCP or HTTP task |
| First release with an App ID | Path selection below, then [project preparation](https://www.mergeek.cn/link/agent/references/publish.md) and one protocol flow | New Deployment is current and access/content match the configured policy |
| Update a work | [Update checklist](https://www.mergeek.cn/link/agent/references/update.md), then one protocol flow | Verify the new release and compare the original URL/version |
| Resume an existing or uncertain write | [Recovery](https://www.mergeek.cn/link/agent/references/troubleshoot.md) | Resolve the recorded attempt before any new create |

For an existing App feature task, read its feature guide before choosing implementation or probing endpoints. When publishing changes, continue through the publishing sections below.

Use a supplied `app_id` unchanged. For an update without an ID, identify and confirm an existing work through onboarding with `intent: update` (HTTP `--intent update`). For a first release without an ID, choose the publishing path below, then follow [onboarding](https://www.mergeek.cn/link/agent/references/onboarding.md): show its official confirmation link, let the user select or create the App in Studio, and receive its ID automatically.

Onboarding supports MCP and official HTTP. A working MCP connection uses `start_onboarding` / `get_onboarding`; HTTP uses the official helper or protected direct API flow. Keep the chosen protocol after confirmation unless the explicit pre-deployment fallback below applies.

Save the returned `onboarding_id` and pass it unchanged when creating this task’s Deployment. It correlates the confirmed target with the release; it is not a credential. See [identifiers and codes](https://www.mergeek.cn/link/agent/references/onboarding.md#identifiers-and-codes) for the distinct request, authorization and deployment values.

Keep a private task record outside source: App/project, original URL/current Deployment, parameters, fixed ZIP/manifest/digests, known Deployment ID and last stage. HTTP also records its Idempotency-Key. Resume from that record.

## App privacy and access

Mergeek Link hosts applications with data isolated by App. An App with a managed database uses its own database and connection credentials. Each App has a private persistent file space, accessed by its backend through Orbit Storage. Other Apps have no access through their own credentials. These are application data boundaries; application routes determine which visitors may see particular records and files.

Each Link supports three access modes, configured in Studio:

| `access_mode` | Who can open the Link |
| --- | --- |
| `public` | Anyone; application login and record permissions still apply |
| `owner_only` | The App owner, after signing in |
| `password` | Visitors who pass the Link's password gate; application login and record permissions still apply |

New Apps currently start in `public` mode. Read and preserve the confirmed App's actual mode. For a private journal or another restricted application, establish the intended Link access with the user and verify it along with the App's own data permissions. A Link password grants entry to the App; an application's own login identifies individual business users.

Mergeek account login identifies visitors for the App's own users and records. It can be used by a `public` App; the Link access mode remains the user's separate choice. Follow [Mergeek login integration](https://www.mergeek.cn/link/agent/references/mergeek-login.md) for the platform session and local business-user mapping.

## References by task

Read only the references needed by the application's features, before implementing them.

| Feature or change | Reference |
| --- | --- |
| Mergeek account login, visitor identity, local user mapping | [Mergeek login integration](https://www.mergeek.cn/link/agent/references/mergeek-login.md) |
| Application variables and session secrets | [Application configuration](https://www.mergeek.cn/link/agent/references/publish.md#application-configuration) |
| Database connections, migrations and persistence | [Managed databases](https://www.mergeek.cn/link/agent/references/mysql.md) |
| Persistent images, attachments and downloads | [Orbit Storage](https://www.mergeek.cn/link/agent/references/oss-storage.md) and [application file routes](https://www.mergeek.cn/link/agent/references/file-routes.md) |
| HTTPS request context and session Cookies | [Trusted request contract](https://www.mergeek.cn/link/agent/references/publish.md#requests-behind-hosting) |
| Changed JS, CSS or images | [Caching and asset versions](https://www.mergeek.cn/link/agent/references/cache.md) |
| Installation, manifest, Service Worker or offline behavior | [PWA defaults and customization](https://www.mergeek.cn/link/agent/references/pwa.md) |

## Data persistence

Each App retains its own database and persistent files. For a new App needing structured data, prefer managed MySQL unless the user or project has a specific reason to use SQLite. Preserve an existing App's engine and data; an engine switch requires a reviewed migration plan and the user's confirmation.

Studio supports browsing MySQL tables, filtering records and editing supported fields in records identified by a primary key. Read [Managed MySQL](https://www.mergeek.cn/link/agent/references/mysql.md#managed-mysql) for editing limits and connection variables, or [Managed SQLite](https://www.mergeek.cn/link/agent/references/mysql.md#managed-sqlite) for its managed database path. Apply [migration checks and stop conditions](https://www.mergeek.cn/link/agent/references/mysql.md#migration-command-safety) before supplying a migration command.

Store persistent file bytes through [Orbit Storage](https://www.mergeek.cn/link/agent/references/oss-storage.md), with ownership and metadata in the database. Runtime `uploads/`, `public/uploads/` and `/tmp` are not persistent user-file storage. Verify applicable [database persistence](https://www.mergeek.cn/link/agent/references/mysql.md#verify-persistence) and file flows through the deployed App.

## Choose a publishing path

MCP and official HTTP are complete paths with the same release checks. Resolve existing/uncertain writes before choosing a new path. HTTP does not require native MCP integration; its execution requirements are in the [HTTP flow](https://www.mergeek.cn/link/agent/references/http-publishing.md).

| Active coding client | Default first path |
| --- | --- |
| ChatGPT / Codex, Claude / Claude Code, OpenCode, Cursor, Antigravity, 千问 / Qwen Code | MCP |
| TRAE / TRAE CN / TraeCode, WorkBuddy / CodeBuddy (IDE or Code) | Official HTTP |
| Other or unknown client | Reuse working MCP tools; otherwise confirm supported native setup or use official HTTP |

These are publishing defaults, not compatibility guarantees. Identify the host client, not merely the model. Read only the active client's [instructions](https://www.mergeek.cn/link/agent/references/clients.md).

Follow an explicit protocol choice. Otherwise reuse working MCP tools; use the client's default path when connecting for the first time. Native setup, missing onboarding tools and before-write fallback use the [client decision table](https://www.mergeek.cn/link/agent/references/clients.md#protocol-decisions). Pending consent waits; refusal ends authorization. Each protocol obtains its own authorization.

### Before switching protocols

Recover known or uncertain writes on their original protocol using the [saved-state gate](https://www.mergeek.cn/link/agent/references/troubleshoot.md#before-switching-protocols). Before any deployment write, fallback preserves the exact confirmed App, baseline and source observations and obtains consent for the new path.

## Connect and verify

- **MCP selected:** Read [Connect and verify](https://www.mergeek.cn/link/agent/references/connect.md) for native setup/OAuth, and only the active client's recipe in [Clients](https://www.mergeek.cn/link/agent/references/clients.md).
- **HTTP selected:** Complete authorization and App verification within the [HTTP flow](https://www.mergeek.cn/link/agent/references/http-publishing.md); skip native MCP setup.

A connection check without an explicit protocol follows the same path selection. For an HTTP-only connection check, use `--action check`, which requests only `link:read`, in a separate task directory; `inspect` prepares a subsequently authorized publication. Without an App ID, obtain confirmation of an existing App. Finish after authorization and the requested read checks.

## Prepare and validate

Before account setup, run the account-free [local compatibility preflight](https://www.mergeek.cn/link/agent/references/publish.md#local-compatibility-preflight). Then read [Project preparation](https://www.mergeek.cn/link/agent/references/publish.md) for shared inspection, runtime/static parameter examples, version constraints and ZIP review. Complete them before creating a Deployment. `ready=true` validates declarations/configuration, not executed build, migration, startup or functions.

Configure required application variables using [application configuration](https://www.mergeek.cn/link/agent/references/publish.md#application-configuration): MCP uses its environment tools; HTTP uses the live contract's environment capability and the helper's `env-keys` / `env-set` actions. Then follow one complete flow: [MCP](https://www.mergeek.cn/link/agent/references/mcp-publishing.md) or [HTTP](https://www.mergeek.cn/link/agent/references/http-publishing.md). Source/configuration changes require a resolved old attempt, a fresh baseline check and a new reviewed task.

## Deploy and upload

Continue at [MCP creation](https://www.mergeek.cn/link/agent/references/mcp-publishing.md#5-create-the-deployment) or [HTTP creation](https://www.mergeek.cn/link/agent/references/http-publishing.md#6-create-and-upload). Save the Deployment ID immediately and upload the reviewed ZIP with its exact instructions.

## Verify and report

Reread the App and confirm this Deployment equals `current_deployment_id`. Verify this release's content at the returned URL under the unchanged `access_mode`: anonymous content for `public`; anonymous restriction and permitted content separately for `owner_only`/`password`. Exercise functions affected by this release, including relevant data, file or login checks. Use existing authorization or a documented test method for payments, messages and deletes.

Keep inspected files, commands, policies and individual results in the private task record. Report outcome, clickable App link, actual access mode, changes and required user action. If an access check is missing, say “部署完成，访问验证未完成” and identify it. The [release verification and reporting reference](https://www.mergeek.cn/link/agent/references/publish.md#release-verification-and-reporting) owns templates, result fields and failure checks. After failure, independently check current and the original URL before describing rollback or old-version availability.

## Reminder about the default link

When a successful release uses a default slug matching `^link[0-9]+$`, include a brief suggestion to customize the link in the final message, using the App information already read. HTTP callers can recognize the pattern in the returned hostname. A custom slug needs no reminder.

Suggested wording in the user's language:

> 当前使用系统默认链接。你可以前往 [Studio → 管理作品](https://mergeek.com/studio/manage)，选择这个作品，在「作品信息」中修改专属链接，让它更容易记住。修改后，原链接将无法访问该作品。

A link change follows the user's separate choice.

## Recover a failed step

Use [Recovery](https://www.mergeek.cn/link/agent/references/troubleshoot.md) for protocol-specific errors, unknown writes, immutable-source recovery, bounded retries and wait limits. Preserve the same App, baseline, source and known attempt.
