Skip to content

Commit 7e19170

Browse files
committed
Allow overriding the options passed to NewServer
1 parent 609e6f6 commit 7e19170

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

internal/ghmcp/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
119119

120120
ghServer := github.NewServer(cfg.Version, &mcp.ServerOptions{
121121
Instructions: instructions,
122+
HasTools: true,
123+
HasResources: true,
124+
HasPrompts: true,
122125
Logger: cfg.Logger,
123126
})
124127

pkg/github/server.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ import (
1515
// NewServer creates a new GitHub MCP server with the specified GH client and logger.
1616

1717
func NewServer(version string, opts *mcp.ServerOptions) *mcp.Server {
18-
// Add default options
19-
opts = &mcp.ServerOptions{
20-
HasTools: true,
21-
HasResources: true,
22-
Logger: opts.Logger,
18+
if opts == nil {
19+
// Add default options
20+
opts = &mcp.ServerOptions{
21+
HasTools: true,
22+
HasResources: true,
23+
HasPrompts: true,
24+
}
2325
}
2426

2527
// Create a new MCP server

0 commit comments

Comments
 (0)