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)
| 151 | // name, display title, and options. If name or title are empty the defaults |
| 152 | // "github-mcp-server" and "GitHub MCP Server" are used. |
| 153 | func 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 | |
| 176 | func 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) { |