XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Refactor MCPServer response structure and update FileListTool workspace handling for safe mode

758df772
hlohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +2 -9
Modified g4f/mcp/server.py +1 -8
@@ -143,14 +143,7 @@ class MCPServer:
143 143 return MCPResponse(
144 144 jsonrpc="2.0",
145 145 id=request.id,
146 result={
147 "content": [
148 {
149 "type": "text",
150 "text": json.dumps(result, indent=2)
151 }
152 ]
153 }
146 result=result
154 147 )
155 148
156 149 elif method == "ping":
Modified g4f/mcp/tools.py +1 -1
@@ -760,7 +760,7 @@ class FileListTool(MCPTool):
760 760 continue
761 761
762 762 result: Dict[str, Any] = {
763 "workspace": str(workspace),
763 "workspace": "" if self.safe_mode else str(workspace),
764 764 "path": rel_path or "/",
765 765 "entries": entries,
766 766 "count": len(entries),