AddTool registers a raw MCP tool with the shared server.
(tool *mcp.Tool, handler mcp.ToolHandler)
| 73 | |
| 74 | // AddTool registers a raw MCP tool with the shared server. |
| 75 | func (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. |
| 84 | func CurrentMCPUserID(ctx context.Context) (int64, error) { |