@ldraney/github-mcp 0.1.0 → 0.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/index.js +8 -2
  2. package/dist/prompts/activity-summary.d.ts +10 -0
  3. package/dist/prompts/activity-summary.js +154 -0
  4. package/dist/prompts/code-review.d.ts +9 -0
  5. package/dist/prompts/code-review.js +145 -0
  6. package/dist/prompts/issue-triage.d.ts +9 -0
  7. package/dist/prompts/issue-triage.js +202 -0
  8. package/dist/prompts/release-notes.d.ts +9 -0
  9. package/dist/prompts/release-notes.js +236 -0
  10. package/dist/server.d.ts +8 -1
  11. package/dist/server.js +36 -210
  12. package/dist/tools/categories/actions.d.ts +2 -5
  13. package/dist/tools/categories/actions.js +640 -369
  14. package/dist/tools/categories/activity.d.ts +2 -0
  15. package/dist/tools/categories/activity.js +534 -0
  16. package/dist/tools/categories/apps.d.ts +2 -0
  17. package/dist/tools/categories/apps.js +224 -0
  18. package/dist/tools/categories/billing.d.ts +2 -0
  19. package/dist/tools/categories/billing.js +145 -0
  20. package/dist/tools/categories/checks.d.ts +2 -0
  21. package/dist/tools/categories/checks.js +554 -0
  22. package/dist/tools/categories/codeScanning.d.ts +2 -0
  23. package/dist/tools/categories/codeScanning.js +375 -0
  24. package/dist/tools/categories/codeSecurity.d.ts +2 -0
  25. package/dist/tools/categories/codeSecurity.js +463 -0
  26. package/dist/tools/categories/codesOfConduct.d.ts +2 -0
  27. package/dist/tools/categories/codesOfConduct.js +45 -0
  28. package/dist/tools/categories/codespaces.d.ts +2 -0
  29. package/dist/tools/categories/codespaces.js +259 -0
  30. package/dist/tools/categories/copilot.d.ts +2 -0
  31. package/dist/tools/categories/copilot.js +187 -0
  32. package/dist/tools/categories/dependabot.d.ts +2 -0
  33. package/dist/tools/categories/dependabot.js +454 -0
  34. package/dist/tools/categories/emojis.d.ts +2 -0
  35. package/dist/tools/categories/emojis.js +22 -0
  36. package/dist/tools/categories/gists.d.ts +2 -5
  37. package/dist/tools/categories/gists.js +474 -285
  38. package/dist/tools/categories/git.d.ts +2 -0
  39. package/dist/tools/categories/git.js +520 -0
  40. package/dist/tools/categories/gitignore.d.ts +2 -0
  41. package/dist/tools/categories/gitignore.js +45 -0
  42. package/dist/tools/categories/index.d.ts +33 -0
  43. package/dist/tools/categories/index.js +33 -0
  44. package/dist/tools/categories/interactions.d.ts +2 -0
  45. package/dist/tools/categories/interactions.js +184 -0
  46. package/dist/tools/categories/issues.d.ts +2 -5
  47. package/dist/tools/categories/issues.js +692 -390
  48. package/dist/tools/categories/licenses.d.ts +2 -0
  49. package/dist/tools/categories/licenses.js +95 -0
  50. package/dist/tools/categories/markdown.d.ts +2 -0
  51. package/dist/tools/categories/markdown.js +64 -0
  52. package/dist/tools/categories/meta.d.ts +2 -0
  53. package/dist/tools/categories/meta.js +74 -0
  54. package/dist/tools/categories/migrations.d.ts +2 -0
  55. package/dist/tools/categories/migrations.js +290 -0
  56. package/dist/tools/categories/orgs.d.ts +2 -5
  57. package/dist/tools/categories/orgs.js +585 -417
  58. package/dist/tools/categories/packages.d.ts +2 -0
  59. package/dist/tools/categories/packages.js +918 -0
  60. package/dist/tools/categories/projects.d.ts +2 -0
  61. package/dist/tools/categories/projects.js +692 -0
  62. package/dist/tools/categories/pulls.d.ts +2 -5
  63. package/dist/tools/categories/pulls.js +715 -332
  64. package/dist/tools/categories/rateLimit.d.ts +2 -0
  65. package/dist/tools/categories/rateLimit.js +22 -0
  66. package/dist/tools/categories/reactions.d.ts +2 -0
  67. package/dist/tools/categories/reactions.js +385 -0
  68. package/dist/tools/categories/repos.d.ts +2 -5
  69. package/dist/tools/categories/repos.js +844 -366
  70. package/dist/tools/categories/search.d.ts +2 -5
  71. package/dist/tools/categories/search.js +294 -196
  72. package/dist/tools/categories/secretScanning.d.ts +2 -0
  73. package/dist/tools/categories/secretScanning.js +324 -0
  74. package/dist/tools/categories/securityAdvisories.d.ts +2 -0
  75. package/dist/tools/categories/securityAdvisories.js +407 -0
  76. package/dist/tools/categories/teams.d.ts +2 -0
  77. package/dist/tools/categories/teams.js +614 -0
  78. package/dist/tools/categories/users.d.ts +2 -5
  79. package/dist/tools/categories/users.js +474 -247
  80. package/dist/tools/generator.d.ts +35 -15
  81. package/dist/tools/generator.js +113 -57
  82. package/dist/tools/types.d.ts +63 -0
  83. package/dist/tools/types.js +17 -0
  84. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { Command } from 'commander';
3
3
  import { getToken, login, logout, getAuthStatus } from './auth/oauth-flow.js';
4
4
  import { startServer } from './server.js';
5
+ import { ToolGenerator } from './tools/generator.js';
5
6
  const program = new Command();
6
7
  program
7
8
  .name('github-mcp')
@@ -9,7 +10,8 @@ program
9
10
  .version('0.1.0');
10
11
  // Default command: start server
11
12
  program
12
- .action(async () => {
13
+ .option('-c, --categories <categories>', `Comma-separated list of tool categories to load (available: ${ToolGenerator.getAvailableCategories().join(', ')})`)
14
+ .action(async (options) => {
13
15
  try {
14
16
  let token = await getToken();
15
17
  if (!token) {
@@ -20,7 +22,11 @@ program
20
22
  console.error('Authentication failed. Cannot start server.');
21
23
  process.exit(1);
22
24
  }
23
- await startServer(token);
25
+ // Parse categories if provided
26
+ const categories = options.categories
27
+ ? options.categories.split(',').map((c) => c.trim())
28
+ : undefined;
29
+ await startServer(token, { categories });
24
30
  }
25
31
  catch (error) {
26
32
  console.error('Error:', error instanceof Error ? error.message : error);
@@ -0,0 +1,10 @@
1
+ import type { Prompt, GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Activity summary prompt definitions
4
+ */
5
+ export declare const activityPrompts: Prompt[];
6
+ /**
7
+ * Generate a prompt result for activity summaries
8
+ * These prompts instruct Claude to use the activity tools to fetch and summarize events
9
+ */
10
+ export declare function getActivityPrompt(name: string, args: Record<string, string>): GetPromptResult;
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Activity summary prompt definitions
3
+ */
4
+ export const activityPrompts = [
5
+ {
6
+ name: 'daily_summary',
7
+ description: 'Summarize GitHub activity from the last 24 hours for a repository',
8
+ arguments: [
9
+ {
10
+ name: 'owner',
11
+ description: 'Repository owner (username or organization)',
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'repo',
16
+ description: 'Repository name',
17
+ required: true,
18
+ },
19
+ ],
20
+ },
21
+ {
22
+ name: 'weekly_summary',
23
+ description: 'Summarize GitHub activity from the last 7 days for a repository',
24
+ arguments: [
25
+ {
26
+ name: 'owner',
27
+ description: 'Repository owner (username or organization)',
28
+ required: true,
29
+ },
30
+ {
31
+ name: 'repo',
32
+ description: 'Repository name',
33
+ required: true,
34
+ },
35
+ ],
36
+ },
37
+ {
38
+ name: 'repo_activity',
39
+ description: 'Get recent activity summary for a repository (configurable timeframe)',
40
+ arguments: [
41
+ {
42
+ name: 'owner',
43
+ description: 'Repository owner (username or organization)',
44
+ required: true,
45
+ },
46
+ {
47
+ name: 'repo',
48
+ description: 'Repository name',
49
+ required: true,
50
+ },
51
+ {
52
+ name: 'days',
53
+ description: 'Number of days to look back (default: 7)',
54
+ required: false,
55
+ },
56
+ ],
57
+ },
58
+ ];
59
+ /**
60
+ * Generate a prompt result for activity summaries
61
+ * These prompts instruct Claude to use the activity tools to fetch and summarize events
62
+ */
63
+ export function getActivityPrompt(name, args) {
64
+ const owner = args.owner;
65
+ const repo = args.repo;
66
+ switch (name) {
67
+ case 'daily_summary':
68
+ return {
69
+ messages: [
70
+ {
71
+ role: 'user',
72
+ content: {
73
+ type: 'text',
74
+ text: `Please summarize the GitHub activity for ${owner}/${repo} from the last 24 hours.
75
+
76
+ Use the github_activity_list_repo_events tool to fetch recent events for this repository, then provide a summary that includes:
77
+
78
+ 1. **Commits**: Any push events with commit messages
79
+ 2. **Pull Requests**: Opened, closed, or merged PRs
80
+ 3. **Issues**: New issues or issue comments
81
+ 4. **Reviews**: PR reviews and review comments
82
+ 5. **Releases**: Any new releases or tags
83
+
84
+ Filter the events to only include those from the last 24 hours based on the created_at timestamp.
85
+
86
+ If there's no activity, say so clearly.`,
87
+ },
88
+ },
89
+ ],
90
+ };
91
+ case 'weekly_summary':
92
+ return {
93
+ messages: [
94
+ {
95
+ role: 'user',
96
+ content: {
97
+ type: 'text',
98
+ text: `Please summarize the GitHub activity for ${owner}/${repo} from the last 7 days.
99
+
100
+ Use the github_activity_list_repo_events tool to fetch recent events for this repository (you may need to paginate through results), then provide a comprehensive summary that includes:
101
+
102
+ 1. **Commits**: Push events with notable commit messages grouped by author
103
+ 2. **Pull Requests**: Opened, closed, or merged PRs with titles
104
+ 3. **Issues**: New issues, closed issues, and notable issue discussions
105
+ 4. **Reviews**: PR reviews and their outcomes
106
+ 5. **Releases**: Any new releases with version numbers
107
+ 6. **Contributors**: Active contributors during this period
108
+
109
+ Filter the events to only include those from the last 7 days based on the created_at timestamp.
110
+
111
+ Organize the summary by category and highlight the most significant changes.`,
112
+ },
113
+ },
114
+ ],
115
+ };
116
+ case 'repo_activity':
117
+ const days = parseInt(args.days) || 7;
118
+ return {
119
+ messages: [
120
+ {
121
+ role: 'user',
122
+ content: {
123
+ type: 'text',
124
+ text: `Please summarize the GitHub activity for ${owner}/${repo} from the last ${days} day(s).
125
+
126
+ Use the github_activity_list_repo_events tool to fetch recent events for this repository, then provide a summary that includes:
127
+
128
+ 1. **Overview**: Quick stats on total events by type
129
+ 2. **Commits**: Notable push events and commit activity
130
+ 3. **Pull Requests**: PR activity (opened, closed, merged)
131
+ 4. **Issues**: Issue activity (opened, closed, commented)
132
+ 5. **Other Events**: Any other notable activity (releases, forks, stars, etc.)
133
+
134
+ Filter the events to only include those from the last ${days} day(s) based on the created_at timestamp.
135
+
136
+ Present the information in a clear, scannable format.`,
137
+ },
138
+ },
139
+ ],
140
+ };
141
+ default:
142
+ return {
143
+ messages: [
144
+ {
145
+ role: 'user',
146
+ content: {
147
+ type: 'text',
148
+ text: `Unknown prompt: ${name}`,
149
+ },
150
+ },
151
+ ],
152
+ };
153
+ }
154
+ }
@@ -0,0 +1,9 @@
1
+ import type { Prompt, GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Code review prompt definitions
4
+ */
5
+ export declare const codeReviewPrompts: Prompt[];
6
+ /**
7
+ * Generate a prompt result for code review
8
+ */
9
+ export declare function getCodeReviewPrompt(name: string, args: Record<string, string>): GetPromptResult | null;
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Code review prompt definitions
3
+ */
4
+ export const codeReviewPrompts = [
5
+ {
6
+ name: 'code_review',
7
+ description: 'Review a pull request with detailed suggestions and feedback',
8
+ arguments: [
9
+ {
10
+ name: 'owner',
11
+ description: 'Repository owner (username or organization)',
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'repo',
16
+ description: 'Repository name',
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'pull_number',
21
+ description: 'Pull request number',
22
+ required: true,
23
+ },
24
+ {
25
+ name: 'focus',
26
+ description: 'Review focus area (e.g., security, performance, style, all)',
27
+ required: false,
28
+ },
29
+ ],
30
+ },
31
+ {
32
+ name: 'pr_summary',
33
+ description: 'Generate a concise summary of a pull request',
34
+ arguments: [
35
+ {
36
+ name: 'owner',
37
+ description: 'Repository owner (username or organization)',
38
+ required: true,
39
+ },
40
+ {
41
+ name: 'repo',
42
+ description: 'Repository name',
43
+ required: true,
44
+ },
45
+ {
46
+ name: 'pull_number',
47
+ description: 'Pull request number',
48
+ required: true,
49
+ },
50
+ ],
51
+ },
52
+ ];
53
+ /**
54
+ * Generate a prompt result for code review
55
+ */
56
+ export function getCodeReviewPrompt(name, args) {
57
+ const owner = args.owner;
58
+ const repo = args.repo;
59
+ const pullNumber = args.pull_number;
60
+ switch (name) {
61
+ case 'code_review':
62
+ const focus = args.focus || 'all';
63
+ return {
64
+ messages: [
65
+ {
66
+ role: 'user',
67
+ content: {
68
+ type: 'text',
69
+ text: `Please review pull request #${pullNumber} in ${owner}/${repo}.
70
+
71
+ First, use these tools to gather information:
72
+ 1. github_pulls_get - Get PR details (title, description, state)
73
+ 2. github_pulls_list_files - Get the list of changed files
74
+ 3. github_pulls_list_commits - Get commits in this PR
75
+
76
+ Then provide a comprehensive code review with focus on: ${focus === 'all' ? 'all aspects' : focus}
77
+
78
+ Structure your review as follows:
79
+
80
+ ## Summary
81
+ Brief overview of what this PR does.
82
+
83
+ ## Changes Analysis
84
+ List the files changed with a brief description of each change.
85
+
86
+ ## Review Feedback
87
+
88
+ ${focus === 'all' || focus === 'security' ? `### Security
89
+ - Check for potential vulnerabilities (injection, XSS, auth issues, etc.)
90
+ - Review sensitive data handling
91
+ - Check for hardcoded credentials or secrets
92
+ ` : ''}
93
+ ${focus === 'all' || focus === 'performance' ? `### Performance
94
+ - Identify potential bottlenecks
95
+ - Check for inefficient algorithms or queries
96
+ - Review resource usage
97
+ ` : ''}
98
+ ${focus === 'all' || focus === 'style' ? `### Code Style & Quality
99
+ - Check naming conventions
100
+ - Review code organization
101
+ - Suggest readability improvements
102
+ ` : ''}
103
+ ### Logic & Correctness
104
+ - Verify the implementation matches the PR description
105
+ - Check edge cases
106
+ - Identify potential bugs
107
+
108
+ ## Suggestions
109
+ Specific, actionable suggestions for improvement.
110
+
111
+ ## Verdict
112
+ Overall assessment: Approve, Request Changes, or Comment.`,
113
+ },
114
+ },
115
+ ],
116
+ };
117
+ case 'pr_summary':
118
+ return {
119
+ messages: [
120
+ {
121
+ role: 'user',
122
+ content: {
123
+ type: 'text',
124
+ text: `Please provide a concise summary of pull request #${pullNumber} in ${owner}/${repo}.
125
+
126
+ Use these tools:
127
+ 1. github_pulls_get - Get PR details
128
+ 2. github_pulls_list_files - Get changed files
129
+ 3. github_pulls_list_commits - Get commits
130
+
131
+ Provide a summary that includes:
132
+ - **Title & Purpose**: What does this PR do?
133
+ - **Files Changed**: List of files with change type (added/modified/deleted)
134
+ - **Key Changes**: Bullet points of the main changes
135
+ - **Size**: Lines added/removed, number of files
136
+
137
+ Keep it brief - this is for quick understanding, not a full review.`,
138
+ },
139
+ },
140
+ ],
141
+ };
142
+ default:
143
+ return null;
144
+ }
145
+ }
@@ -0,0 +1,9 @@
1
+ import type { Prompt, GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Issue triage prompt definitions
4
+ */
5
+ export declare const issueTriagePrompts: Prompt[];
6
+ /**
7
+ * Generate a prompt result for issue triage
8
+ */
9
+ export declare function getIssueTriagePrompt(name: string, args: Record<string, string>): GetPromptResult | null;
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Issue triage prompt definitions
3
+ */
4
+ export const issueTriagePrompts = [
5
+ {
6
+ name: 'issue_triage',
7
+ description: 'Analyze and categorize a GitHub issue with suggested labels and priority',
8
+ arguments: [
9
+ {
10
+ name: 'owner',
11
+ description: 'Repository owner (username or organization)',
12
+ required: true,
13
+ },
14
+ {
15
+ name: 'repo',
16
+ description: 'Repository name',
17
+ required: true,
18
+ },
19
+ {
20
+ name: 'issue_number',
21
+ description: 'Issue number to triage',
22
+ required: true,
23
+ },
24
+ ],
25
+ },
26
+ {
27
+ name: 'issue_batch_triage',
28
+ description: 'Triage multiple open issues and suggest prioritization',
29
+ arguments: [
30
+ {
31
+ name: 'owner',
32
+ description: 'Repository owner (username or organization)',
33
+ required: true,
34
+ },
35
+ {
36
+ name: 'repo',
37
+ description: 'Repository name',
38
+ required: true,
39
+ },
40
+ {
41
+ name: 'limit',
42
+ description: 'Number of issues to triage (default: 10)',
43
+ required: false,
44
+ },
45
+ ],
46
+ },
47
+ {
48
+ name: 'find_duplicates',
49
+ description: 'Find potential duplicate issues in a repository',
50
+ arguments: [
51
+ {
52
+ name: 'owner',
53
+ description: 'Repository owner (username or organization)',
54
+ required: true,
55
+ },
56
+ {
57
+ name: 'repo',
58
+ description: 'Repository name',
59
+ required: true,
60
+ },
61
+ {
62
+ name: 'issue_number',
63
+ description: 'Issue number to find duplicates for',
64
+ required: true,
65
+ },
66
+ ],
67
+ },
68
+ ];
69
+ /**
70
+ * Generate a prompt result for issue triage
71
+ */
72
+ export function getIssueTriagePrompt(name, args) {
73
+ const owner = args.owner;
74
+ const repo = args.repo;
75
+ switch (name) {
76
+ case 'issue_triage':
77
+ const issueNumber = args.issue_number;
78
+ return {
79
+ messages: [
80
+ {
81
+ role: 'user',
82
+ content: {
83
+ type: 'text',
84
+ text: `Please triage issue #${issueNumber} in ${owner}/${repo}.
85
+
86
+ Use these tools:
87
+ 1. github_issues_get - Get issue details
88
+ 2. github_issues_list_comments - Get any discussion
89
+ 3. github_issues_list_labels - Get available labels in the repo
90
+
91
+ Provide a triage report:
92
+
93
+ ## Issue Summary
94
+ Brief description of what the issue is about.
95
+
96
+ ## Classification
97
+ - **Type**: Bug, Feature Request, Documentation, Question, or Other
98
+ - **Severity**: Critical, High, Medium, or Low
99
+ - **Effort Estimate**: Small, Medium, Large, or Unknown
100
+
101
+ ## Suggested Labels
102
+ Based on available labels in the repo, suggest which labels to apply.
103
+
104
+ ## Priority Assessment
105
+ Explain why this issue should be prioritized at a certain level.
106
+
107
+ ## Additional Context
108
+ - Is more information needed from the reporter?
109
+ - Are there related issues that should be linked?
110
+ - Who might be a good assignee based on the problem area?
111
+
112
+ ## Recommended Next Steps
113
+ What should happen next with this issue?`,
114
+ },
115
+ },
116
+ ],
117
+ };
118
+ case 'issue_batch_triage':
119
+ const limit = parseInt(args.limit) || 10;
120
+ return {
121
+ messages: [
122
+ {
123
+ role: 'user',
124
+ content: {
125
+ type: 'text',
126
+ text: `Please triage the open issues in ${owner}/${repo}.
127
+
128
+ Use these tools:
129
+ 1. github_issues_list - Get open issues (limit: ${limit}, state: open)
130
+ 2. github_issues_list_labels - Get available labels
131
+
132
+ For each issue, provide a brief triage:
133
+
134
+ ## Issues Overview
135
+
136
+ Create a table with:
137
+ | # | Title | Type | Severity | Effort | Suggested Labels |
138
+ |---|-------|------|----------|--------|------------------|
139
+
140
+ ## Priority Ranking
141
+ List the issues in recommended priority order with brief justification.
142
+
143
+ ## Quick Wins
144
+ Identify any issues that are low effort but high value.
145
+
146
+ ## Needs Attention
147
+ Flag any issues that:
148
+ - Are stale and need follow-up
149
+ - Need more information
150
+ - Might be duplicates
151
+
152
+ ## Recommended Actions
153
+ Suggest immediate actions to improve issue hygiene.`,
154
+ },
155
+ },
156
+ ],
157
+ };
158
+ case 'find_duplicates':
159
+ const targetIssue = args.issue_number;
160
+ return {
161
+ messages: [
162
+ {
163
+ role: 'user',
164
+ content: {
165
+ type: 'text',
166
+ text: `Please find potential duplicate issues for #${targetIssue} in ${owner}/${repo}.
167
+
168
+ Use these tools:
169
+ 1. github_issues_get - Get the target issue details
170
+ 2. github_issues_list - Get other open issues to compare
171
+ 3. github_search_issues_and_pull_requests - Search for similar issues by keywords
172
+
173
+ Process:
174
+ 1. Read issue #${targetIssue} to understand what it's about
175
+ 2. Extract key terms and concepts
176
+ 3. Search for issues with similar terms
177
+ 4. Compare and identify potential duplicates
178
+
179
+ Report format:
180
+
181
+ ## Target Issue
182
+ Brief summary of #${targetIssue}
183
+
184
+ ## Potential Duplicates
185
+ For each potential duplicate:
186
+ - **Issue #X**: Title
187
+ - Similarity: High/Medium/Low
188
+ - Reason: Why it might be a duplicate
189
+ - Key differences: What's different
190
+
191
+ ## Recommendation
192
+ - Which issues (if any) should be marked as duplicates
193
+ - Which issue should be kept as the primary
194
+ - Any issues that are related but not duplicates`,
195
+ },
196
+ },
197
+ ],
198
+ };
199
+ default:
200
+ return null;
201
+ }
202
+ }
@@ -0,0 +1,9 @@
1
+ import type { Prompt, GetPromptResult } from '@modelcontextprotocol/sdk/types.js';
2
+ /**
3
+ * Release notes prompt definitions
4
+ */
5
+ export declare const releaseNotesPrompts: Prompt[];
6
+ /**
7
+ * Generate a prompt result for release notes
8
+ */
9
+ export declare function getReleaseNotesPrompt(name: string, args: Record<string, string>): GetPromptResult | null;