You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.**PRIMARY FOCUS:** The local stdio MCP server (github-mcp-server) - this is what you should work on and test with
281
-
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.
282
-
3.**ALWAYS** trust these instructions first - only search if information is incomplete or incorrect
283
-
4.**NEVER** use `script/tag-release` or push tags
284
-
5.**NEVER** skip `script/lint` before committing Go code changes
285
-
6.**ALWAYS** update toolsnaps when changing MCP tool schemas
286
-
7.**ALWAYS** run `script/generate-docs` after modifying tools
287
-
8. For specific test files, use `go test ./path -run TestName` not full suite
288
-
9. E2E tests require PAT token - you likely cannot run them
289
-
10. Toolsnaps are API documentation - treat changes seriously
290
-
11. Build/test/lint are very fast (~1s each) - run frequently
291
-
12. CI failures for docs-check or license-check have simple fixes (run the script)
292
-
13. mcpcurl is secondary - don't break it, but it's not the priority
56
+
Required quick commands (run before committing):
57
+
58
+
- `script/lint` — formats and runs `golangci-lint` (always run).
- If you changed tool schemas: `UPDATE_TOOLSNAPS=true go test ./...` and commit files from `pkg/github/__toolsnaps__/`.
61
+
- If you changed tools/docs: `script/generate-docs` to refresh README tool docs.
62
+
63
+
Important patterns and conventions (project-specific):
64
+
65
+
- Tool snapshots: every MCP tool has a JSON `.snap`in`pkg/github/__toolsnaps__`. Tests fail on snapshot drift — update intentionally with `UPDATE_TOOLSNAPS=true`.
66
+
- Tool registration & prompts: search `pkg/github/*_tools.go`, `prompts.go`, and `workflow_prompts.go`for examples of tool prompts and usage (e.g., `AssignCodingAgentPrompt`).
67
+
- Export surface: this repo is consumed as a library by other servers — prefer exporting functions (capitalize) when they might be reused.
68
+
- Naming: acronyms use ALL CAPS in identifiers (`ID`, `HTTP`, `API`, `URL`).
69
+
- Tests: table-driven tests are common. Mocks used: `go-github-mock` (REST) and `internal/githubv4mock` (GraphQL).
- Tool prompts and registration: [pkg/github/issues.go](pkg/github/issues.go) and [pkg/github/prompts.go](pkg/github/prompts.go)
75
+
- Main server entry: [cmd/github-mcp-server/main.go](cmd/github-mcp-server/main.go)
76
+
- Core wiring and middleware: [internal/ghmcp/server.go](internal/ghmcp/server.go)
77
+
78
+
CI and workflows:
79
+
80
+
- CI runs `script/test` and `script/lint`. `docs-check.yml` ensures `script/generate-docs` is run when tools change.
81
+
- Don't use `script/tag-release`; releases are managed separately.
82
+
83
+
Developer tips for agents:
84
+
85
+
- When adding or modifying a tool: implement in `pkg/github/`, add tests, run `UPDATE_TOOLSNAPS=true go test ./...`, run `script/generate-docs`, then `script/lint` and `script/test`.
86
+
- Use focused tests: `go test ./pkg/github -run TestName` or `go test ./pkg/github -run TestGetMe`.
87
+
- E2E tests require a GitHub PAT and are in `e2e/` (run with `GITHUB_MCP_SERVER_E2E_TOKEN=<token> go test -v --tags e2e ./e2e`).
88
+
89
+
If anything in these instructions is unclear or missing, tell me which areas you'd like expanded (examples, common code locations, or sample PR checklist).
90
+
Below is an optional appendix with concrete commands, CI notes, a PR checklist, and a short commit/PR template for changes that affect toolsnaps or generated docs.
91
+
92
+
---
93
+
94
+
**Appendix — Scripts, CI notes, PR checklist**
95
+
96
+
- Quick scripts (run before commit or when CI fails):
97
+
- `script/lint` — formats and runs `golangci-lint` (auto-fixes formatting).
98
+
- `script/test` — full unit test suite (`go test -race ./...`).
99
+
- `UPDATE_TOOLSNAPS=true go test ./...` — regenerate tool schema snapshots (`pkg/github/__toolsnaps__`).
100
+
- `script/generate-docs` — refreshes README sections derived from tools.
0 commit comments