Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c18a34

Browse files
omgitsadsCopilot
andauthored
Allow passing through server options (#218)
* Allow passing through server optionsCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent919a10c commit3c18a34

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
typeGetClientFnfunc(context.Context) (*github.Client,error)
1818

1919
// NewServer creates a new GitHub MCP server with the specified GH client and logger.
20-
funcNewServer(getClientGetClientFn,versionstring,readOnlybool,t translations.TranslationHelperFunc)*server.MCPServer {
20+
funcNewServer(getClientGetClientFn,versionstring,readOnlybool,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)

[8]ページ先頭

©2009-2025 Movatter.jp