开启Stdio

运行mcp server,模式stdio,允许访问目录:C:/Users/zhang

PS C:\Users\zhang\mcp-servers\src\filesystem> npx @modelcontextprotocol/server-filesystem C:/Users/zhang
Secure MCP Filesystem Server running on stdio
Allowed directories: [ 'C:\\Users\\zhang' ]

部署mcp-proxy

部署mcp代理,将stdio转换为sse,适配Agent

监听端口 8080

PS C:\Users\zhang> mcp-proxy --sse-port 8080 --sse-host 0.0.0.0 cmd /c npx @modelcontextprotocol/server-filesystem C:\Users\zhang\                                                                                                              
DEBUG:root:Starting stdio client and SSE server                                                                         
DEBUG:asyncio:Using proactor: IocpProactor                                                                              
DEBUG:mcp.server.lowlevel.server:Initializing server 'secure-filesystem-server'                                         
DEBUG:mcp.server.sse:SseServerTransport initialized with endpoint: /messages/                                           
INFO:     Started server process [29296]                                                                                
INFO:     Waiting for application startup.                                                                              
INFO:     Application startup complete.                                                                                 
INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)                                                 
   

Logo

中国智能体开发者社区,聚焦智能体与大模型开发,提供前沿资讯、实用工具链、开源项目及行业案例。通过技术沙龙、开发者大赛等活动,促进经验交流与协作,助力开发者快速构建创新智能应用。

更多推荐