Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 91 additions & 91 deletions README.md

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion cmd/github-mcp-server/generate_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/github/github-mcp-server/pkg/github"
"github.com/github/github-mcp-server/pkg/lockdown"
"github.com/github/github-mcp-server/pkg/raw"
"github.com/github/github-mcp-server/pkg/scopes"
"github.com/github/github-mcp-server/pkg/toolsets"
"github.com/github/github-mcp-server/pkg/translations"
gogithub "github.com/google/go-github/v79/github"
Expand Down Expand Up @@ -224,7 +225,22 @@ func generateToolDoc(tool mcp.Tool) string {
var lines []string

// Tool name only (using annotation name instead of verbose description)
lines = append(lines, fmt.Sprintf("- **%s** - %s", tool.Name, tool.Annotations.Title))
toolLine := fmt.Sprintf("- **%s** - %s", tool.Name, tool.Annotations.Title)

// Add required scopes if present (skip NoScope which is empty string)
if tool.Meta != nil {
toolScopes := scopes.GetScopesFromMeta(tool.Meta)
var scopeStrs []string
for _, s := range toolScopes {
if s != scopes.NoScope {
scopeStrs = append(scopeStrs, fmt.Sprintf("`%s`", s.String()))
}
}
if len(scopeStrs) > 0 {
toolLine += fmt.Sprintf(" (scopes: %s)", strings.Join(scopeStrs, ", "))
}
}
lines = append(lines, toolLine)

// Parameters
if tool.InputSchema == nil {
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/add_comment_to_pending_review.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "pull_requests"
},
"annotations": {
"title": "Add review comment to the requester's latest pending pull request review"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/add_issue_comment.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "issues"
},
"annotations": {
"title": "Add comment to issue"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/add_project_item.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"project"
],
"toolset": "projects"
},
"annotations": {
"title": "Add project item"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/assign_copilot_to_issue.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "issues"
},
"annotations": {
"idempotentHint": true,
"title": "Assign Copilot to issue"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/cancel_workflow_run.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "actions"
},
"annotations": {
"title": "Cancel workflow run"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/create_branch.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"title": "Create branch"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/create_gist.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"gist"
],
"toolset": "gists"
},
"annotations": {
"title": "Create Gist"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/create_or_update_file.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"title": "Create or update file"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/create_pull_request.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "pull_requests"
},
"annotations": {
"title": "Open new pull request"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/create_repository.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"title": "Create repository"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/delete_file.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"destructiveHint": true,
"title": "Delete file"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/delete_project_item.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"project"
],
"toolset": "projects"
},
"annotations": {
"title": "Delete project item"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/delete_workflow_run_logs.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "actions"
},
"annotations": {
"destructiveHint": true,
"title": "Delete workflow logs"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/dismiss_notification.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"notifications"
],
"toolset": "notifications"
},
"annotations": {
"title": "Dismiss notification"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "actions"
},
"annotations": {
"readOnlyHint": true,
"title": "Download workflow artifact"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/fork_repository.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"title": "Fork repository"
},
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_code_scanning_alert.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"security_events"
],
"toolset": "code_security"
},
"annotations": {
"readOnlyHint": true,
"title": "Get code scanning alert"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_commit.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"readOnlyHint": true,
"title": "Get commit details"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_dependabot_alert.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"security_events"
],
"toolset": "dependabot"
},
"annotations": {
"readOnlyHint": true,
"title": "Get dependabot alert"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_discussion.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "discussions"
},
"annotations": {
"readOnlyHint": true,
"title": "Get discussion"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_discussion_comments.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "discussions"
},
"annotations": {
"readOnlyHint": true,
"title": "Get discussion comments"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_file_contents.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"readOnlyHint": true,
"title": "Get file or directory contents"
Expand Down
3 changes: 3 additions & 0 deletions pkg/github/__toolsnaps__/get_gist.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"_meta": {
"toolset": "gists"
},
"annotations": {
"readOnlyHint": true,
"title": "Get Gist Content"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_global_security_advisory.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"security_events"
],
"toolset": "security_advisories"
},
"annotations": {
"readOnlyHint": true,
"title": "Get a global security advisory"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_job_logs.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "actions"
},
"annotations": {
"readOnlyHint": true,
"title": "Get job logs"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_label.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "labels"
},
"annotations": {
"readOnlyHint": true,
"title": "Get a specific label from a repository."
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_latest_release.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"readOnlyHint": true,
"title": "Get latest release"
Expand Down
3 changes: 3 additions & 0 deletions pkg/github/__toolsnaps__/get_me.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"_meta": {
"toolset": "context"
},
"annotations": {
"readOnlyHint": true,
"title": "Get my user profile"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_notification_details.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"notifications"
],
"toolset": "notifications"
},
"annotations": {
"readOnlyHint": true,
"title": "Get notification details"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_project.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"read:project"
],
"toolset": "projects"
},
"annotations": {
"readOnlyHint": true,
"title": "Get project"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_project_field.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"read:project"
],
"toolset": "projects"
},
"annotations": {
"readOnlyHint": true,
"title": "Get project field"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_project_item.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"read:project"
],
"toolset": "projects"
},
"annotations": {
"readOnlyHint": true,
"title": "Get project item"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_release_by_tag.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "repos"
},
"annotations": {
"readOnlyHint": true,
"title": "Get a release by tag name"
Expand Down
6 changes: 6 additions & 0 deletions pkg/github/__toolsnaps__/get_repository_tree.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"_meta": {
"requiredOAuthScopes": [
"repo"
],
"toolset": "git"
},
"annotations": {
"readOnlyHint": true,
"title": "Get repository tree"
Expand Down
Loading
Loading