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

Method AddTool

api/controller/mcp_server.go:75–81  ·  view source on GitHub ↗

AddTool registers a raw MCP tool with the shared server.

(tool *mcp.Tool, handler mcp.ToolHandler)

Source from the content-addressed store, hash-verified

73
74// AddTool registers a raw MCP tool with the shared server.
75func (s *MCPServer) AddTool(tool *mcp.Tool, handler mcp.ToolHandler) {
76 if s == nil || s.server == nil {
77 logger.SysError("MCP server is not initialized")
78 return
79 }
80 s.server.AddTool(tool, handler)
81}
82
83// CurrentMCPUserID extracts the authenticated user ID from the MCP request context.
84func CurrentMCPUserID(ctx context.Context) (int64, error) {

Callers 1

AddTypedMCPToolFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected