├── requirements.txt ├── main.py ├── README.md └── LICENSE /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/interiv/mcp-server-wechat/HEAD/requirements.txt -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import mcp.server 2 | import wxauto 3 | from wxauto import WeChat 4 | 5 | wx = WeChat() 6 | 7 | 8 | my_mcp=mcp.server.FastMCP("wechat") 9 | 10 | @my_mcp.tool() 11 | def send_text(text:str,nick_name:str): 12 | '''发送文本信息给指定的昵称的群或者个人''' 13 | wx.SendMsg(text,nick_name) 14 | return "ok" 15 | 16 | @my_mcp.tool() 17 | def send_files(files_path:str|list,nick_name:str): 18 | '''发送文件(包含图片等文件)给指定的群或者个人''' 19 | wx.SendFiles(files_path,nick_name) 20 | return "ok" 21 | 22 | 23 | my_mcp.run() 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mcp-server-wechat 2 | 实现pc端微信的mcp服务功能 3 | 就这么一个文件,自行安装依赖,自行创建虚拟环境. 4 | 5 | vscode+cline 6 | 7 | 大致在 C:\Users\Administrator\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json 增加如下 8 | ``` 9 | { 10 | "mcp-wechat": { 11 | "command": "D:\\PythonCode\\mcp-wechat\\mcp-wechat\\.venv\\Scripts\\python", 12 | "args": [ 13 | "D:\\PythonCode\\mcp-wechat\\mcp-wechat\\main.py" 14 | ], 15 | "disabled": false, 16 | "autoApprove": [ 17 | "wechat" 18 | ] 19 | } 20 | } 21 | ``` 22 | "D:\\PythonCode\\mcp-wechat\\mcp-wechat\\main.py" 换成你文件位置 23 | "D:\\PythonCode\\mcp-wechat\\mcp-wechat\\.venv\\Scripts\\python" 换成你的虚拟环境位置 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 interiv 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------