Content-Length: 290967 | pFad | http://github.com/github/github-mcp-server/commit/3c18a342c9bc5c503552caf669d5ef7b31f67f8c

08 Allow passing through server options (#218) · github/github-mcp-server@3c18a34 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/github-mcp-server/commit/3c18a342c9bc5c503552caf669d5ef7b31f67f8c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy