Skip to content

Commit 33eeacd

Browse files
Merge branch 'main' into docs/antigravity-mcp-config-path
2 parents a605418 + 71e83ae commit 33eeacd

119 files changed

Lines changed: 15414 additions & 386 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ third-party
77
**/*.yml
88
**/*.yaml
99
**/*.md
10+
!pkg/skills/catalog/skills/**/*.md
1011
**/*_test.go
1112
LICENSE

‎.github/agents/go-sdk-tool-migrator.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When generating the migration guide, consider the following aspects:
1515

1616
* The initial tool file and its corresponding test file will have the `//go:build ignore` build tag, as the tests will fail if the code is not ignored. The `ignore` build tag should be removed before work begins.
1717
* The import for `github.com/mark3labs/mcp-go/mcp` should be changed to `github.com/modelcontextprotocol/go-sdk/mcp`
18-
* The return type for the tool constructor function should be updated from `mcp.Tool, server.ToolHandlerFunc` to `(mcp.Tool, mcp.ToolHandlerFor[map[string]any, any])`.
18+
* The return type for the tool constructor function should be updated from `mcp.Tool, server.ToolHandlerFunc` to `inventory.ServerTool`.
1919
* The tool handler function signature should be updated to use generics, changing from `func(ctx context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)` to `func(context.Context, *mcp.CallToolRequest, map[string]any) (*mcp.CallToolResult, any, error)`.
2020
* The `RequiredParam`, `RequiredInt`, `RequiredBigInt`, `OptionalParamOK`, `OptionalParam`, `OptionalIntParam`, `OptionalIntParamWithDefault`, `OptionalBoolParamWithDefault`, `OptionalStringArrayParam`, `OptionalBigIntArrayParam` and `OptionalCursorPaginationParams` functions should be changed to use the tool arguments that are now passed as a map in the tool handler function, rather than extracting them from the `mcp.CallToolRequest`.
2121
* `mcp.NewToolResultText`, `mcp.NewToolResultError`, `mcp.NewToolResultErrorFromErr` and `mcp.NewToolResultResource` no longer available in `modelcontextprotocol/go-sdk`. There are a few helper functions available in `pkg/utils/result.go` that can be used to replace these, in the `utils` package.
@@ -64,7 +64,7 @@ The corresponding input schema in modelcontextprotocol/go-sdk would look like th
6464

6565
```go
6666
...
67-
return mcp.Tool{
67+
tool := mcp.Tool{
6868
Name: "list_dependabot_alerts",
6969
Description: t("TOOL_LIST_DEPENDABOT_ALERTS_DESCRIPTION", "List dependabot alerts in a GitHub repository."),
7070
Annotations: &mcp.ToolAnnotations{
@@ -86,7 +86,7 @@ return mcp.Tool{
8686
Type: "string",
8787
Description: "Filter dependabot alerts by state. Defaults to open",
8888
Enum: []any{"open", "fixed", "dismissed", "auto_dismissed"},
89-
Default: "open",
89+
Default: json.RawMessage(`"open"`),
9090
},
9191
"severity": {
9292
Type: "string",
@@ -109,4 +109,4 @@ At the end of your changes, you will continue to have an issue with the `toolsna
109109
UPDATE_TOOLSNAPS=true go test ./...
110110
```
111111

112-
You should however, only update the toolsnaps after confirming that the schema changes are intentional and correct. Some schema changes are unavoidable, such as argument ordering, however the schemas themselves should remain logically equivalent.
112+
You should however, only update the toolsnaps after confirming that the schema changes are intentional and correct. Some schema changes are unavoidable, however the schemas themselves should remain logically equivalent.

‎.github/copilot-instructions.md‎

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This is the **GitHub MCP Server**, a Model Context Protocol (MCP) server that co
1010
- **Primary Package:** github-mcp-server (stdio MCP server - **this is the main focus**)
1111
- **Secondary Package:** mcpcurl (testing utility - don't break it, but not the priority)
1212
- **Framework:** Uses modelcontextprotocol/go-sdk for MCP protocol, google/go-github for GitHub API
13-
- **Size:** ~60MB repository, 70 Go files
1413
- **Library Usage:** This repository is also used as a library by the remote server. Functions that could be called by other repositories should be exported (capitalized), even if not required internally. Preserve existing export patterns.
1514

1615
**Code Quality Standards:**
@@ -71,7 +70,7 @@ go test ./pkg/github -run TestGetMe
7170
├── pkg/ # Public API packages
7271
│ ├── github/ # GitHub API MCP tools implementation
7372
│ │ └── __toolsnaps__/ # Tool schema snapshots (*.snap files)
74-
│ ├── toolsets/ # Toolset configuration & management
73+
│ ├── inventory/ # Toolset configuration & management
7574
│ ├── errors/ # Error handling utilities
7675
│ ├── sanitize/ # HTML/content sanitization
7776
│ ├── log/ # Logging utilities
@@ -112,15 +111,15 @@ go test ./pkg/github -run TestGetMe
112111

113112
## GitHub Workflows (CI/CD)
114113

115-
All workflows run on push/PR unless noted. Located in `.github/workflows/`:
114+
Located in `.github/workflows/`:
116115

117116
1. **go.yml** - Build and test on ubuntu/windows/macos. Runs `script/test` and builds binary
118-
2. **lint.yml** - Runs golangci-lint-action v2.5 (GitHub Action) with actions/setup-go stable
117+
2. **lint.yml** - Runs golangci-lint-action (GitHub Action) with actions/setup-go using go.mod
119118
3. **docs-check.yml** - Verifies README.md is up-to-date by running generate-docs and checking git diff
120119
4. **code-scanning.yml** - CodeQL security analysis for Go and GitHub Actions
121120
5. **license-check.yml** - Runs `script/licenses-check` to validate compliance
122121
6. **docker-publish.yml** - Publishes container image to ghcr.io
123-
7. **goreleaser.yml** - Creates releases (main branch only)
122+
7. **goreleaser.yml** - Creates releases (version tags only)
124123
8. **registry-releaser.yml** - Updates MCP registry
125124

126125
**All of these must pass for PR merge.** If docs-check fails, run `script/generate-docs` and commit changes.
@@ -130,7 +129,7 @@ All workflows run on push/PR unless noted. Located in `.github/workflows/`:
130129
### Unit Tests
131130

132131
- Use `testify` for assertions (`require` for critical checks, `assert` for non-blocking)
133-
- Tests are in `*_test.go` files alongside implementation (internal tests, not `_test` package)
132+
- Tests are in `*_test.go` files alongside implementation (internal and external test packages)
134133
- Mock GitHub API with `go-github-mock` (REST) or `githubv4mock` (GraphQL)
135134
- Test structure for tools:
136135
1. Test tool snapshot
@@ -174,27 +173,30 @@ All workflows run on push/PR unless noted. Located in `.github/workflows/`:
174173
### Code Patterns
175174

176175
- **Keep changes minimal and focused** on the specific issue being addressed
177-
- **Prefer clarity over cleverness** - code must be understandable by a wide audience
178176
- **Atomic commits** - each commit should be a complete, logical change
179-
- **Maintain or improve structure** - never degrade code organization
180177
- Use table-driven tests for behavioral testing
181-
- Comment sparingly - code should be self-documenting
182178
- Follow standard Go conventions (Effective Go, Go proverbs)
183179
- **Test changes thoroughly** before committing
184-
- Export functions (capitalize) if they could be used by other repos as a library
185180

186181
## Common Development Workflows
187182

188183
### Adding a New MCP Tool
189184

190185
1. Add tool implementation in `pkg/github/` (e.g., `foo_tools.go`)
191-
2. Register tool in appropriate toolset in `pkg/github/` or `pkg/toolsets/`
192-
3. Write unit tests following the tool test pattern
193-
4. Run `UPDATE_TOOLSNAPS=true go test ./...` to create snapshot
194-
5. Run `script/generate-docs` to update README
195-
6. Run `script/lint` and `script/test` before committing
196-
7. If e2e tests are relevant, update `e2e/e2e_test.go` using existing test style
197-
8. Commit code + snapshots + README changes together
186+
2. Register tool in appropriate toolset in `pkg/github/`
187+
3. Update the relevant bundled skill, or add a reasoned exemption in `pkg/skills/catalog/availability_test.go`. Every tool must be covered or explicitly exempted.
188+
4. Write unit tests following the tool test pattern
189+
5. Run `UPDATE_TOOLSNAPS=true go test ./...` to create snapshot
190+
6. Run `script/generate-docs` to update README
191+
7. Run `script/lint` and `script/test` before committing
192+
8. If e2e tests are relevant, update `e2e/e2e_test.go` using existing test style
193+
9. Commit code + snapshots + README changes together
194+
195+
When adding or changing a toolset `InstructionsFunc`, update the associated
196+
skills as well: skills mode suppresses those instructions. The
197+
`TestToolsetInstructionsAreCoveredBySkills` failure names the skills to revisit;
198+
after updating them, refresh its digest with
199+
`UPDATE_SKILLS_INSTRUCTIONS=true go test ./pkg/github -run TestToolsetInstructionsAreCoveredBySkills -count=1`.
198200

199201
### Fixing a Bug
200202

@@ -270,22 +272,16 @@ server.json - MCP server registry metadata
270272
### Main Entry Point
271273

272274
`cmd/github-mcp-server/main.go` - Uses cobra for CLI, viper for config, supports:
273-
- `stdio` command (default) - MCP stdio transport
275+
- `stdio` command - MCP stdio transport
274276
- `generate-docs` command - Documentation generation
275277
- Flags: --toolsets, --read-only, --gh-host, --log-file
276278

277279
## Important Reminders
278280

279-
1. **PRIMARY FOCUS:** The local stdio MCP server (github-mcp-server) - this is what you should work on and test with
280-
2. **REMOTE SERVER:** Ignore remote server instructions when making code changes (unless specifically asked). This repo is used as a library by the remote server, so keep functions exported (capitalized) if they could be called by other repos, even if not needed internally.
281-
3. **ALWAYS** trust these instructions first - only search if information is incomplete or incorrect
282-
4. **NEVER** use `script/tag-release` or push tags
283-
5. **NEVER** skip `script/lint` before committing Go code changes
284-
6. **ALWAYS** update toolsnaps when changing MCP tool schemas
285-
7. **ALWAYS** run `script/generate-docs` after modifying tools
286-
8. For specific test files, use `go test ./path -run TestName` not full suite
287-
9. E2E tests require PAT token - you likely cannot run them
288-
10. Toolsnaps are API documentation - treat changes seriously
289-
11. Build/test/lint are very fast (~1s each) - run frequently
290-
12. CI failures for docs-check or license-check have simple fixes (run the script)
291-
13. mcpcurl is secondary - don't break it, but it's not the priority
281+
1. **REMOTE SERVER:** Ignore remote server instructions when making code changes (unless specifically asked). This repo is used as a library by the remote server, so keep functions exported (capitalized) if they could be called by other repos, even if not needed internally.
282+
2. **ALWAYS** trust these instructions first - only search if information is incomplete or incorrect
283+
3. **NEVER** use `script/tag-release` or push tags
284+
4. For specific test files, use `go test ./path -run TestName` not full suite
285+
5. Toolsnaps are API documentation - treat changes seriously
286+
6. Build/test/lint are very fast (~1s each) - run frequently
287+
7. CI failures for docs-check or license-check have simple fixes (run the script)

‎.github/pull_request_template.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ Note: if you're renaming tools, you *must* add the tool aliases. For more inform
4949

5050
- [ ] Not needed
5151
- [ ] Updated (README / docs / examples)
52+
53+
## Skills
54+
<!-- If this PR adds or changes MCP tools or toolset instructions, update the relevant bundled skills or explain why no skill applies. -->
55+
- [ ] Updated relevant skills or confirmed no bundled skill applies

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ For UI dependency upgrades, compare all four views (`get-me`, `issue-write`, `pr
6161
- If renaming a tool, add a deprecation alias (see [Tool Renaming Guide](docs/tool-renaming.md))
6262
- For toolset and icon configuration, see [Toolsets and Icons Guide](docs/toolsets-and-icons.md)
6363
- For typed tool registration and compatibility schemas, see [Typed Tool Schemas](docs/typed-tool-schemas.md)
64+
- When adding or changing tools or toolset instructions, update the relevant bundled skills or record why no skill applies. Run `go test ./pkg/skills/catalog -run TestCatalogToolRequirementsAreRegistered -count=1`; if the instruction snapshot fails, update the named skills and refresh it with `UPDATE_SKILLS_INSTRUCTIONS=true go test ./pkg/github -run TestToolsetInstructionsAreCoveredBySkills -count=1`. Run `script/generate-docs` to refresh the README catalog.
6465
6. Push to your fork and [submit a pull request][pr] targeting the `main` branch
6566
7. Pat yourself on the back and wait for your pull request to be reviewed and merged.
6667

0 commit comments

Comments
 (0)