MCPcopy Create free account
hub / github.com/53AI/53AIHub / newMCPServer

Function newMCPServer

api/controller/mcp_server.go:36–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func newMCPServer() *MCPServer {
37 server := mcp.NewServer(&mcp.Implementation{
38 Name: "53AIHub MCP",
39 Version: config.Version,
40 }, nil)
41
42 handler := mcp.NewStreamableHTTPHandler(func(*http.Request) *mcp.Server {
43 return server
44 }, &mcp.StreamableHTTPOptions{
45 Stateless: true,
46 JSONResponse: true,
47 DisableLocalhostProtection: true,
48 })
49
50 mcpServer := &MCPServer{
51 server: server,
52 handler: handler,
53 }
54 registerMCPTools(mcpServer)
55 return mcpServer
56}
57
58// Server exposes the underlying MCP server for tool registration.
59func (s *MCPServer) Server() *mcp.Server {

Callers 1

GetMCPServerFunction · 0.85

Calls 1

registerMCPToolsFunction · 0.85

Tested by

no test coverage detected