using System.Collections.Generic; using LinkToolAddin.host.mcp; namespace LinkToolAddin.host; public class McpServerList { private Dictionary servers = new Dictionary(); public McpServerList() { servers.Add("gaode",new SseMcpServer { Name = "gaode", Type = "sse", Description = "高德地图API", IsActive = true, BaseUrl = "https://mcp.amap.com/sse?key=ed418512c94ade8f83d42c37b77d2bb2", Headers = new Dictionary() { {"Content-Type","application/json"} } }); servers.Add("ArcGisPro", new InnerMcpServer { Name = "ArcGisPro", Type = "inner", Description = "可以调用arcgis的地理处理工具或执行python代码等", IsActive = true }); //servers.Add("KnowledgeBase", new InnerMcpServer //{ // Name = "KnowledgeBase", // Type = "inner", // Description = "可以调用进行查询知识库,获取相关参考信息。", // IsActive = true //}); //servers.Add("filesystem", new StdioMcpServer() //{ // Name = "filesystem", // Type = "stdio", // Command = "npx", // Args = new List() // { // "-y", // "@modelcontextprotocol/server-filesystem", // "D:\\01_Project\\20250305_LinkTool\\20250420_AiDemoProject\\TestData" // } //}); //servers.Add("fetch", new StdioMcpServer() //{ // Name = "fetch", // Type = "stdio", // Command = "uvx", // Args = new List() // { // "mcp-server-fetch" // } //}); //servers.Add("bing-search", new StdioMcpServer() //{ // Name = "bing-search", // Type = "stdio", // Command = "npx", // Args = new List() // { // "bing-cn-mcp" // } //}); //servers.Add("mcp-python-interpreter", new StdioMcpServer() //{ // Name = "mcp-python-interpreter", // Type = "stdio", // Command = "uvx", // Args = new List() // { // "--native-tls", // "mcp-python-interpreter", // "--dir", // "D:\\01_Project\\20250305_LinkTool\\20250420_AiDemoProject\\TestData", // "--python-path", // "C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\custom\\python.exe" // } //}); } public McpServer GetServer(string name) { if (servers.ContainsKey(name)) { return servers[name]; } else { return null; } } public List GetAllServers() { List serverList = new List(); foreach (var server in servers) { serverList.Add(server.Value); } return serverList; } }