@ldraney/github-mcp 0.2.0-beta.0 → 0.2.0-beta.2

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.
@@ -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;
@@ -0,0 +1,236 @@
1
+ /**
2
+ * Release notes prompt definitions
3
+ */
4
+ export const releaseNotesPrompts = [
5
+ {
6
+ name: 'release_notes',
7
+ description: 'Generate release notes from commits between two refs',
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: 'base',
21
+ description: 'Base ref (tag, branch, or SHA) - e.g., v1.0.0',
22
+ required: true,
23
+ },
24
+ {
25
+ name: 'head',
26
+ description: 'Head ref (tag, branch, or SHA) - e.g., v1.1.0 or main',
27
+ required: true,
28
+ },
29
+ ],
30
+ },
31
+ {
32
+ name: 'changelog',
33
+ description: 'Generate a changelog from recent commits',
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: 'since',
47
+ description: 'Number of days to look back (default: 30)',
48
+ required: false,
49
+ },
50
+ ],
51
+ },
52
+ {
53
+ name: 'whats_new',
54
+ description: 'Generate a user-friendly "What\'s New" summary for a release',
55
+ arguments: [
56
+ {
57
+ name: 'owner',
58
+ description: 'Repository owner (username or organization)',
59
+ required: true,
60
+ },
61
+ {
62
+ name: 'repo',
63
+ description: 'Repository name',
64
+ required: true,
65
+ },
66
+ {
67
+ name: 'base',
68
+ description: 'Previous release tag - e.g., v1.0.0',
69
+ required: true,
70
+ },
71
+ {
72
+ name: 'head',
73
+ description: 'New release tag - e.g., v1.1.0',
74
+ required: true,
75
+ },
76
+ ],
77
+ },
78
+ ];
79
+ /**
80
+ * Generate a prompt result for release notes
81
+ */
82
+ export function getReleaseNotesPrompt(name, args) {
83
+ const owner = args.owner;
84
+ const repo = args.repo;
85
+ switch (name) {
86
+ case 'release_notes':
87
+ const base = args.base;
88
+ const head = args.head;
89
+ return {
90
+ messages: [
91
+ {
92
+ role: 'user',
93
+ content: {
94
+ type: 'text',
95
+ text: `Please generate release notes for ${owner}/${repo} comparing ${base} to ${head}.
96
+
97
+ Use these tools:
98
+ 1. github_repos_compare_commits - Compare the two refs to get all commits
99
+ 2. github_pulls_list - Get merged PRs (state: closed) to find associated PRs
100
+ 3. github_issues_list - Get closed issues that might be referenced
101
+
102
+ Generate release notes in this format:
103
+
104
+ # Release Notes: ${head}
105
+
106
+ ## Overview
107
+ Brief summary of this release (2-3 sentences).
108
+
109
+ ## Breaking Changes
110
+ List any breaking changes that require user action.
111
+
112
+ ## New Features
113
+ - Feature descriptions from commits/PRs with conventional commit type "feat"
114
+
115
+ ## Bug Fixes
116
+ - Bug fixes from commits/PRs with conventional commit type "fix"
117
+
118
+ ## Improvements
119
+ - Enhancements, refactors, and other improvements
120
+
121
+ ## Documentation
122
+ - Documentation updates
123
+
124
+ ## Dependencies
125
+ - Dependency updates
126
+
127
+ ## Contributors
128
+ List of contributors to this release.
129
+
130
+ ---
131
+
132
+ **Full Changelog**: ${base}...${head}
133
+
134
+ Parse conventional commit messages where available (feat:, fix:, docs:, chore:, etc.).
135
+ Group commits logically and write clear, user-friendly descriptions.`,
136
+ },
137
+ },
138
+ ],
139
+ };
140
+ case 'changelog':
141
+ const days = parseInt(args.since) || 30;
142
+ return {
143
+ messages: [
144
+ {
145
+ role: 'user',
146
+ content: {
147
+ type: 'text',
148
+ text: `Please generate a changelog for ${owner}/${repo} from the last ${days} days.
149
+
150
+ Use these tools:
151
+ 1. github_repos_list_commits - Get recent commits
152
+ 2. github_pulls_list - Get recently merged PRs (state: closed)
153
+
154
+ Generate a changelog:
155
+
156
+ # Changelog
157
+
158
+ ## [Unreleased]
159
+
160
+ ### Added
161
+ - New features (feat: commits)
162
+
163
+ ### Changed
164
+ - Changes to existing functionality
165
+
166
+ ### Deprecated
167
+ - Features that will be removed
168
+
169
+ ### Removed
170
+ - Removed features
171
+
172
+ ### Fixed
173
+ - Bug fixes (fix: commits)
174
+
175
+ ### Security
176
+ - Security-related changes
177
+
178
+ ---
179
+
180
+ Group commits by type based on conventional commit prefixes.
181
+ Include PR numbers and links where applicable.
182
+ Only include commits from the last ${days} days.`,
183
+ },
184
+ },
185
+ ],
186
+ };
187
+ case 'whats_new':
188
+ const prevRelease = args.base;
189
+ const newRelease = args.head;
190
+ return {
191
+ messages: [
192
+ {
193
+ role: 'user',
194
+ content: {
195
+ type: 'text',
196
+ text: `Please generate a user-friendly "What's New" summary for ${owner}/${repo} release ${newRelease}.
197
+
198
+ Use these tools:
199
+ 1. github_repos_compare_commits - Compare ${prevRelease} to ${newRelease}
200
+ 2. github_pulls_list - Get merged PRs for context
201
+
202
+ Generate a "What's New" post suitable for users (not developers):
203
+
204
+ # What's New in ${newRelease}
205
+
206
+ ## Highlights
207
+ Top 3-5 most impactful changes in plain language.
208
+
209
+ ## New Features
210
+ User-facing features explained simply:
211
+ - **Feature Name**: What it does and why it's useful
212
+
213
+ ## Improvements
214
+ Quality of life improvements:
215
+ - What got better and how it helps users
216
+
217
+ ## Bug Fixes
218
+ Notable fixes that affected users:
219
+ - What was broken and that it's now fixed
220
+
221
+ ## Getting Started
222
+ How to update and try the new features.
223
+
224
+ ---
225
+
226
+ Write in a friendly, accessible tone.
227
+ Focus on user benefits, not technical implementation.
228
+ Avoid jargon and commit message details.`,
229
+ },
230
+ },
231
+ ],
232
+ };
233
+ default:
234
+ return null;
235
+ }
236
+ }
package/dist/server.js CHANGED
@@ -4,6 +4,16 @@ import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema
4
4
  import { Octokit } from '@octokit/rest';
5
5
  import { createToolGenerator } from './tools/generator.js';
6
6
  import { activityPrompts, getActivityPrompt } from './prompts/activity-summary.js';
7
+ import { codeReviewPrompts, getCodeReviewPrompt } from './prompts/code-review.js';
8
+ import { issueTriagePrompts, getIssueTriagePrompt } from './prompts/issue-triage.js';
9
+ import { releaseNotesPrompts, getReleaseNotesPrompt } from './prompts/release-notes.js';
10
+ // Combine all prompts
11
+ const allPrompts = [
12
+ ...activityPrompts,
13
+ ...codeReviewPrompts,
14
+ ...issueTriagePrompts,
15
+ ...releaseNotesPrompts,
16
+ ];
7
17
  /**
8
18
  * Start the MCP server with authenticated Octokit
9
19
  */
@@ -42,13 +52,19 @@ export async function startServer(token, options = {}) {
42
52
  // List available prompts
43
53
  server.setRequestHandler(ListPromptsRequestSchema, async () => {
44
54
  return {
45
- prompts: activityPrompts,
55
+ prompts: allPrompts,
46
56
  };
47
57
  });
48
58
  // Handle prompt requests
49
59
  server.setRequestHandler(GetPromptRequestSchema, async (request) => {
50
60
  const { name, arguments: args } = request.params;
51
- return getActivityPrompt(name, args ?? {});
61
+ const promptArgs = args ?? {};
62
+ // Try each prompt handler
63
+ const result = getCodeReviewPrompt(name, promptArgs) ??
64
+ getIssueTriagePrompt(name, promptArgs) ??
65
+ getReleaseNotesPrompt(name, promptArgs) ??
66
+ getActivityPrompt(name, promptArgs);
67
+ return result;
52
68
  });
53
69
  // Connect via stdio
54
70
  const transport = new StdioServerTransport();
@@ -330,7 +330,7 @@ export const packagesCategory = {
330
330
  // get_all_package_versions_for_package_owned_by_authenticated_user
331
331
  {
332
332
  definition: {
333
- name: 'github_packages_get_all_package_versions_for_package_owned_by_authenticated_user',
333
+ name: 'github_packages_list_versions_for_auth_user',
334
334
  description: 'Get all package versions for a package owned by the authenticated user',
335
335
  inputSchema: {
336
336
  type: 'object',
@@ -375,7 +375,7 @@ export const packagesCategory = {
375
375
  // get_all_package_versions_for_package_owned_by_user
376
376
  {
377
377
  definition: {
378
- name: 'github_packages_get_all_package_versions_for_package_owned_by_user',
378
+ name: 'github_packages_list_versions_for_user',
379
379
  description: 'Get all package versions for a package owned by a user',
380
380
  inputSchema: {
381
381
  type: 'object',
@@ -419,7 +419,7 @@ export const packagesCategory = {
419
419
  // get_all_package_versions_for_package_owned_by_org
420
420
  {
421
421
  definition: {
422
- name: 'github_packages_get_all_package_versions_for_package_owned_by_org',
422
+ name: 'github_packages_list_versions_for_org',
423
423
  description: 'Get all package versions for a package owned by an organization',
424
424
  inputSchema: {
425
425
  type: 'object',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldraney/github-mcp",
3
- "version": "0.2.0-beta.0",
3
+ "version": "0.2.0-beta.2",
4
4
  "description": "GitHub MCP server with OAuth and 800+ API endpoints",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",