Skip to content

feat(mcp): switch github catalog entry to official streamable-HTTP endpoint (#2131)#2199

Closed
nianyi778 wants to merge 1 commit into
esengine:v1from
nianyi778:feat/github-mcp-remote-sse
Closed

feat(mcp): switch github catalog entry to official streamable-HTTP endpoint (#2131)#2199
nianyi778 wants to merge 1 commit into
esengine:v1from
nianyi778:feat/github-mcp-remote-sse

Conversation

@nianyi778

@nianyi778 nianyi778 commented May 29, 2026

Copy link
Copy Markdown

문제

Closes #2131. 기존 github MCP 카탈로그 항목은 Docker + npm stdio 서버를 사용. GitHub 공식 원격 엔드포인트: https://api.githubcopilot.com/mcp/ (streamable-HTTP)를 사용하면 Docker 불필요.

변경사항

  • github 항목: url: "https://api.githubcopilot.com/mcp/" + transport: "streamable-http"
  • CatalogEntryurl/transport 필드 추가
  • Fail-closed 보안: URL 기반 항목은 Authorization 헤더를 전달할 수 없는 모든 spec-string 경로에서 제외:
    • mcpItems() (wizard) — 선택 불가
    • fallbackFromCatalog() — local fallback에서 제외
    • buildSpecString() / add_mcp_server — 에러 반환
  • mcpCommandFor(), Wizard.buildSpec(): streamable-HTTP 경우 streamable+https:// prefix 사용
  • Legacy alias (@modelcontextprotocol/server-github) — 재설정 시 wizard가 기존 서버 보존
  • Wizard onConfirm이 wizard 관리 목록에서 제외된 항목을 unmanaged 으로 보존

@nianyi778

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c55315d80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mcp/catalog.ts Outdated
Comment on lines +42 to +44
url: "https://mcp.github.com/sse",
transport: "sse",
note: "set GITHUB_PERSONAL_ACCESS_TOKEN in your env; no Docker required (#2131)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the GitHub PAT as a remote auth header

When a user selects the catalog github server (wizard or local registry fallback), this now saves only github=https://mcp.github.com/sse; setting GITHUB_PERSONAL_ACCESS_TOKEN as the catalog still instructs no longer affects the connection because mcpEnv is documented as ignored for SSE/HTTP and buildTransportFromSpec only sends spec.headers. GitHub's remote MCP requires the token in the Authorization header, so this path will handshake as unauthenticated/401 for the exact users this entry targets unless the PAT is translated into headers/OAuth or a stdio fallback remains available.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from 5c55315 to ef7794d Compare May 29, 2026 01:55
@nianyi778

Copy link
Copy Markdown
Author

Fixed in ef7794d7. Updated the catalog note to make clear that:

  1. The PAT must go in the Authorization header (not an env var), and
  2. The exact mcpServers config snippet users need:
"github": {
  "url": "https://mcp.github.com/sse",
  "transport": "sse",
  "headers": { "Authorization": "Bearer <GITHUB_PERSONAL_ACCESS_TOKEN>" }
}

Auto-injecting env vars into SSE headers is out of scope for this PR (that would touch the bridge/transport layer); the note is the right scope here.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef7794d782

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/ui/Wizard.tsx
Comment on lines +734 to +736
if (entry.url) {
const prefix = entry.transport === "streamable-http" ? "streamable+" : "";
return `${entry.name}=${prefix}${entry.url}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't save GitHub SSE as a headerless legacy spec

When the first-launch wizard includes the GitHub catalog entry, this branch serializes it into the legacy mcp array as only github=https://mcp.github.com/sse; normalizeMcpConfig can attach headers only from mcpServers, not from legacy remote specs. In that path the PAT that the catalog note says must be sent in the Authorization header is never sent, so users who select GitHub here end up with a persisted server that cannot authenticate. The wizard should either write this entry as an mcpServers.github object with headers (or prompt for them), or avoid offering/installing a one-click config that is known to be unusable.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from ef7794d to a170d86 Compare May 29, 2026 02:06
@nianyi778

Copy link
Copy Markdown
Author

Fixed in a170d862. Filtered remote entries (those with url) out of mcpItems() in the Wizard, so they no longer appear in the multi-select. Users who want GitHub MCP will configure it manually via mcpServers with the required Authorization header (as documented in the catalog note).

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a170d86238

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mcp/registry-fetch.ts Outdated
Comment on lines +242 to +244
runtime: "remote" as const,
url: e.url,
transport: (e.transport ?? "sse") as "sse" | "streamable-http",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't expose auth-only remotes as legacy installs

When both registries fall back to the bundled catalog, this makes the GitHub entry installable as a remote server; mcpInstallCommand then serializes it via specStringFor() and writes github=https://mcp.github.com/sse into the legacy mcp array. That legacy spec path has no place to persist the required Authorization header (headers are only supported through mcpServers), so reasonix mcp install github in offline/registry-failure contexts produces a saved config that will connect unauthenticated and fail. Since the catalog note says GitHub must be configured manually via mcpServers, the fallback should not return this remote as an installable legacy entry.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from a170d86 to ed68cbc Compare May 29, 2026 02:20
@nianyi778

Copy link
Copy Markdown
Author

Fixed in ed68cbc9. Also excluded remote entries from fallbackFromCatalog() — the offline path mcp install github was equally broken (same issue: legacy spec can't carry the Authorization header). Updated the test to assert remote entries are absent from the fallback.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed68cbc99a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mcp/catalog.ts Outdated
Comment on lines +42 to +43
url: "https://mcp.github.com/sse",
transport: "sse",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude remote entries from add_mcp_server shortcuts

When the add_mcp_server tool is called with from_catalog: "github" (the tool schema still advertises github as a bundled shortcut), buildSpecString in src/tools/scaffold.ts still assumes every catalog entry has an npm package and constructs npx -y ${entry.package}. Since this entry now only has a url, that path writes/preflights github=npx -y undefined instead of rejecting the shortcut or requiring a header-capable mcpServers config, so the advertised catalog shortcut installs a broken server.

Useful? React with 👍 / 👎.

Comment thread src/mcp/catalog.ts Outdated
const pkg = entry.package;
if (entry.url) {
const prefix = entry.transport === "streamable-http" ? "streamable+" : "";
return `--mcp "${entry.name}=${prefix}${entry.url}"`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop printing an unauthenticated GitHub --mcp command

For reasonix mcp list --local, this makes mcpCommandFor print --mcp "github=https://mcp.github.com/sse", but this same catalog entry says GitHub requires an Authorization header and legacy --mcp strings cannot carry headers. In that workflow the suggested command creates an unauthenticated SSE config that cannot use the GitHub remote; print a header-capable mcpServers example or omit the command for URL entries instead.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from ed68cbc to 5f44adc Compare May 29, 2026 02:27
@nianyi778

Copy link
Copy Markdown
Author

Fixed both in 5f44adca:

  1. scaffold.ts (add_mcp_server)from_catalog: "github" now returns an error immediately, pointing users to configure via mcpServers instead of writing a broken legacy spec.

  2. mcpCommandFor — for URL-based entries, instead of printing a --mcp string that can't carry headers, now prints a ready-to-copy mcpServers JSON snippet with the Authorization header placeholder.

@codex review

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from 5f44adc to 29f8927 Compare May 29, 2026 02:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f44adca19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mcp/catalog.ts Outdated
Comment on lines +42 to +43
url: "https://mcp.github.com/sse",
transport: "sse",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use the documented GitHub MCP endpoint

GitHub's official github-mcp-server README for remote PAT configuration documents the remote server as HTTP at https://api.githubcopilot.com/mcp/, not this SSE URL (https://github.com/github/github-mcp-server#remote-github-mcp-server). Because this catalog value is what reasonix mcp list --local tells users to copy into mcpServers, anyone following the new GitHub entry will configure the wrong host/path/transport and the server will fail to connect before exposing tools.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch 2 times, most recently from 8ab0bd4 to 120646a Compare May 29, 2026 02:52

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction is right and the plumbing is genuinely well done — making package optional + adding url/transport, and especially excluding url-based entries from every spec-string path (wizard mcpItems, fallbackFromCatalog, scaffold buildSpecString) so a user can't one-click a remote server that connects unauthenticated, then steering them to a copy-paste mcpServers JSON snippet with the Authorization header. That's the correct security posture for a header-authenticated remote.

But the endpoint itself is wrong, and it's security-relevant:

Blocker — wrong URL + transport. The catalog uses https://mcp.github.com/sse with transport: "sse". GitHub's official remote MCP server is https://api.githubcopilot.com/mcp/ over streamable HTTP ("type": "http"), not SSE. mcp.github.com isn't a GitHub-owned host as far as I can find — and since this entry literally instructs users to send their GitHub PAT via Authorization: Bearer <token> to that URL, pointing at the wrong host risks leaking the PAT to a third party (plus the entry just won't connect). The /sse form was the old preview shape; the current remote server is streamable-HTTP.

Please:

  1. Change url to https://api.githubcopilot.com/mcp/ and transport to streamable-http.
  2. Update the note snippet + the buildSpec/wizard.test.tsx expectation accordingly (the streamable+ prefix path in buildSpec will now be the one exercised — good that you already handle it).
  3. Double-check against GitHub's own docs before merge (linked below).

Minor (non-blocking): the package-lock.json hunk is just entry reordering (abort-controller / grammy / node-html-parser shuffled, no real dep change) and packages/dsnix/bin.cjs flips to mode 100755 — both look unrelated to this change; please drop them to keep the diff focused.

Refs:

Fix the endpoint + transport and this is a nice Docker-free upgrade.

@nianyi778

Copy link
Copy Markdown
Author

Fixed in 120646a9. Updated URL to the official documented endpoint: https://api.githubcopilot.com/mcp/ with transport: streamable-http (per the github-mcp-server README for PAT authentication). The note and wizard test updated accordingly.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 120646a94c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/ui/Wizard.tsx
function deriveInitialCatalog(existingSpecs: string[]): string[] {
const packageToName = new Map(MCP_CATALOG.map((e) => [e.package, e.name]));
const packageToName = new Map(
MCP_CATALOG.filter((e) => e.package).map((e) => [e.package!, e.name]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve existing GitHub MCP selections during setup

When a user already has the pre-change GitHub entry saved as github=npx -y @modelcontextprotocol/server-github, re-running reasonix setup no longer preselects it: this map only includes packages still present in MCP_CATALOG, and the GitHub catalog entry is now URL-only. After the wizard is confirmed, mcp is overwritten from the selected catalog entries, so the existing working GitHub server is silently removed; keep a legacy package alias or otherwise preserve/migrate old GitHub specs.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from 120646a to cace9b2 Compare May 29, 2026 04:07
@nianyi778

Copy link
Copy Markdown
Author

Fixed in cace9b22. Added a LEGACY_PACKAGE_ALIASES map in Wizard.tsx that maps the old npm package name (@modelcontextprotocol/server-github) to its new catalog entry name (github). deriveInitialCatalog now falls through to this alias check when neither the current package map nor the URL map matches, so users who had the old Docker-based GitHub server configured will have it pre-selected when they re-run setup.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cace9b2280

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/ui/Wizard.tsx
// Remote entries (url-based) need headers that can't be persisted via the
// legacy mcp spec string; omit them from the wizard so users can't select
// a one-click config that would connect unauthenticated (#2131).
return MCP_CATALOG.filter((entry) => !entry.url).map((entry) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve aliased GitHub selection in the wizard

When re-running setup with an existing legacy GitHub spec, deriveInitialCatalog() can now return github, but this filter removes the GitHub entry from the visible MultiSelect items. MultiSelect only submits selected values that are present in items, so pressing Enter on the MCP step silently drops the hidden aliased selection and rewrites config.mcp without the user's existing GitHub server. This affects exactly the legacy/remote GitHub migration path this change is trying to preserve.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from cace9b2 to 195a313 Compare May 29, 2026 04:11
@nianyi778

Copy link
Copy Markdown
Author

Fixed in 195a3130. The wizard's onConfirm now preserves any existing specs that deriveInitialCatalog can't identify (i.e., not managed by the wizard — remote servers, custom entries, and legacy GitHub specs). These are appended to the new selection instead of being silently dropped. So re-running setup with an existing GitHub server (old or new) will keep it in config.mcp regardless of whether it appears in the wizard's MultiSelect.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 195a313022

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/ui/Wizard.tsx Outdated
Comment on lines +241 to +242
const unmanaged = (prev.mcp ?? []).filter(
(s) => deriveInitialCatalog([s]).length === 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve catalog entries hidden from the wizard

When prev.mcp contains an existing GitHub spec such as github=streamable+https://api.githubcopilot.com/mcp/ or the legacy @modelcontextprotocol/server-github, deriveInitialCatalog([s]) returns ['github'], so this filter treats it as managed and excludes it from unmanaged. But mcpItems() now filters URL-based entries out of the MultiSelect, and MultiSelect only submits values present in items, so specsNow will not contain GitHub either; simply re-running setup and pressing Enter still silently drops the existing GitHub entry.

Useful? React with 👍 / 👎.

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The security blocker is resolved — the endpoint is now https://api.githubcopilot.com/mcp/ with transport: streamable-http, the note + the buildSpec test (github=streamable+https://api.githubcopilot.com/mcp/) are updated to match. PAT now goes to the genuine GitHub host.

Just two mechanical things left and CI goes green:

  1. biome lint failure (the actual CI red): src/mcp/catalog.ts:66 lint/style/useTemplate — the remote-entry branch in mcpCommandFor uses string concatenation; biome wants a template literal. biome check --write fixes it.
  2. The package-lock.json reorder + packages/dsnix/bin.cjs mode flip (100644→100755) are still in the diff and unrelated — please drop them.

Run the lint fix + drop the noise and I'll merge.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from 195a313 to d116ebd Compare May 29, 2026 04:20
@nianyi778

Copy link
Copy Markdown
Author

Fixed in d116ebd4. The unmanaged filter now also preserves specs whose identified catalog name is not in the wizard's visible mcpItems() — so a spec like github=streamable+... that maps to 'github' but is hidden from the MultiSelect will be kept in the preserved list and survive re-running setup.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@nianyi778

Copy link
Copy Markdown
Author

Fixed lint errors in src/mcp/catalog.ts and src/tools/scaffold.ts (template literal style). CI should go green now.

@codex review

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from d116ebd to c559e7e Compare May 29, 2026 05:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c559e7e397

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/ui/Wizard.tsx Outdated
const names = deriveInitialCatalog([s]);
// Keep if unrecognised, or if the identified name isn't
// in the visible wizard items (e.g. a remote-only entry).
return names.length === 0 || !visibleCatalogNames.has(names[0]!);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid preserving custom specs with selected names

When re-running setup with a pre-existing custom spec such as filesystem=python my_fs.py, deriveInitialCatalog([s]) returns no catalog match, so this new preservation path appends it after the newly selected catalog filesystem spec. normalizeMcpConfig pushes every legacy spec without de-duping same-name entries, so the next launch attempts to bridge two servers with the same namespace/prefix and can collide on registered tool names. Filter unmanaged specs by parsed spec name as well, so entries whose name is being managed by the wizard are replaced rather than duplicated.

Useful? React with 👍 / 👎.

Comment thread src/tools/scaffold.ts
Comment on lines +319 to +321
if (entry.url) {
return {
error: `catalog entry "${entry.name}" is a remote server that requires authentication headers — add it manually via mcpServers config instead of this tool. See the catalog note for the required mcpServers snippet.`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop advertising an unusable GitHub catalog shortcut

The add_mcp_server tool schema still advertises from_catalog examples/shortcuts including github, but this new branch makes that exact input always return an error because the tool can only write legacy mcp strings and not mcpServers headers. In contexts where an agent follows the tool description to add GitHub from the catalog, the operation is now guaranteed to fail; either remove github from the advertised shortcut list or teach this tool to persist the required mcpServers entry.

Useful? React with 👍 / 👎.

@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from c559e7e to ae170d3 Compare May 29, 2026 05:49
@nianyi778

Copy link
Copy Markdown
Author

Fixed both P2s in ae170d3e:

  1. Wizard dedup: unmanaged filter now also excludes specs whose parsed name (prefix before '=') matches any currently-selected catalog entry — so re-running setup with a custom filesystem=python my_fs.py won't duplicate filesystem alongside the newly-selected catalog spec.

  2. scaffold.ts: removed github from the from_catalog examples and description; the parameter now explicitly notes remote-only entries require mcpServers headers.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@nianyi778

Copy link
Copy Markdown
Author

@esengine 您好,这个 PR 已按您的所有意见修改完毕(共经历 8 轮迭代,Codex 最终回复 no major issues),CI 4/4 ✅。唯一剩下的就是之前留的 CHANGES_REQUESTED 还没 dismiss — 麻烦抽空重新过一下,感谢 🙏

@zhangyapu1 zhangyapu1 mentioned this pull request May 29, 2026
Closed

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for grinding through the iterations — the core is in good shape now. The security blocker is fully resolved: the endpoint is the genuine GitHub host https://api.githubcopilot.com/mcp/ over streamable-HTTP, and the fail-closed posture is exactly right — url-based entries are excluded from every spec-string path that can't carry an Authorization header (wizard mcpItems, fallbackFromCatalog, scaffold add_mcp_server/buildSpecString), and users are steered to a copy-paste mcpServers JSON snippet with the header. The wizard round-trip test and the fallback-exclusion test both pin the new behavior, and CI is green on ubuntu + windows + CodeQL. The unmanaged-spec preservation + legacy-alias work means re-running setup won't silently drop a user's existing GitHub server. Nicely done.

Three things before I merge, two of which I'd already flagged:

  1. Drop the unrelated noise (asked twice): packages/dsnix/bin.cjs still flips mode 100644 -> 100755, and package-lock.json still has the pure entry-reordering hunk (no real dep change). Please remove both so the diff is just the catalog/wizard/scaffold change — e.g. git checkout origin/main -- package-lock.json and git update-index --chmod=-x packages/dsnix/bin.cjs, then force-push.

  2. Fix the PR title/body — they're now stale and misleading: the title still says "SSE" and the body still describes https://mcp.github.com/sse + transport "sse" and claims fallbackFromCatalog maps remote entries to runtime:"remote". The shipped code uses api.githubcopilot.com/mcp/ + streamable-http and excludes remote entries from the fallback. Please update both to match what actually ships.

  3. (Optional, non-blocking) Consider a small unit test for the scaffold add_mcp_server remote-entry error path, and matching deriveInitialCatalog on the parsed spec name rather than a raw substring includes().

Once 1 and 2 are done I'll dismiss the CHANGES_REQUESTED and merge.

…ne#2131)

The bundled github MCP previously required Docker and the npm stdio server
(@modelcontextprotocol/server-github). GitHub now ships an official remote
SSE endpoint (https://mcp.github.com/sse) that needs no local container.

- Switch the catalog entry to use url/transport instead of package.
- Extend CatalogEntry with optional url and transport fields.
- mcpCommandFor() and Wizard.buildSpec() emit plain HTTPS URLs for SSE,
  streamable+https:// for streamable-http (matching parseMcpSpec rules).
- fallbackFromCatalog() maps remote entries to runtime:remote.
- Wizard.deriveInitialCatalog() also detects remote entries by URL.
@nianyi778 nianyi778 force-pushed the feat/github-mcp-remote-sse branch from ae170d3 to fe08c9a Compare May 29, 2026 09:02
@nianyi778 nianyi778 changed the title feat(mcp): switch github catalog entry to official remote SSE (#2131) feat(mcp): switch github catalog entry to official streamable-HTTP endpoint (#2131) May 29, 2026
@nianyi778

Copy link
Copy Markdown
Author

Done — pushed fe08c9a3. Removed both unrelated hunks (package-lock.json restored to origin/main, packages/dsnix/bin.cjs chmod reverted). PR title and body updated to reflect streamable-HTTP + the actual fail-closed posture.

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Fail-closed handling for URL-only catalog entries is exactly the right shape — wizard, fallback, and add_mcp_server all properly skip these. Letting CI run.

@nianyi778

Copy link
Copy Markdown
Author

@esengine CI 4/4 ✅,已 approved — 方便的话麻烦合并,感谢 🙏

@esengine esengine added the v1 Legacy TypeScript line (0.x) — v1 branch, maintenance only label May 31, 2026
@Bernardxu123

Copy link
Copy Markdown
Collaborator

🙏 真诚感谢您的贡献!

感谢您为 DeepSeek-Reasonix v1 分支提交的 PR。v1 目前已 完全停止维护,项目已全面迁移至 v2 (Go rewrite)。

由于 v1 已不再接受代码变更,此 PR 将被关闭。

我们非常欢迎您将这些修复贡献到 v2 分支! 请查看 v2 Issues 或基于 main-v2 创建新 PR。

再次感谢您的时间和精力!❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1 Legacy TypeScript line (0.x) — v1 branch, maintenance only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: GitHub MCP 默认改为远程 SSE,避免 Docker 依赖

3 participants