Repository navigation
fix(cli): reject non-GitHub origins during deploy - #2687
Merged
khandrew1 merged 1 commit intoOct 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
github-actions
Bot
force-pushed
the
canary
branch
from
September 28, 2026 22:11
31b000f to
f7d73a4
Compare
quifox
force-pushed
the
fix/typescript/github-deploy-origin
branch
from
September 28, 2026 23:53
274df04 to
3af329a
Compare
github-actions
Bot
force-pushed
the
canary
branch
from
September 30, 2026 10:01
885104c to
bde3433
Compare
quifox
force-pushed
the
fix/typescript/github-deploy-origin
branch
from
October 2, 2026 05:46
3af329a to
6ca2e45
Compare
@mcp-use/agent
@mcp-use/cli
@mcp-use/client
create-mcp-use-app
@mcp-use/inspector
mcp-use
@mcp-use/tunnel
commit: |
khandrew1
added a commit
that referenced
this pull request
Oct 8, 2026
* fix(create-mcp-use-app): install dependencies on Windows (#2696) * fix(create-mcp-use-app): install dependencies on Windows npm and pnpm are .cmd shims on Windows, which spawn() only runs through a shell, so --install and the install prompt failed with "spawn npm ENOENT". On Windows, run the package manager through the shell as one command string, which also avoids Node's DEP0190 warning; other platforms keep the direct spawn. Move runPackageManager to utils.ts so it can be tested. * test(create-mcp-use-app): cover a package manager that exits non-zero Assert that the rejection carries the package manager's stderr, which the scaffolder prints when an install fails. * chore: enter canary prerelease mode * chore(typescript): version packages (canary) * fix(server): avoid buffering SSE responses in request logging (#2789) * chore(typescript): version packages (canary) * fix(inspector): apply saved timeout settings to tool calls (#2656) * fix(inspector): honor saved tool request timeouts * fix(inspector): handle duplicate URLs and cleared timeouts * fix(inspector): preserve cleared timeout settings * fix(inspector): explain blank timeout settings --------- Co-authored-by: Andrew Khadder <[email protected]> * chore(typescript): version packages (canary) * fix(cli): use canonical deployment dashboard URLs (#2744) * chore(typescript): version packages (canary) * fix(cli): reject non-GitHub origins during deploy (#2687) * chore(typescript): version packages (canary) * fix(client): implement listTools and protocol metadata on CodeModeConnector (#2488) * fix(client): implement listTools and protocol metadata on CodeModeConnector * fix(client): propagate cancellation and honor abort signals in CodeModeConnector * docs(client): add JSDoc for CodeModeConnector resource and prompt methods to satisfy TypeDoc * refactor(client): remove redundant listAllPrompts from CodeModeConnector * ci: re-trigger preview workflow * chore(typescript): version packages (canary) * docs(changelog): document v2.8.1 and inspector v20.3.17 --------- Co-authored-by: Freetrip <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Lucien <[email protected]> Co-authored-by: quifox <[email protected]> Co-authored-by: Rohith Reddy Nama <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Where did you find this issue?
Found while reviewing the GitHub deployment path in the CLI, then reproduced with the existing deploy test harness.
parseGitHubRepository()matchedgithub.comanywhere near the end of the remote string instead of validating the remote host. For example:was parsed as
acme/service.I also reproduced the downstream effect: when the mocked GitHub App has access to
acme/service,mcp-use deployproceeds to create a GitHub-backed server withrepoFullName: "acme/service", even though the local origin is hosted ongit.example.com.I did not find an existing issue or PR covering this case.
Language / Project Scope
Changes
github.com.[email protected]:owner/repo.gitseparately with an anchored, case-insensitive pattern.github.comin the hostname or path before any Cloud API request is made.owner/repo; do not rely on URL normalization to repair the remote.@mcp-use/cli.Implementation Details
URLparser so host identity is checked structurally instead of by substring.owner/repo(.git)shape check with SCP-style remotes. Dot path segments are rejected.TypeScript Checklist
Packages Modified
docstestsclicreate-mcp-use-appmcp-use(server)mcp-use(client)inspectorPre-commit Checklist
pnpm lint)pnpm format:check)pnpm buildand build succeeds@mcp-use/cliExample Usage (Before)
The remote could be interpreted as the GitHub repository
acme/service. If the connected GitHub App could access that repository, deployment could proceed against that unrelated GitHub source.Example Usage (After)
git remote set-url origin https://git.example.com/mirror/github.com/acme/service.git mcp-use deploy # unsupported_remoteNormal GitHub remotes such as these remain supported:
Documentation Updates
No documentation changes are required; this corrects validation of the existing GitHub deploy behavior.
Testing
Tested on Linux with Node.js 24.19.0 and pnpm 11.13.1, against main.
pnpm install --frozen-lockfile: passed.pnpm build: passed.pnpm --filter @mcp-use/cli typecheck: passed.pnpm --filter @mcp-use/cli test: 3 proxy/bin tests and 352 Vitest tests across 24 files passed.pnpm --filter @mcp-use/cli exec vitest run tests/commands/deploy.test.ts: 54 passed.pnpm format:check,pnpm lint, andgit diff --check: passed.With the same deploy tests on unmodified main, 16 fail and 38 pass. The fixed code passes all 54. Git remotes are created locally and Cloud API calls are mocked; rejected origins must not make an API request.
Regression coverage includes lookalike hosts,
github.comin a non-GitHub path, unsupported protocols, malformed URL separators, original path shapes and dot segments, explicit ports including default ports, query strings/fragments, case-insensitive hosts, and supported URL/SCP-style remotes.Backwards Compatibility
Explicit HTTP(S), SSH, Git, and SCP-style remotes with a GitHub host and an original
owner/repo(.git)path remain recognized. Lookalike hosts, local/path-like strings, and dot path segments are rejected. URL-style remotes additionally require explicit HTTP(S)/SSH/Git syntax without repaired separators, extra path segments, explicit ports, query strings, or fragments. Rejections useunsupported_remotebefore a Cloud API call.Related Issues
None.
Branch Update
Rebased the fix onto main and retargeted this PR to main as requested. The PR contains one commit limited to the CLI implementation, its regression tests, and the patch changeset.