MCPcopy Index your code
hub / github.com/github/github-mcp-server / NewServer

Function NewServer

pkg/github/server.go:153–174  ·  view source on GitHub ↗

NewServer creates a new GitHub MCP server with the given version, server name, display title, and options. If name or title are empty the defaults "github-mcp-server" and "GitHub MCP Server" are used.

(version, name, title string, opts *mcp.ServerOptions)

Source from the content-addressed store, hash-verified

151// name, display title, and options. If name or title are empty the defaults
152// "github-mcp-server" and "GitHub MCP Server" are used.
153func NewServer(version, name, title string, opts *mcp.ServerOptions) *mcp.Server {
154 if opts == nil {
155 opts = &mcp.ServerOptions{}
156 }
157
158 if name == "" {
159 name = "github-mcp-server"
160 }
161 if title == "" {
162 title = "GitHub MCP Server"
163 }
164
165 // Create a new MCP server
166 s := mcp.NewServer(&mcp.Implementation{
167 Name: name,
168 Title: title,
169 Version: version,
170 Icons: octicons.Icons("mark-github"),
171 }, opts)
172
173 return s
174}
175
176func CompletionsHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {
177 return func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {

Callers 2

NewMCPServerFunction · 0.85

Calls 1

IconsFunction · 0.92

Tested by 1