8000 Allow passing through server options (#218) · github/github-mcp-server@3c18a34 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c18a34

Browse files
omgitsadsCopilot
andauthored
Allow passing through server options (#218)
* Allow passing through server options Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 919a10c commit 3c18a34

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/github/server.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ import (
1717
type GetClientFn func(context.Context) (*github.Client, error)
1818

1919
// NewServer creates a new GitHub MCP server with the specified GH client and logger.
20-
func NewServer(getClient GetClientFn, version string, readOnly bool, t translations.TranslationHelperFunc) *server.MCPServer {
20+
func NewServer(getClient GetClientFn, version string, readOnly bool, t translations.TranslationHelperFunc, opts ...server.ServerOption) *server.MCPServer {
21+
// Add default options
22+
defaultOpts := []server.ServerOption{
23+
server.WithResourceCapabilities(true, true),
24+
server.WithLogging(),
25+
}
26+
opts = append(defaultOpts, opts...)
27+
2128
// Create a new MCP server
2229
s := server.NewMCPServer(
2330
"github-mcp-server",
2431
version,
25-
server.WithResourceCapabilities(true, true),
26-
server.WithLogging())
32+
opts...,
33+
)
2734

2835
// Add GitHub Resources
2936
s.AddResourceTemplate(GetRepositoryResourceContent(getClient, t))

0 commit comments

Comments
 (0)
0