Skip to content

fix: uploadFiles MCP 工具未区分云存储上传与静态托管部署,导致文件上传成功但静态托管返回 404#604

Closed
binggg wants to merge 3 commits into
mainfrom
automation/attribution-issue-moctkjy6-r53c36-uploadfiles-mcp-404
Closed

fix: uploadFiles MCP 工具未区分云存储上传与静态托管部署,导致文件上传成功但静态托管返回 404#604
binggg wants to merge 3 commits into
mainfrom
automation/attribution-issue-moctkjy6-r53c36-uploadfiles-mcp-404

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 28, 2026

Attribution issue

  • issueId: issue_moctkjy6_r53c36
  • category: tool
  • canonicalTitle: uploadFiles MCP 工具未区分云存储上传与静态托管部署,导致文件上传成功但静态托管返回 404
  • representativeRun: application-js-vite-hello-world-hosting-deploy/2026-04-24T11-16-15-2146cb

Automation summary

  • root_cause: The uploadFiles MCP tool description and web-development skill explicitly told AI agents to use "相对路径" (relative paths like ./) for base/publicPath/assetPrefix when deploying to subdirectories. This is wrong — when deploying to a subdirectory like /vite-test, the Vite base must be set to the absolute path '/vite-test/' (with leading and trailing slashes). Using './' causes 404 errors when the access URL lacks a trailing slash, because the browser resolves relative paths against the current directory rather than the intended subdirectory root. Additionally, the cloudPath parameter description didn't clarify format rules (no leading /), and the skill lacked a mandatory pre-upload checklist for subdirectory deployments.
  • changes:
  1. mcp/src/tools/hosting.ts: Fixed uploadFiles tool description — replaced misleading "是否使用相对路径" with explicit subdirectory deployment rules: base/publicPath/assetPrefix must use absolute paths matching the deploy target (e.g., /vite-test/), forbidden ./ and empty string, must rebuild after config change, must verify build output, cloudPath format (no leading /)
  2. mcp/src/tools/hosting.ts: Fixed cloudPath parameter descri

Changed files

  • config/source/skills/web-development/SKILL.md
  • config/source/skills/web-development/frameworks.md
  • doc/mcp-tools.md
  • doc/prompts/web-development.mdx
  • mcp/src/tools/hosting.ts
  • mcp/src/tools/storage-hosting-guidance.test.ts

@binggg
Copy link
Copy Markdown
Member Author

binggg commented May 12, 2026

Closing as duplicate: same case has newer PR #651. Keeping #651.

@binggg binggg closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant