Skip to content

Commit b11db64

Browse files
add context toolset and adjust readme
1 parent cbcf29f commit b11db64

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,14 @@ The following sets of tools are available (all are on by default):
147147

148148
| Toolset | Description |
149149
| ----------------------- | ------------------------------------------------------------- |
150-
| `repos` | Repository-related tools (file operations, branches, commits) |
150+
| `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |
151+
| `code_security` | Code scanning alerts and security features |
151152
| `issues` | Issue-related tools (create, read, update, comment) |
152-
| `users` | Anything relating to GitHub Users |
153+
| `notifications` | GitHub Notifications related tools |
153154
| `pull_requests` | Pull request operations (create, merge, review) |
154-
| `code_security` | Code scanning alerts and security features |
155+
| `repos` | Repository-related tools (file operations, branches, commits) |
156+
| `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning |
157+
| `users` | Anything relating to GitHub Users |
155158
| `experiments` | Experimental features (not considered stable) |
156159

157160
#### Specifying Toolsets

internal/ghmcp/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,10 @@ func NewMCPServer(cfg MCPServerConfig) (*server.MCPServer, error) {
120120
return nil, fmt.Errorf("failed to enable toolsets: %w", err)
121121
}
122122

123-
context := github.InitContextToolset(getClient, cfg.Translator)
124123
github.RegisterResources(ghServer, getClient, cfg.Translator)
125124

126125
// Register the tools with the server
127126
tsg.RegisterTools(ghServer)
128-
context.RegisterTools(ghServer)
129127

130128
if cfg.DynamicToolsets {
131129
dynamic := github.InitDynamicToolset(ghServer, tsg, cfg.Translator)

pkg/github/search.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ func SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (t
209209
}
210210

211211
client, err := getClient(ctx)
212+
212213
if err != nil {
213214
return nil, fmt.Errorf("failed to get GitHub client: %w", err)
214215
}

pkg/github/tools.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
106106
// Keep experiments alive so the system doesn't error out when it's always enabled
107107
experiments := toolsets.NewToolset("experiments", "Experimental features that are not considered stable yet")
108108

109+
contextTools := toolsets.NewToolset("context", "Tools that provide context about the current user and GitHub context you are operating in").
110+
AddReadTools(
111+
toolsets.NewServerTool(GetMe(getClient, t)),
112+
)
113+
109114
// Add toolsets to the group
115+
tsg.AddToolset(contextTools)
110116
tsg.AddToolset(repos)
111117
tsg.AddToolset(issues)
112118
tsg.AddToolset(users)
@@ -119,16 +125,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
119125
return tsg
120126
}
121127

122-
func InitContextToolset(getClient GetClientFn, t translations.TranslationHelperFunc) *toolsets.Toolset {
123-
// Create a new context toolset
124-
contextTools := toolsets.NewToolset("context", "Tools that provide context about the current user and GitHub context you are operating in").
125-
AddReadTools(
126-
toolsets.NewServerTool(GetMe(getClient, t)),
127-
)
128-
contextTools.Enabled = true
129-
return contextTools
130-
}
131-
132128
// InitDynamicToolset creates a dynamic toolset that can be used to enable other toolsets, and so requires the server and toolset group as arguments
133129
func InitDynamicToolset(s *server.MCPServer, tsg *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) *toolsets.Toolset {
134130
// Create a new dynamic toolset

0 commit comments

Comments
 (0)