@fre4x/github 1.0.30 → 1.0.40
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.
- package/README.md +69 -58
- package/dist/api.d.ts +10 -0
- package/dist/api.d.ts.map +1 -0
- package/{src/api.ts → dist/api.js} +103 -175
- package/dist/api.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26839 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +160 -0
- package/dist/index.test.js.map +1 -0
- package/dist/mock.d.ts +13 -0
- package/dist/mock.d.ts.map +1 -0
- package/{src/mock.ts → dist/mock.js} +11 -24
- package/dist/mock.js.map +1 -0
- package/{src/types.ts → dist/types.d.ts} +4 -16
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +32 -30
- package/CHANGELOG.md +0 -68
- package/bun.lock +0 -25
- package/src/index.test.ts +0 -246
- package/src/index.ts +0 -421
- package/tsconfig.json +0 -11
package/README.md
CHANGED
|
@@ -1,58 +1,69 @@
|
|
|
1
|
-
# @fre4x/github
|
|
2
|
-
|
|
3
|
-
MCP server for the GitHub API. This server enables searching for repositories, code, issues, and pull requests, getting specific repository details, and creating issues.
|
|
4
|
-
|
|
5
|
-
## Tools
|
|
6
|
-
|
|
7
|
-
| Tool | Description |
|
|
8
|
-
|---|---|
|
|
9
|
-
| `github_search_repositories` | Search for GitHub repositories. Supports limit and offset. |
|
|
10
|
-
| `github_search_code` | Search for code within GitHub repositories. Supports limit and offset. |
|
|
11
|
-
| `github_search_issues_and_prs` | Search for issues and pull requests. Supports limit and offset. |
|
|
12
|
-
| `github_get_repository` | Get details for a specific repository (owner and repo name required). |
|
|
13
|
-
| `github_list_issues` | List issues in a specific repository. Supports state, limit and offset. |
|
|
14
|
-
| `github_create_issue` | Create an issue in a repository. |
|
|
15
|
-
| `github_get_pull_request` | Get details for a specific pull request. |
|
|
16
|
-
| `github_list_pull_requests` | List pull requests in a specific repository. Supports state, limit and offset. |
|
|
17
|
-
|
|
18
|
-
## Mock Mode
|
|
19
|
-
|
|
20
|
-
A fully functional mock mode is available for offline testing and evaluation. It operates identically to the real API but returns static fixture data.
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
MOCK=true npx @fre4x/github
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Configuration
|
|
27
|
-
|
|
28
|
-
To use this with Claude Desktop, add the following to your `claude_desktop_config.json`:
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"mcpServers": {
|
|
33
|
-
"github": {
|
|
34
|
-
"command": "npx",
|
|
35
|
-
"args": ["-y", "@fre4x/github"],
|
|
36
|
-
"env": {
|
|
37
|
-
"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
1
|
+
# @fre4x/github
|
|
2
|
+
|
|
3
|
+
MCP server for the GitHub API. This server enables searching for repositories, code, issues, and pull requests, getting specific repository details, and creating issues.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `github_search_repositories` | Search for GitHub repositories. Supports limit and offset. |
|
|
10
|
+
| `github_search_code` | Search for code within GitHub repositories. Supports limit and offset. |
|
|
11
|
+
| `github_search_issues_and_prs` | Search for issues and pull requests. Supports limit and offset. |
|
|
12
|
+
| `github_get_repository` | Get details for a specific repository (owner and repo name required). |
|
|
13
|
+
| `github_list_issues` | List issues in a specific repository. Supports state, limit and offset. |
|
|
14
|
+
| `github_create_issue` | Create an issue in a repository. |
|
|
15
|
+
| `github_get_pull_request` | Get details for a specific pull request. |
|
|
16
|
+
| `github_list_pull_requests` | List pull requests in a specific repository. Supports state, limit and offset. |
|
|
17
|
+
|
|
18
|
+
## Mock Mode
|
|
19
|
+
|
|
20
|
+
A fully functional mock mode is available for offline testing and evaluation. It operates identically to the real API but returns static fixture data.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
MOCK=true npx @fre4x/github
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Configuration
|
|
27
|
+
|
|
28
|
+
To use this with Claude Desktop, add the following to your `claude_desktop_config.json`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"github": {
|
|
34
|
+
"command": "npx",
|
|
35
|
+
"args": ["-y", "@fre4x/github"],
|
|
36
|
+
"env": {
|
|
37
|
+
"GITHUB_TOKEN": "your_personal_access_token_here"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Note:** Both `GITHUB_TOKEN` and `GITHUB_PAT` are accepted. Token is optional — unauthenticated requests work but are rate-limited to 60 req/hour.
|
|
45
|
+
|
|
46
|
+
Or run in mock mode:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"github": {
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": ["-y", "@fre4x/github"],
|
|
54
|
+
"env": {
|
|
55
|
+
"MOCK": "true"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install
|
|
66
|
+
npm run dev # tsx, no build
|
|
67
|
+
npm run build # esbuild → dist/
|
|
68
|
+
npm test # vitest unit tests
|
|
69
|
+
```
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SearchRepositoriesParams, SearchRepositoriesResponse, SearchCodeParams, SearchCodeResponse, SearchIssuesAndPrsParams, SearchIssuesAndPrsResponse, GetRepositoryParams, GetRepositoryResponse, ListIssuesParams, ListIssuesResponse, CreateIssueParams, CreateIssueResponse, GetPullRequestParams, GetPullRequestResponse, ListPullRequestsParams, ListPullRequestsResponse } from './types.js';
|
|
2
|
+
export declare function searchRepositories(params: SearchRepositoriesParams): Promise<SearchRepositoriesResponse>;
|
|
3
|
+
export declare function searchCode(params: SearchCodeParams): Promise<SearchCodeResponse>;
|
|
4
|
+
export declare function searchIssuesAndPrs(params: SearchIssuesAndPrsParams): Promise<SearchIssuesAndPrsResponse>;
|
|
5
|
+
export declare function getRepository(params: GetRepositoryParams): Promise<GetRepositoryResponse>;
|
|
6
|
+
export declare function listIssues(params: ListIssuesParams): Promise<ListIssuesResponse>;
|
|
7
|
+
export declare function createIssue(params: CreateIssueParams): Promise<CreateIssueResponse>;
|
|
8
|
+
export declare function getPullRequest(params: GetPullRequestParams): Promise<GetPullRequestResponse>;
|
|
9
|
+
export declare function listPullRequests(params: ListPullRequestsParams): Promise<ListPullRequestsResponse>;
|
|
10
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EAC3B,MAAM,YAAY,CAAC;AAUpB,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,wBAAwB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAuCrC;AAED,wBAAsB,UAAU,CAC5B,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAuC7B;AAED,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,wBAAwB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAwCrC;AAED,wBAAsB,aAAa,CAC/B,MAAM,EAAE,mBAAmB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAgChC;AAED,wBAAsB,UAAU,CAC5B,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CA0C7B;AAED,wBAAsB,WAAW,CAC7B,MAAM,EAAE,iBAAiB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CA2B9B;AAED,wBAAsB,cAAc,CAChC,MAAM,EAAE,oBAAoB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CAgCjC;AAED,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,sBAAsB,GAC/B,OAAO,CAAC,wBAAwB,CAAC,CA0CnC"}
|
|
@@ -1,42 +1,19 @@
|
|
|
1
1
|
import { Octokit } from '@octokit/rest';
|
|
2
|
-
import type {
|
|
3
|
-
SearchRepositoriesParams,
|
|
4
|
-
SearchRepositoriesResponse,
|
|
5
|
-
SearchCodeParams,
|
|
6
|
-
SearchCodeResponse,
|
|
7
|
-
SearchIssuesAndPrsParams,
|
|
8
|
-
SearchIssuesAndPrsResponse,
|
|
9
|
-
GetRepositoryParams,
|
|
10
|
-
GetRepositoryResponse,
|
|
11
|
-
ListIssuesParams,
|
|
12
|
-
ListIssuesResponse,
|
|
13
|
-
CreateIssueParams,
|
|
14
|
-
CreateIssueResponse,
|
|
15
|
-
GetPullRequestParams,
|
|
16
|
-
GetPullRequestResponse,
|
|
17
|
-
ListPullRequestsParams,
|
|
18
|
-
ListPullRequestsResponse,
|
|
19
|
-
} from './types.js';
|
|
20
2
|
import { IS_MOCK, MOCK_FIXTURES } from './mock.js';
|
|
21
3
|
import { createApiError, createNotFoundError } from '@fre4x/mcp-shared';
|
|
22
|
-
|
|
23
4
|
const getOctokit = () => {
|
|
24
5
|
return new Octokit({
|
|
25
6
|
auth: process.env.GITHUB_PAT || process.env.GITHUB_TOKEN,
|
|
26
7
|
});
|
|
27
8
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
): Promise<SearchRepositoriesResponse> {
|
|
32
|
-
if (IS_MOCK()) return MOCK_FIXTURES.searchRepositories;
|
|
33
|
-
|
|
9
|
+
export async function searchRepositories(params) {
|
|
10
|
+
if (IS_MOCK())
|
|
11
|
+
return MOCK_FIXTURES.searchRepositories;
|
|
34
12
|
const limit = Math.max(1, params.limit ?? 10);
|
|
35
13
|
const offset = Math.max(0, params.offset ?? 0);
|
|
36
14
|
const per_page = 100;
|
|
37
15
|
const page = Math.floor(offset / per_page) + 1;
|
|
38
16
|
const offsetInPage = offset % per_page;
|
|
39
|
-
|
|
40
17
|
try {
|
|
41
18
|
const octokit = getOctokit();
|
|
42
19
|
const response = await octokit.rest.search.repos({
|
|
@@ -44,42 +21,35 @@ export async function searchRepositories(
|
|
|
44
21
|
per_page,
|
|
45
22
|
page,
|
|
46
23
|
});
|
|
47
|
-
|
|
48
24
|
const items = response.data.items
|
|
49
25
|
.slice(offsetInPage, offsetInPage + limit)
|
|
50
26
|
.map((item) => ({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
27
|
+
full_name: item.full_name,
|
|
28
|
+
description: item.description,
|
|
29
|
+
stargazers_count: item.stargazers_count,
|
|
30
|
+
html_url: item.html_url,
|
|
31
|
+
}));
|
|
57
32
|
return {
|
|
58
33
|
items,
|
|
59
34
|
total: response.data.total_count,
|
|
60
35
|
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const status =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
: undefined;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
39
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
40
|
+
? Number(error.status)
|
|
41
|
+
: undefined;
|
|
68
42
|
throw createApiError(message, status);
|
|
69
43
|
}
|
|
70
44
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
): Promise<SearchCodeResponse> {
|
|
75
|
-
if (IS_MOCK()) return MOCK_FIXTURES.searchCode;
|
|
76
|
-
|
|
45
|
+
export async function searchCode(params) {
|
|
46
|
+
if (IS_MOCK())
|
|
47
|
+
return MOCK_FIXTURES.searchCode;
|
|
77
48
|
const limit = Math.max(1, params.limit ?? 10);
|
|
78
49
|
const offset = Math.max(0, params.offset ?? 0);
|
|
79
50
|
const per_page = 100;
|
|
80
51
|
const page = Math.floor(offset / per_page) + 1;
|
|
81
52
|
const offsetInPage = offset % per_page;
|
|
82
|
-
|
|
83
53
|
try {
|
|
84
54
|
const octokit = getOctokit();
|
|
85
55
|
const response = await octokit.rest.search.code({
|
|
@@ -87,42 +57,35 @@ export async function searchCode(
|
|
|
87
57
|
per_page,
|
|
88
58
|
page,
|
|
89
59
|
});
|
|
90
|
-
|
|
91
60
|
const items = response.data.items
|
|
92
61
|
.slice(offsetInPage, offsetInPage + limit)
|
|
93
62
|
.map((item) => ({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
63
|
+
name: item.name,
|
|
64
|
+
path: item.path,
|
|
65
|
+
repository: { full_name: item.repository.full_name },
|
|
66
|
+
html_url: item.html_url,
|
|
67
|
+
}));
|
|
100
68
|
return {
|
|
101
69
|
items,
|
|
102
70
|
total: response.data.total_count,
|
|
103
71
|
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const status =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
: undefined;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
75
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
76
|
+
? Number(error.status)
|
|
77
|
+
: undefined;
|
|
111
78
|
throw createApiError(message, status);
|
|
112
79
|
}
|
|
113
80
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
): Promise<SearchIssuesAndPrsResponse> {
|
|
118
|
-
if (IS_MOCK()) return MOCK_FIXTURES.searchIssuesAndPrs;
|
|
119
|
-
|
|
81
|
+
export async function searchIssuesAndPrs(params) {
|
|
82
|
+
if (IS_MOCK())
|
|
83
|
+
return MOCK_FIXTURES.searchIssuesAndPrs;
|
|
120
84
|
const limit = Math.max(1, params.limit ?? 10);
|
|
121
85
|
const offset = Math.max(0, params.offset ?? 0);
|
|
122
86
|
const per_page = 100;
|
|
123
87
|
const page = Math.floor(offset / per_page) + 1;
|
|
124
88
|
const offsetInPage = offset % per_page;
|
|
125
|
-
|
|
126
89
|
try {
|
|
127
90
|
const octokit = getOctokit();
|
|
128
91
|
const response = await octokit.rest.search.issuesAndPullRequests({
|
|
@@ -130,44 +93,37 @@ export async function searchIssuesAndPrs(
|
|
|
130
93
|
per_page,
|
|
131
94
|
page,
|
|
132
95
|
});
|
|
133
|
-
|
|
134
96
|
const items = response.data.items
|
|
135
97
|
.slice(offsetInPage, offsetInPage + limit)
|
|
136
98
|
.map((item) => ({
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
99
|
+
title: item.title,
|
|
100
|
+
number: item.number,
|
|
101
|
+
state: item.state,
|
|
102
|
+
html_url: item.html_url,
|
|
103
|
+
repository_url: item.repository_url,
|
|
104
|
+
}));
|
|
144
105
|
return {
|
|
145
106
|
items,
|
|
146
107
|
total: response.data.total_count,
|
|
147
108
|
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const status =
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
: undefined;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
112
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
113
|
+
? Number(error.status)
|
|
114
|
+
: undefined;
|
|
155
115
|
throw createApiError(message, status);
|
|
156
116
|
}
|
|
157
117
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
): Promise<GetRepositoryResponse> {
|
|
162
|
-
if (IS_MOCK()) return MOCK_FIXTURES.getRepository;
|
|
163
|
-
|
|
118
|
+
export async function getRepository(params) {
|
|
119
|
+
if (IS_MOCK())
|
|
120
|
+
return MOCK_FIXTURES.getRepository;
|
|
164
121
|
try {
|
|
165
122
|
const octokit = getOctokit();
|
|
166
123
|
const response = await octokit.rest.repos.get({
|
|
167
124
|
owner: params.owner,
|
|
168
125
|
repo: params.repo,
|
|
169
126
|
});
|
|
170
|
-
|
|
171
127
|
return {
|
|
172
128
|
full_name: response.data.full_name,
|
|
173
129
|
description: response.data.description,
|
|
@@ -177,32 +133,25 @@ export async function getRepository(
|
|
|
177
133
|
html_url: response.data.html_url,
|
|
178
134
|
default_branch: response.data.default_branch,
|
|
179
135
|
};
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
139
|
+
? Number(error.status)
|
|
140
|
+
: undefined;
|
|
185
141
|
if (status === 404)
|
|
186
|
-
throw createNotFoundError(
|
|
187
|
-
|
|
188
|
-
);
|
|
189
|
-
const message =
|
|
190
|
-
error instanceof Error ? error.message : 'GitHub API error';
|
|
142
|
+
throw createNotFoundError(`Repository ${params.owner}/${params.repo} not found`);
|
|
143
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
191
144
|
throw createApiError(message, status);
|
|
192
145
|
}
|
|
193
146
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
): Promise<ListIssuesResponse> {
|
|
198
|
-
if (IS_MOCK()) return MOCK_FIXTURES.listIssues;
|
|
199
|
-
|
|
147
|
+
export async function listIssues(params) {
|
|
148
|
+
if (IS_MOCK())
|
|
149
|
+
return MOCK_FIXTURES.listIssues;
|
|
200
150
|
const limit = Math.max(1, params.limit ?? 10);
|
|
201
151
|
const offset = Math.max(0, params.offset ?? 0);
|
|
202
152
|
const per_page = 100;
|
|
203
153
|
const page = Math.floor(offset / per_page) + 1;
|
|
204
154
|
const offsetInPage = offset % per_page;
|
|
205
|
-
|
|
206
155
|
try {
|
|
207
156
|
const octokit = getOctokit();
|
|
208
157
|
const response = await octokit.rest.issues.listForRepo({
|
|
@@ -212,37 +161,31 @@ export async function listIssues(
|
|
|
212
161
|
per_page,
|
|
213
162
|
page,
|
|
214
163
|
});
|
|
215
|
-
|
|
216
164
|
const items = response.data
|
|
217
165
|
.slice(offsetInPage, offsetInPage + limit)
|
|
218
166
|
.map((item) => ({
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
167
|
+
title: item.title,
|
|
168
|
+
number: item.number,
|
|
169
|
+
state: item.state,
|
|
170
|
+
html_url: item.html_url,
|
|
171
|
+
body: item.body,
|
|
172
|
+
}));
|
|
226
173
|
return {
|
|
227
174
|
items,
|
|
228
175
|
total: items.length, // Still using slice length as total for now
|
|
229
176
|
};
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const status =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
: undefined;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
180
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
181
|
+
? Number(error.status)
|
|
182
|
+
: undefined;
|
|
237
183
|
throw createApiError(message, status);
|
|
238
184
|
}
|
|
239
185
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
): Promise<CreateIssueResponse> {
|
|
244
|
-
if (IS_MOCK()) return MOCK_FIXTURES.createIssue;
|
|
245
|
-
|
|
186
|
+
export async function createIssue(params) {
|
|
187
|
+
if (IS_MOCK())
|
|
188
|
+
return MOCK_FIXTURES.createIssue;
|
|
246
189
|
try {
|
|
247
190
|
const octokit = getOctokit();
|
|
248
191
|
const response = await octokit.rest.issues.create({
|
|
@@ -251,29 +194,24 @@ export async function createIssue(
|
|
|
251
194
|
title: params.title,
|
|
252
195
|
body: params.body,
|
|
253
196
|
});
|
|
254
|
-
|
|
255
197
|
return {
|
|
256
198
|
title: response.data.title,
|
|
257
199
|
number: response.data.number,
|
|
258
200
|
state: response.data.state,
|
|
259
201
|
html_url: response.data.html_url,
|
|
260
202
|
};
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const status =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
: undefined;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
206
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
207
|
+
? Number(error.status)
|
|
208
|
+
: undefined;
|
|
268
209
|
throw createApiError(message, status);
|
|
269
210
|
}
|
|
270
211
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
): Promise<GetPullRequestResponse> {
|
|
275
|
-
if (IS_MOCK()) return MOCK_FIXTURES.getPullRequest;
|
|
276
|
-
|
|
212
|
+
export async function getPullRequest(params) {
|
|
213
|
+
if (IS_MOCK())
|
|
214
|
+
return MOCK_FIXTURES.getPullRequest;
|
|
277
215
|
try {
|
|
278
216
|
const octokit = getOctokit();
|
|
279
217
|
const response = await octokit.rest.pulls.get({
|
|
@@ -281,7 +219,6 @@ export async function getPullRequest(
|
|
|
281
219
|
repo: params.repo,
|
|
282
220
|
pull_number: params.pull_number,
|
|
283
221
|
});
|
|
284
|
-
|
|
285
222
|
return {
|
|
286
223
|
title: response.data.title,
|
|
287
224
|
number: response.data.number,
|
|
@@ -290,32 +227,25 @@ export async function getPullRequest(
|
|
|
290
227
|
body: response.data.body,
|
|
291
228
|
merged: response.data.merged,
|
|
292
229
|
};
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
233
|
+
? Number(error.status)
|
|
234
|
+
: undefined;
|
|
298
235
|
if (status === 404)
|
|
299
|
-
throw createNotFoundError(
|
|
300
|
-
|
|
301
|
-
);
|
|
302
|
-
const message =
|
|
303
|
-
error instanceof Error ? error.message : 'GitHub API error';
|
|
236
|
+
throw createNotFoundError(`Pull request ${params.pull_number} not found`);
|
|
237
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
304
238
|
throw createApiError(message, status);
|
|
305
239
|
}
|
|
306
240
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
): Promise<ListPullRequestsResponse> {
|
|
311
|
-
if (IS_MOCK()) return MOCK_FIXTURES.listPullRequests;
|
|
312
|
-
|
|
241
|
+
export async function listPullRequests(params) {
|
|
242
|
+
if (IS_MOCK())
|
|
243
|
+
return MOCK_FIXTURES.listPullRequests;
|
|
313
244
|
const limit = Math.max(1, params.limit ?? 10);
|
|
314
245
|
const offset = Math.max(0, params.offset ?? 0);
|
|
315
246
|
const per_page = 100;
|
|
316
247
|
const page = Math.floor(offset / per_page) + 1;
|
|
317
248
|
const offsetInPage = offset % per_page;
|
|
318
|
-
|
|
319
249
|
try {
|
|
320
250
|
const octokit = getOctokit();
|
|
321
251
|
const response = await octokit.rest.pulls.list({
|
|
@@ -325,28 +255,26 @@ export async function listPullRequests(
|
|
|
325
255
|
per_page,
|
|
326
256
|
page,
|
|
327
257
|
});
|
|
328
|
-
|
|
329
258
|
const items = response.data
|
|
330
259
|
.slice(offsetInPage, offsetInPage + limit)
|
|
331
260
|
.map((item) => ({
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
261
|
+
title: item.title,
|
|
262
|
+
number: item.number,
|
|
263
|
+
state: item.state,
|
|
264
|
+
html_url: item.html_url,
|
|
265
|
+
body: item.body,
|
|
266
|
+
}));
|
|
339
267
|
return {
|
|
340
268
|
items,
|
|
341
269
|
total: items.length, // Still using slice length as total for now
|
|
342
270
|
};
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const status =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
: undefined;
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
const message = error instanceof Error ? error.message : 'GitHub API error';
|
|
274
|
+
const status = typeof error === 'object' && error !== null && 'status' in error
|
|
275
|
+
? Number(error.status)
|
|
276
|
+
: undefined;
|
|
350
277
|
throw createApiError(message, status);
|
|
351
278
|
}
|
|
352
279
|
}
|
|
280
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAmBxC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,UAAU,GAAG,GAAG,EAAE;IACpB,OAAO,IAAI,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU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AE,IAAI,CAAC,IAAI;SAClB,CAAC,CAAC,CAAC;QAER,OAAO;YACH,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,4CAA4C;SACpE,CAAC;IACN,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,MAAM,OAAO,GACT,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC;QAChE,MAAM,MAAM,GACR,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK;YAC5D,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YACtB,CAAC,CAAC,SAAS,CAAC;QACpB,MAAM,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
declare const server: Server<{
|
|
3
|
+
method: string;
|
|
4
|
+
params?: {
|
|
5
|
+
[x: string]: unknown;
|
|
6
|
+
_meta?: {
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
progressToken?: string | number | undefined;
|
|
9
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
10
|
+
taskId: string;
|
|
11
|
+
} | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
method: string;
|
|
16
|
+
params?: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
_meta?: {
|
|
19
|
+
[x: string]: unknown;
|
|
20
|
+
progressToken?: string | number | undefined;
|
|
21
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
22
|
+
taskId: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
[x: string]: unknown;
|
|
28
|
+
_meta?: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
progressToken?: string | number | undefined;
|
|
31
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
32
|
+
taskId: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export { server };
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA8BnE,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUX,CAAC;AA4XF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|