Add all in one mcp (#1978)

This commit is contained in:
澄潭
2025-03-30 00:25:21 +08:00
committed by GitHub
parent 037c71a320
commit 492c5d350a
14 changed files with 318 additions and 75 deletions

View File

@@ -17,26 +17,13 @@ package main
import (
"amap-tools/tools"
"github.com/alibaba/higress/plugins/wasm-go/pkg/mcp/server"
"github.com/alibaba/higress/plugins/wasm-go/pkg/mcp"
)
func main() {}
func init() {
amapServer := &server.MCPServer{}
server.Load(server.AddMCPServer(
"amap-tools",
amapServer.AddMCPTool("maps_geo", &tools.GeoRequest{}).
AddMCPTool("maps_bicycling", &tools.BicyclingRequest{}).
AddMCPTool("maps_direction_transit_integrated", &tools.TransitIntegratedRequest{}).
AddMCPTool("maps_ip_location", &tools.IPLocationRequest{}).
AddMCPTool("maps_weather", &tools.WeatherRequest{}).
AddMCPTool("maps_direction_driving", &tools.DrivingRequest{}).
AddMCPTool("maps_around_search", &tools.AroundSearchRequest{}).
AddMCPTool("maps_search_detail", &tools.SearchDetailRequest{}).
AddMCPTool("maps_regeocode", &tools.ReGeocodeRequest{}).
AddMCPTool("maps_text_search", &tools.TextSearchRequest{}).
AddMCPTool("maps_distance", &tools.DistanceRequest{}).
AddMCPTool("maps_direction_walking", &tools.WalkingRequest{}),
))
mcp.LoadMCPServer(mcp.AddMCPServer("amap-tools",
tools.LoadTools(&mcp.MCPServer{})))
mcp.InitMCPServer()
}