Repository navigation
Scaffold read-only GitHub MCP entry #2215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
lilyshen0722
wants to merge
6
commits into
main
Choose a base branch
from
kai/task-225-github-mcp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7610491
Scaffold pinned read-only GitHub MCP entry
lilyshen0722 e3d7ba8
test(hosted-mcp): hold GitHub entry until App client registration
lilyshen0722 95ef434
Map GitHub MCP catalogue entry to GitHub glyph
lilyshen0722 9cab272
chore(connectors): stage optional GitHub MCP client wiring
lilyshen0722 e11173a
chore(connectors): enable GitHub MCP client sync in dev
lilyshen0722 5c9cdd9
fix(hosted-mcp): scope GitHub client secret refs by release
lilyshen0722 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
412 changes: 412 additions & 0 deletions
412
backend/__tests__/fixtures/hostedMcp/github-mcp-tools-source-2026-10-15.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /** | ||
| * GitHub's remote MCP server. The six input schemas are pinned from | ||
| * github/github-mcp-server at 796afb74711ddc856fe587debc49373e21c8d0f7 | ||
| * (the upstream tool snapshots), not from a live account. A consenting | ||
| * account's first tools/list remains the drift check before this is offered. | ||
| * | ||
| * The credential is a separate, public GitHub App. GitHub App user tokens use | ||
| * the app's permissions rather than OAuth scopes; offline_access asks GitHub | ||
| * for a refresh token only. This entry pins only reads; any write tool must be | ||
| * pinned separately with owner confirmation. The App's client id and secret | ||
| * are optional instance configuration. Until registration supplies both, the | ||
| * catalogue reports not_configured and offers no Connect. | ||
| */ | ||
| import type { HostedMcpEntry, HostedMcpPinnedTool } from '../../services/hostedMcpEntryService'; | ||
| import pin from './githubMcpSchemas.json'; | ||
|
|
||
| const descriptions: Record<string, string> = { | ||
| get_me: 'Read the account profile for this GitHub connection.', | ||
| list_issues: 'List issues in a GitHub repository.', | ||
| issue_read: 'Read an issue and its comments or related issues.', | ||
| list_pull_requests: 'List pull requests in a GitHub repository.', | ||
| pull_request_read: 'Read a pull request, its files, reviews or comments.', | ||
| get_file_contents: 'Read a file or directory in a GitHub repository.', | ||
| }; | ||
|
|
||
| const tools: HostedMcpPinnedTool[] = pin.tools.map((tool) => ({ | ||
| name: tool.name, | ||
| upstreamName: tool.name, | ||
| description: descriptions[tool.name], | ||
| class: 'read', | ||
| inputSchema: tool.inputSchema, | ||
| annotations: { readOnlyHint: true }, | ||
| })); | ||
|
|
||
| export const GITHUB_MCP_ENTRY: HostedMcpEntry = { | ||
| id: 'github-mcp', | ||
| title: 'GitHub', | ||
| description: 'Read files, issues and pull requests in repositories this GitHub App can access.', | ||
| resource: 'https://api.githubcopilot.com/mcp/', | ||
| issuer: 'https://github.com/login/oauth', | ||
| client: 'pre-registered', | ||
| // GitHub's AS metadata omits auth methods. Its GitHub App token guide names | ||
| // client_id and client_secret as POST parameters, so pin that method instead | ||
| // of applying RFC 8414's Basic default. Confirm on the first live consent. | ||
| tokenEndpointAuthMethod: 'client_secret_post', | ||
| scopes: ['offline_access'], | ||
| revoke: { page: 'https://github.com/settings/applications' }, | ||
| tools, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inspect the publication write.
At revision
5c9cdd975ff624cb1892d29dbe1af71afe346945,mock.calls[1]is the retirement write. It has noconfig.grantedScope, so this test fails withundefinedrather than''. The publication write ismock.calls[2]. I verified the code path statically; I did not run the test. (raw.githubusercontent.com)