Content-Length: 2513 | pFad | http://github.com/github/github-mcp-server/pull/218.patch
thub.com
From 06a028e32d8b84b7a530d853a6933894d25dc563 Mon Sep 17 00:00:00 2001
From: Adam Holt
Date: Fri, 11 Apr 2025 10:43:24 +0200
Subject: [PATCH 1/2] Allow passing through server options
---
pkg/github/server.go | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/pkg/github/server.go b/pkg/github/server.go
index 2d252b29d..7f92f0b39 100644
--- a/pkg/github/server.go
+++ b/pkg/github/server.go
@@ -17,13 +17,17 @@ import (
type GetClientFn func(context.Context) (*github.Client, error)
// NewServer creates a new GitHub MCP server with the specified GH client and logger.
-func NewServer(getClient GetClientFn, version string, readOnly bool, t translations.TranslationHelperFunc) *server.MCPServer {
+func NewServer(getClient GetClientFn, version string, readOnly bool, t translations.TranslationHelperFunc, opts ...server.ServerOption) *server.MCPServer {
+ // Add default options
+ opts = append(opts, server.WithResourceCapabilities(true, true))
+ opts = append(opts, server.WithLogging())
+
// Create a new MCP server
s := server.NewMCPServer(
"github-mcp-server",
version,
- server.WithResourceCapabilities(true, true),
- server.WithLogging())
+ opts...,
+ )
// Add GitHub Resources
s.AddResourceTemplate(GetRepositoryResourceContent(getClient, t))
From 42e63b3e2c631ee2c9d71ff0983c5985a95b6d60 Mon Sep 17 00:00:00 2001
From: Adam Holt
Date: Fri, 11 Apr 2025 10:48:30 +0200
Subject: [PATCH 2/2] Update pkg/github/server.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---
pkg/github/server.go | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pkg/github/server.go b/pkg/github/server.go
index 7f92f0b39..490a81051 100644
--- a/pkg/github/server.go
+++ b/pkg/github/server.go
@@ -19,8 +19,11 @@ type GetClientFn func(context.Context) (*github.Client, error)
// NewServer creates a new GitHub MCP server with the specified GH client and logger.
func NewServer(getClient GetClientFn, version string, readOnly bool, t translations.TranslationHelperFunc, opts ...server.ServerOption) *server.MCPServer {
// Add default options
- opts = append(opts, server.WithResourceCapabilities(true, true))
- opts = append(opts, server.WithLogging())
+ defaultOpts := []server.ServerOption{
+ server.WithResourceCapabilities(true, true),
+ server.WithLogging(),
+ }
+ opts = append(defaultOpts, opts...)
// Create a new MCP server
s := server.NewMCPServer(
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/github/github-mcp-server/pull/218.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy