🚀 Intercom MCP 服務器
Intercom MCP 服務器用於幫助中心內容管理和客戶支持(CS)工作流自動化。它可以高效地管理幫助中心的文章和集合,同時實現 CS 工作流的自動化操作。
🚀 快速開始
Intercom MCP 服務器助力幫助中心內容管理與 CS 工作流自動化。以下是快速上手步驟:
- 克隆倉庫:
git clone https://github.com/kaosensei/intercom-mcp.git
cd intercom-mcp
- 安裝依賴:
npm install
- 構建項目:
npm run build
✨ 主要特性
文章管理
- ✅
get_article - 通過 ID 獲取單篇文章
- ✅
list_articles - 分頁列出文章
- ✅
search_articles - 通過關鍵詞搜索文章,支持高亮顯示
- ✅
create_article - 創建包含多語言內容的新文章
- ✅
update_article - 部分更新現有文章
集合管理
- ✅
list_collections - 列出所有幫助中心集合
- ✅
get_collection - 通過 ID 獲取單個集合
- ✅
update_collection - 更新集合信息和翻譯內容
- ✅
delete_collection - 永久刪除集合
CS 工作流
- ✅
reply_conversation - 以管理員身份回覆對話
- ✅
add_conversation_note - 為對話添加內部備註
- ✅
close_conversation - 關閉對話
- ✅
update_ticket - 更新工單的狀態或屬性
📦 安裝指南
克隆倉庫
git clone https://github.com/kaosensei/intercom-mcp.git
cd intercom-mcp
安裝依賴
npm install
構建項目
npm run build
📚 詳細文檔
配置
獲取 Intercom 訪問令牌
- 前往 Intercom 設置 → 開發者 → 開發者中心。
- 創建新應用或使用現有應用。
- 獲取具有 文章 和 對話 讀寫權限的訪問令牌。
環境變量
| 變量 |
是否必需 |
描述 |
INTERCOM_ACCESS_TOKEN |
✅ 始終需要 |
你的 Intercom API 訪問令牌 |
INTERCOM_ADMIN_ID |
✅ 用於 CS 工具 |
當未提供 admin_id 參數時,reply_conversation 和 add_conversation_note 使用的管理員 ID |
使用 Claude Code 進行配置(推薦)
如果你使用 Claude Code CLI,可以輕鬆添加 MCP 服務器:
claude mcp add --transport stdio intercom-mcp \
--env INTERCOM_ACCESS_TOKEN=<your_token> \
--env INTERCOM_ADMIN_ID=<your_admin_id> \
-- node /ABSOLUTE/PATH/TO/intercom-mcp/dist/index.js
替換:
<your_token> 為你的 Intercom 訪問令牌
/ABSOLUTE/PATH/TO/ 為你的實際項目路徑
驗證配置:
claude mcp list
手動配置 Claude 桌面版
編輯 Claude 桌面版配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"intercom-mcp": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/intercom-mcp/dist/index.js"
],
"env": {
"INTERCOM_ACCESS_TOKEN": "your_intercom_access_token_here",
"INTERCOM_ADMIN_ID": "your_admin_id_here"
}
}
}
}
重要提示:
- 將
/ABSOLUTE/PATH/TO/intercom-mcp 替換為你的實際項目路徑
- 將
your_intercom_access_token_here 替換為你的實際令牌
- 將
your_admin_id_here 替換為你的 Intercom 管理員 ID(CS 工具需要)
重啟 Claude 桌面版
完全退出 Claude 桌面版並重新啟動。
使用方法
配置完成後,你可以在 Claude 桌面版中使用以下命令:
列出文章
List Intercom articles
或
Show me the first 20 Intercom articles
獲取文章詳情
Get Intercom article with ID 9876543
搜索文章
Search for Intercom articles about "subscription"
或
Search published articles containing "播客" with highlighted matches
或
Find articles with keyword "訂閱" in Chinese
創建文章
Create a new Intercom article titled "Getting Started Guide" with content "Welcome to our platform" by author ID 123456, save as draft
更新文章
Update article 9876543 and change its state to published
列出集合
List all Intercom Help Center collections
獲取集合
Get collection with ID 14608214
更新集合
Update collection 14608214 and add Japanese translation
刪除集合
Delete collection 16036040
用例:翻譯管理
v0.4.0 的一個關鍵特性是能夠高效管理多語言集合。
添加缺失的翻譯
你可以輕鬆為缺少某些語言的集合添加翻譯:
Update collection 14608214 and add the missing Japanese translation: name "アカウント管理", description "アカウント設定を管理する"
批量翻譯更新
檢查哪些集合缺少翻譯:
List all collections and show me which ones are missing Japanese translations
然後逐個更新或制定更新多個集合的計劃。
驗證翻譯
更新後,驗證更改:
Get collection 14608214 and show me all available translations
工具參考
get_article
通過 ID 獲取單篇文章。
參數:
示例:
{
"id": "9876543"
}
list_articles
分頁列出文章。
參數:
page(數字,可選):頁碼(默認:1)
per_page(數字,可選):每頁文章數(默認:10,最大:50)
示例:
{
"page": 1,
"per_page": 20
}
search_articles
使用關鍵詞搜索文章。支持跨文章內容的全文搜索,具備多語言支持(英語、中文、日語等)。
參數:
phrase(字符串,必需):在文章中查找的搜索關鍵詞/短語
state(字符串,可選):按文章狀態過濾 - "published"、"draft" 或 "all"(默認:"all")
help_center_id(字符串,可選):按特定幫助中心 ID 過濾
highlight(布爾值,可選):返回高亮顯示的匹配內容片段(默認:false)
示例(簡單搜索):
{
"phrase": "subscription"
}
示例(帶過濾條件的搜索):
{
"phrase": "播客",
"state": "published",
"highlight": true
}
示例(中文關鍵詞搜索):
{
"phrase": "訂閱制",
"state": "all",
"highlight": true
}
響應包含:
total_count:匹配文章的總數
data.articles:包含完整內容的匹配文章數組
pages:包含下一頁 URL 的分頁信息
- 高亮顯示的內容片段(當
highlight: true 時)
用例:
- 查找關於特定主題的所有文章
- 在多語言幫助中心搜索中文/日語內容
- 定位需要更新的文章
- 發現用於交叉鏈接的相關內容
create_article
創建支持多語言的新文章。
參數:
title(字符串,必需):文章標題
body(字符串,必需):HTML 格式的文章內容
author_id(數字,必需):作者 ID(必須是有效的 Intercom 團隊成員)
description(字符串,可選):文章描述
state(字符串,可選):"draft" 或 "published"(默認:"draft")
parent_id(字符串,可選):集合或部分 ID
parent_type(字符串,可選):"collection"(默認)
translated_content(對象,可選):多語言內容
示例(簡單):
{
"title": "Getting Started Guide",
"body": "<p>Welcome to our platform</p>",
"author_id": 123456,
"state": "draft"
}
示例(多語言):
{
"title": "Getting Started Guide",
"body": "<p>Welcome to our platform</p>",
"author_id": 123456,
"state": "published",
"translated_content": {
"zh-TW": {
"title": "入門指南",
"body": "<p>歡迎使用我們的平臺</p>",
"author_id": 123456,
"state": "published"
},
"ja": {
"title": "スタートガイド",
"body": "<p>プラットフォームへようこそ</p>",
"author_id": 123456,
"state": "published"
}
}
}
update_article
更新現有文章。僅更新提供的字段。
參數:
id(字符串,必需):文章 ID
title(字符串,可選):更新後的標題
body(字符串,可選):更新後的內容
description(字符串,可選):更新後的描述
state(字符串,可選):"draft" 或 "published"
author_id(數字,可選):更新後的作者 ID
translated_content(對象,可選):更新後的翻譯內容
示例(更改狀態):
{
"id": "9876543",
"state": "published"
}
示例(更新內容):
{
"id": "9876543",
"title": "Updated Title",
"body": "<p>Updated content</p>"
}
示例(添加翻譯):
{
"id": "9876543",
"translated_content": {
"zh-TW": {
"title": "更新的標題",
"body": "<p>更新的內容</p>"
}
}
}
list_collections
列出所有幫助中心集合(頂級類別)。
參數:
page(數字,可選):頁碼(默認:1)
per_page(數字,可選):每頁集合數(默認:50,最大:150)
示例:
{
"page": 1,
"per_page": 50
}
get_collection
通過 ID 獲取單個集合。
參數:
示例:
{
"id": "14608214"
}
update_collection
更新現有集合。僅更新提供的字段。非常適合添加缺失的翻譯!
參數:
id(字符串,必需):集合 ID
name(字符串,可選):更新後的集合名稱(更新默認語言)
description(字符串,可選):更新後的描述(更新默認語言)
parent_id(字符串,可選):父集合 ID(頂級為 null)
translated_content(對象,可選):更新後的翻譯內容
示例(更新名稱和描述):
{
"id": "14608214",
"name": "Account Management",
"description": "Manage your account settings"
}
示例(添加缺失的日語翻譯):
{
"id": "14608214",
"translated_content": {
"ja": {
"name": "アカウント管理",
"description": "アカウント設定を管理"
}
}
}
示例(更新多種語言翻譯):
{
"id": "14608214",
"translated_content": {
"ja": {
"name": "アカウント管理",
"description": "アカウント設定を管理する"
},
"id": {
"name": "Manajemen Akun",
"description": "Kelola pengaturan akun Anda"
}
}
}
delete_collection
永久刪除集合。警告:此操作無法撤銷!
參數:
示例:
{
"id": "16036040"
}
⚠️ 重要提示:
- 已刪除的集合無法恢復
- 集合內的所有內容可能會受到影響
- 刪除前務必備份重要數據
開發
構建
npm run build
監聽模式
npm run watch
故障排除
Claude 桌面版未顯示工具
- 檢查配置文件路徑是否正確
- 驗證 JSON 格式(無尾隨逗號)
- 完全重啟 Claude 桌面版
- 檢查
dist/index.js 的絕對路徑
API 錯誤
- 驗證你的訪問令牌是否正確
- 確保令牌具有文章讀取權限
- 檢查 Intercom API 狀態
構建錯誤
- 確保 TypeScript 版本 >= 5.0
- 刪除
node_modules 和 dist,然後執行:
npm install && npm run build
項目結構
intercom-mcp/
├── package.json # 項目配置
├── tsconfig.json # TypeScript 配置
├── src/
│ └── index.ts # 主服務器代碼
├── dist/ # 編譯輸出
└── README.md # 本文件
路線圖
已完成
- ✅ 獲取文章(v0.1.0)
- ✅ 列出文章(v0.1.0)
- ✅ 創建文章(v0.2.0)
- ✅ 更新文章(v0.2.0)
- ✅ 文章多語言支持(v0.2.0)
- ✅ 列出集合(v0.3.1)
- ✅ 獲取集合(v0.3.1)
- ✅ 更新集合(v0.4.0)
- ✅ 刪除集合(v0.4.0)
- ✅ 集合多語言支持(v0.4.0)
- ✅ 關鍵詞匹配和高亮搜索文章(v0.5.0)
- ✅ 回覆對話(v0.6.0)
- ✅ 為對話添加內部備註(v0.6.0)
- ✅ 關閉對話(v0.6.0)
- ✅ 更新工單狀態和屬性(v0.6.0)
計劃中
- 🔜 刪除文章
- 🔜 批量操作
- 🔜 更好的錯誤處理
- 🔜 模塊化文件結構
資源
📄 許可證
本項目採用 MIT 許可證。