If you have great ideas,
Let's talk!

blog

mcp 记录(1)

llm相关

这段时间测试了很多mcp相关的 接下来会继续在这方面更多的去了解 目标是搭建10个属于自己的server(或workflow)

有几个想说的

WSL 转换

首先一般我们用claude 桌面版接mcp 我个人感觉wsl上的支持会更好 所以我在逐渐养成把server部署在wsl上的习惯

(举个例子 https://github.com/MarkusPfundstein/mcp-gsuite 用win 一直有权限或者json问题 用wsl完全没问题)

注意要把server下在wsl中 并且将config改一下

"mcp-gsuite": {
      "command": "uv",
      "args": [
        "--directory",
        "<dir_to>/mcp-gsuite",
        "run",
        "mcp-gsuite"
      ]
    }

到(后面的path 写wsl的path就行)

"mcp-gsuite": {
	"command": "C:\\Windows\\System32\\wsl.exe", (--> where wsl, wsl.exe 在path上也可以直接用)
	"args": [
		"--",
		"path/to/uv(on wsl)",
		"--directory",
		"path/to/mcp-gsuite server(on wsl)",
		"run",
		"mcp-gsuite"
		]
}

ok 顺便介绍一下 这个mcp 可以实现对日历的添加和删除 也可以理解批量的命令 比如制定一个一周计划 可以先划分一个一个event然后全部添加日程/全部取消

这里的一个缺陷 是时区的implement不够周到 我认为应该在创建事件前最先get primary calendar的时区 然后再去计算时间 不过整体功能已经很强大了

邮箱现在可以 读取 + 创建draft (我想自己加上发邮件的功能) 详细如下

  • Get your Gmail user information
  • Query emails with flexible search (e.g., unread, from specific senders, date ranges, with attachments)
  • Retrieve complete email content by ID
  • Create new draft emails with recipients, subject, body and CC options
  • Delete draft emails
  • Reply to existing emails (can either send immediately or save as draft)
  • Retrieve multiple emails at once by their IDs.
  • Save multiple attachments from emails to your local system.

此外一般用来检查mcp的是MCP Inspector

通过 npx @modelcontextprotocol/inspector node build/index.js (后面接的是启动服务器的命令) 我也希望以后都用wsl做

比如 之前的mcp

npx @modelcontextprotocol/inspector uv --directory C:\Users\path-to\mcp-gsuite run mcp-gsuite

在wsl中 我们可以替换成

npx @modelcontextprotocol/inspector uv --directory ~/path-in-wsl-to/mcp-gsuite run mcp-gsuite

但是wsl 上 inspector 的client 这里默认是在 127.0.0.1:6274

ss -tlnp 后发现是在 *:6274 上跑 并没有绑定到 0.0.0.0:: 上 也就是你在win上是找不到的

我们需要在admin powershell下 通过

netsh interface portproxy add v4tov4 listenport=6274 listenaddress=0.0.0.0 connectport=6274 connectaddress=$(wsl hostname -I

绑定两个端口 然后 浏览器 localhost:6274 就可以

和 claude desktop 相关的还有一个问题呀 我不知道别人有没有遇到 就是重启客户端不会重新加载 mcp.config 我现在每次都通过claude 安装包重新安装 就一定可以成功(重启电脑也行)

brave mcp docker 可能问题

docker: error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect

解决方法:

https://forums.docker.com/t/error-when-trying-to-run-windows-containers-docker-client-must-be-run-with-elevated-privileges/136619/4