Skip to content

Commit abffbf5

Browse files
committed
Add option to provide additional MCP server options via config
1 parent 740fbff commit abffbf5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/github/server.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ type MCPServerConfig struct {
6363
// When non-nil, tools requiring scopes not in this list will be hidden.
6464
// This is used for PAT scope filtering where we can't issue scope challenges.
6565
TokenScopes []string
66+
67+
// Additional server options to apply
68+
ServerOptions []MCPServerOption
6669
}
6770

71+
type MCPServerOption func(*mcp.ServerOptions)
72+
6873
func NewMCPServer(cfg *MCPServerConfig, deps ToolDependencies, inventory *inventory.Inventory) (*mcp.Server, error) {
6974
enabledToolsets := resolveEnabledToolsets(cfg)
7075

@@ -82,6 +87,11 @@ func NewMCPServer(cfg *MCPServerConfig, deps ToolDependencies, inventory *invent
8287
CompletionHandler: CompletionsHandler(deps.GetClient),
8388
}
8489

90+
// Apply any additional server options
91+
for _, o := range cfg.ServerOptions {
92+
o(serverOpts)
93+
}
94+
8595
// In dynamic mode, explicitly advertise capabilities since tools/resources/prompts
8696
// may be enabled at runtime even if none are registered initially.
8797
if cfg.DynamicToolsets {

0 commit comments

Comments
 (0)