Skip to content

Commit 06a028e

Browse files
committed
Allow passing through server options
1 parent 919a10c commit 06a028e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/github/server.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ 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+
opts = append(opts, server.WithResourceCapabilities(true, true))
23+
opts = append(opts, server.WithLogging())
24+
2125
// Create a new MCP server
2226
s := server.NewMCPServer(
2327
"github-mcp-server",
2428
version,
25-
server.WithResourceCapabilities(true, true),
26-
server.WithLogging())
29+
opts...,
30+
)
2731

2832
// Add GitHub Resources
2933
s.AddResourceTemplate(GetRepositoryResourceContent(getClient, t))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy