mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
增加网站浏览mcp
This commit is contained in:
@@ -208,6 +208,9 @@ class ConnectionHandler:
|
||||
self.prompt = self.prompt + f"\nuser location:{self.client_ip_info}"
|
||||
self.dialogue.update_system_message(self.prompt)
|
||||
|
||||
"""加载MCP工具"""
|
||||
asyncio.run_coroutine_threadsafe(self.mcp_manager.initialize_servers(), self.loop)
|
||||
|
||||
def change_system_prompt(self, prompt):
|
||||
self.prompt = prompt
|
||||
# 找到原来的role==system,替换原来的系统提示
|
||||
|
||||
@@ -62,6 +62,7 @@ class MCPManager:
|
||||
|
||||
except Exception as e:
|
||||
self.logger.bind(tag=TAG).error(f"Failed to initialize MCP server {name}: {e}")
|
||||
self.conn.func_handler.upload_functions_desc()
|
||||
|
||||
def get_all_tools(self) -> List[Dict[str, Any]]:
|
||||
"""获取所有服务的工具function定义
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
{
|
||||
"des": [
|
||||
"在data目录下创建.mcp_server_settings.json文件,可以选择下面的MCP服务,也可以自行添加新的MCP服务。",
|
||||
"后面不断测试补充好用的mcp服务,欢迎大家一起补充。",
|
||||
"记得删除注释行,des属性仅为说明,不会被解析。",
|
||||
"des和link属性,仅为说明安装方式,方便大家查看原始链接,不是必须项。"
|
||||
],
|
||||
"mcpServers": {
|
||||
"filesystem": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"-y",
|
||||
"@modelcontextprotocol/server-filesystem",
|
||||
"/Users/username/Desktop",
|
||||
"/path/to/other/allowed/dir"
|
||||
]
|
||||
],
|
||||
"link":"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
|
||||
},
|
||||
"puppeteer": {
|
||||
"playwright": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
|
||||
"args": ["-y", "@executeautomation/playwright-mcp-server"],
|
||||
"des" : "run 'npx playwright install' first",
|
||||
"link": "https://github.com/executeautomation/mcp-playwright"
|
||||
},
|
||||
"windows-cli": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@simonb97/server-win-cli"]
|
||||
"args": ["-y", "@simonb97/server-win-cli"],
|
||||
"link": "https://github.com/SimonB97/win-cli-mcp-server"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user