Claude Desktop
使用二进制文件设置(推荐)
打开 Claude Desktop 配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
添加 Telegram 服务器(使用二进制文件的完整路径):
json
{
"mcpServers": {
"telegram": {
"command": "/path/to/mcp-telegram",
"env": {
"TELEGRAM_API_ID": "YOUR_ID",
"TELEGRAM_API_HASH": "YOUR_HASH"
}
}
}
}json
{
"mcpServers": {
"telegram": {
"command": "C:\\path\\to\\mcp-telegram-windows-x64.exe",
"env": {
"TELEGRAM_API_ID": "YOUR_ID",
"TELEGRAM_API_HASH": "YOUR_HASH"
}
}
}
}重启 Claude Desktop。
在 MCP 工具列表中可以看到 "telegram"。
登录
直接通过 Claude Desktop 登录:
- 让 Claude:"执行 telegram-login"
- 如果图片不可见,它保存在
~/.mcp-telegram/qr-login.png - 在 Telegram 中扫描
- "执行 telegram-status" 验证
使用 npx(替代方案)
如果已安装 Node.js 18+:
json
{
"mcpServers": {
"telegram": {
"command": "npx",
"args": ["@overpod/mcp-telegram"],
"env": {
"TELEGRAM_API_ID": "YOUR_ID",
"TELEGRAM_API_HASH": "YOUR_HASH"
}
}
}
}试试看
- "我 Telegram 有什么未读消息?"
- "在聊天中搜索关于会议的消息"
- "发送'你好'给 @username"