Skip to content

Commit 3500525

Browse files
committed
Merge remote-tracking branch 'origin/omgitsads/go-sdk' into copilot/migrate-dependabot-toolset
2 parents b6d8c2b + c06ace3 commit 3500525

25 files changed

+1396
-862
lines changed

cmd/github-mcp-server/generate_docs.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,12 @@ func generateToolDoc(tool mcp.Tool) string {
225225
lines = append(lines, fmt.Sprintf("- **%s** - %s", tool.Name, tool.Annotations.Title))
226226

227227
// Parameters
228+
if tool.InputSchema == nil {
229+
lines = append(lines, " - No parameters required")
230+
return strings.Join(lines, "\n")
231+
}
228232
schema, ok := tool.InputSchema.(*jsonschema.Schema)
229-
if !ok {
233+
if !ok || schema == nil {
230234
lines = append(lines, " - No parameters required")
231235
return strings.Join(lines, "\n")
232236
}

internal/ghmcp/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ type MCPServerConfig struct {
5757
Logger *slog.Logger
5858
}
5959

60-
const stdioServerLogPrefix = "stdioserver"
61-
6260
func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
6361
apiHost, err := parseAPIHost(cfg.Host)
6462
if err != nil {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"annotations": {
3+
"title": "Create Gist"
4+
},
5+
"description": "Create a new gist",
6+
"inputSchema": {
7+
"type": "object",
8+
"required": [
9+
"filename",
10+
"content"
11+
],
12+
"properties": {
13+
"content": {
14+
"type": "string",
15+
"description": "Content for simple single-file gist creation"
16+
},
17+
"description": {
18+
"type": "string",
19+
"description": "Description of the gist"
20+
},
21+
"filename": {
22+
"type": "string",
23+
"description": "Filename for simple single-file gist creation"
24+
},
25+
"public": {
26+
"type": "boolean",
27+
"description": "Whether the gist is public",
28+
"default": false
29+
}
30+
}
31+
},
32+
"name": "create_gist"
33+
}
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
22
"annotations": {
3-
"title": "Get code scanning alert",
4-
"readOnlyHint": true
3+
"readOnlyHint": true,
4+
"title": "Get code scanning alert"
55
},
66
"description": "Get details of a specific code scanning alert in a GitHub repository.",
77
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"owner",
11+
"repo",
12+
"alertNumber"
13+
],
814
"properties": {
915
"alertNumber": {
10-
"description": "The number of the alert.",
11-
"type": "number"
16+
"type": "number",
17+
"description": "The number of the alert."
1218
},
1319
"owner": {
14-
"description": "The owner of the repository.",
15-
"type": "string"
20+
"type": "string",
21+
"description": "The owner of the repository."
1622
},
1723
"repo": {
18-
"description": "The name of the repository.",
19-
"type": "string"
24+
"type": "string",
25+
"description": "The name of the repository."
2026
}
21-
},
22-
"required": [
23-
"owner",
24-
"repo",
25-
"alertNumber"
26-
],
27-
"type": "object"
27+
}
2828
},
2929
"name": "get_code_scanning_alert"
3030
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "Get Gist Content"
5+
},
6+
"description": "Get gist content of a particular gist, by gist ID",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"gist_id"
11+
],
12+
"properties": {
13+
"gist_id": {
14+
"type": "string",
15+
"description": "The ID of the gist"
16+
}
17+
}
18+
},
19+
"name": "get_gist"
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "Get a global security advisory"
5+
},
6+
"description": "Get a global security advisory",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"ghsaId"
11+
],
12+
"properties": {
13+
"ghsaId": {
14+
"type": "string",
15+
"description": "GitHub Security Advisory ID (format: GHSA-xxxx-xxxx-xxxx)."
16+
}
17+
}
18+
},
19+
"name": "get_global_security_advisory"
20+
}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
{
22
"annotations": {
3-
"title": "List code scanning alerts",
4-
"readOnlyHint": true
3+
"readOnlyHint": true,
4+
"title": "List code scanning alerts"
55
},
66
"description": "List code scanning alerts in a GitHub repository.",
77
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"owner",
11+
"repo"
12+
],
813
"properties": {
914
"owner": {
10-
"description": "The owner of the repository.",
11-
"type": "string"
15+
"type": "string",
16+
"description": "The owner of the repository."
1217
},
1318
"ref": {
14-
"description": "The Git reference for the results you want to list.",
15-
"type": "string"
19+
"type": "string",
20+
"description": "The Git reference for the results you want to list."
1621
},
1722
"repo": {
18-
"description": "The name of the repository.",
19-
"type": "string"
23+
"type": "string",
24+
"description": "The name of the repository."
2025
},
2126
"severity": {
27+
"type": "string",
2228
"description": "Filter code scanning alerts by severity",
2329
"enum": [
2430
"critical",
@@ -28,30 +34,24 @@
2834
"warning",
2935
"note",
3036
"error"
31-
],
32-
"type": "string"
37+
]
3338
},
3439
"state": {
35-
"default": "open",
40+
"type": "string",
3641
"description": "Filter code scanning alerts by state. Defaults to open",
42+
"default": "open",
3743
"enum": [
3844
"open",
3945
"closed",
4046
"dismissed",
4147
"fixed"
42-
],
43-
"type": "string"
48+
]
4449
},
4550
"tool_name": {
46-
"description": "The name of the tool used for code scanning.",
47-
"type": "string"
51+
"type": "string",
52+
"description": "The name of the tool used for code scanning."
4853
}
49-
},
50-
"required": [
51-
"owner",
52-
"repo"
53-
],
54-
"type": "object"
54+
}
5555
},
5656
"name": "list_code_scanning_alerts"
5757
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List Gists"
5+
},
6+
"description": "List gists for a user",
7+
"inputSchema": {
8+
"type": "object",
9+
"properties": {
10+
"page": {
11+
"type": "number",
12+
"description": "Page number for pagination (min 1)",
13+
"minimum": 1
14+
},
15+
"perPage": {
16+
"type": "number",
17+
"description": "Results per page for pagination (min 1, max 100)",
18+
"minimum": 1,
19+
"maximum": 100
20+
},
21+
"since": {
22+
"type": "string",
23+
"description": "Only gists updated after this time (ISO 8601 timestamp)"
24+
},
25+
"username": {
26+
"type": "string",
27+
"description": "GitHub username (omit for authenticated user's gists)"
28+
}
29+
}
30+
},
31+
"name": "list_gists"
32+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List global security advisories"
5+
},
6+
"description": "List global security advisories from GitHub.",
7+
"inputSchema": {
8+
"type": "object",
9+
"properties": {
10+
"affects": {
11+
"type": "string",
12+
"description": "Filter advisories by affected package or version (e.g. \"package1,package2@1.0.0\")."
13+
},
14+
"cveId": {
15+
"type": "string",
16+
"description": "Filter by CVE ID."
17+
},
18+
"cwes": {
19+
"type": "array",
20+
"description": "Filter by Common Weakness Enumeration IDs (e.g. [\"79\", \"284\", \"22\"]).",
21+
"items": {
22+
"type": "string"
23+
}
24+
},
25+
"ecosystem": {
26+
"type": "string",
27+
"description": "Filter by package ecosystem.",
28+
"enum": [
29+
"actions",
30+
"composer",
31+
"erlang",
32+
"go",
33+
"maven",
34+
"npm",
35+
"nuget",
36+
"other",
37+
"pip",
38+
"pub",
39+
"rubygems",
40+
"rust"
41+
]
42+
},
43+
"ghsaId": {
44+
"type": "string",
45+
"description": "Filter by GitHub Security Advisory ID (format: GHSA-xxxx-xxxx-xxxx)."
46+
},
47+
"isWithdrawn": {
48+
"type": "boolean",
49+
"description": "Whether to only return withdrawn advisories."
50+
},
51+
"modified": {
52+
"type": "string",
53+
"description": "Filter by publish or update date or date range (ISO 8601 date or range)."
54+
},
55+
"published": {
56+
"type": "string",
57+
"description": "Filter by publish date or date range (ISO 8601 date or range)."
58+
},
59+
"severity": {
60+
"type": "string",
61+
"description": "Filter by severity.",
62+
"enum": [
63+
"unknown",
64+
"low",
65+
"medium",
66+
"high",
67+
"critical"
68+
]
69+
},
70+
"type": {
71+
"type": "string",
72+
"description": "Advisory type.",
73+
"default": "reviewed",
74+
"enum": [
75+
"reviewed",
76+
"malware",
77+
"unreviewed"
78+
]
79+
},
80+
"updated": {
81+
"type": "string",
82+
"description": "Filter by update date or date range (ISO 8601 date or range)."
83+
}
84+
}
85+
},
86+
"name": "list_global_security_advisories"
87+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List org repository security advisories"
5+
},
6+
"description": "List repository security advisories for a GitHub organization.",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"org"
11+
],
12+
"properties": {
13+
"direction": {
14+
"type": "string",
15+
"description": "Sort direction.",
16+
"enum": [
17+
"asc",
18+
"desc"
19+
]
20+
},
21+
"org": {
22+
"type": "string",
23+
"description": "The organization login."
24+
},
25+
"sort": {
26+
"type": "string",
27+
"description": "Sort field.",
28+
"enum": [
29+
"created",
30+
"updated",
31+
"published"
32+
]
33+
},
34+
"state": {
35+
"type": "string",
36+
"description": "Filter by advisory state.",
37+
"enum": [
38+
"triage",
39+
"draft",
40+
"published",
41+
"closed"
42+
]
43+
}
44+
}
45+
},
46+
"name": "list_org_repository_security_advisories"
47+
}

0 commit comments

Comments
 (0)