使用说明
@tellagen/mcp服务器
Tellagen的MCP服务器——调查人工智能代理的事件。
适用于任何兼容MCP的客户端:Claude Code、Cursor、VS Code Copilot、Windsurf。
快速开始
1.创建API密钥
在Tellagen,前往 设置>API密钥 并使用两者创建密钥 incidents:read 和 incidents:write 范围。
重要提示:
incidents:write并不意味着incidents:read。你需要这两个范围才能进行全面的调查。
2.添加到MCP客户端配置
克劳德代码 (~/.claude.json 或项目 .mcp.json):
{
"mcpServers": {
"tellagen": {
"command": "npx",
"args": ["-y", "@tellagen/mcp-server"],
"env": {
"TELLAGEN_API_KEY": "tllg_...",
"TELLAGEN_API_URL": "https://yourcompany.api.tellagen.com"
}
}
}
}
光标 (.cursor/mcp.json):
{
"mcpServers": {
"tellagen": {
"command": "npx",
"args": ["-y", "@tellagen/mcp-server"],
"env": {
"TELLAGEN_API_KEY": "tllg_...",
"TELLAGEN_API_URL": "https://yourcompany.api.tellagen.com"
}
}
}
}
3.调查
问你的AI代理: “调查Tellagen 42号事件”
工具
阅读工具
| 工具 | 说明 |
|---|---|
tellagen_get_incident |
获取事件详细信息(严重性、状态、服务、时间戳) |
tellagen_list_incidents |
列出所有事件,可选择按状态筛选 |
tellagen_get_incident_timeline |
获取事件的事件时间表 |
tellagen_list_investigation_runs |
列出事故调查运行情况 |
tellagen_list_findings |
列出事件的调查结果,可选择按运行进行筛选 |
tellagen_get_finding |
获取一个包含完整细节的单一发现 |
编写工具
| 工具 | 说明 |
|---|---|
tellagen_start_investigation |
对事件展开新的调查 |
tellagen_post_finding |
将结构化调查结果发布到积极调查中 |
tellagen_complete_investigation |
将调查标记为已完成或失败 |
tellagen_update_finding |
更新发现的状态(取消或恢复) |
tellagen_promote_finding |
将调查结果纳入事件时间表 |
与其他MCP服务器组合
Tellagen MCP服务器旨在与供应商的MCP服务器协同工作,以实现可观察性和源代码控制。安装与您的堆栈匹配的任何一个:
{
"mcpServers": {
"tellagen": {
"command": "npx",
"args": ["-y", "@tellagen/mcp-server"],
"env": {
"TELLAGEN_API_KEY": "tllg_...",
"TELLAGEN_API_URL": "https://yourcompany.api.tellagen.com"
}
},
"grafana": {
"command": "uvx",
"args": ["mcp-grafana"],
"env": {
"GRAFANA_URL": "https://yourcompany.grafana.net",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "glsa_..."
}
},
"github": {
"command": "npx",
"args": ["@anthropic-ai/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
}
}
}
}
代理人使用Tellagen工具管理调查生命周期,并使用供应商工具收集证据:
- 阅读 Tellagen事件
- 查询 Grafana Loki用于错误日志,Prometheus用于度量
- 检查 GitHub上最近的部署和代码更改
- 发布 发现后返回Tellagen
- 完成 调查运行
认证
- API密钥通过
TELLAGEN_API_KEY环境变量(从不在args中) - 服务器在启动时通过调用来验证密钥
/api/v1/auth/me - 所有请求包括
Authorization: Bearer tllg_...头球 - MCP服务器充当API密钥的创建用户
范围
API密钥需要两个作用域:
| 范围 | 必需 |
|---|---|
incidents:read |
阅读事件、时间表、调查运行、调查结果 |
incidents:write |
开始调查、发布调查结果、按时间表推广 |
发展
设置
npm install
npm run build
npm test
在本地运行开发服务器
-
构建项目 (或使用手表模式):
npm run build # or, to rebuild on every change: npm run dev -
将MCP客户端指向本地版本 而不是已发布的npm包。
克劳德代码 --添加到
~/.claude.json(全球)或.mcp.json(每个项目):{ "mcpServers": { "tellagen": { "command": "node", "args": ["/absolute/path/to/tellagen-mcp-server/dist/index.js"], "env": { "TELLAGEN_API_KEY": "tllg_...", "TELLAGEN_API_URL": "https://yourcompany.api.tellagen.com" } } } }光标 --添加到
.cursor/mcp.json:{ "mcpServers": { "tellagen": { "command": "node", "args": ["/absolute/path/to/tellagen-mcp-server/dist/index.js"], "env": { "TELLAGEN_API_KEY": "tllg_...", "TELLAGEN_API_URL": "https://yourcompany.api.tellagen.com" } } } }替换
/absolute/path/to/tellagen-mcp-server带有克隆的实际路径。 -
重新启动MCP客户端 因此,它采用了新的配置。在Claude Code中,运行
/mcp以验证服务器是否已连接。 -
迭代: 如果你在跑步
npm run dev,每次保存都会重新编译。重新启动MCP连接(或重新启动客户端)以获取更改。
运行测试
npm test # all tests
npx vitest run test/client.test.ts # single file
npx vitest # watch mode
类型检查
npm run lint # tsc --noEmit
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
TELLAGEN_API_KEY |
是 | API密钥(格式: tllg_...) |
TELLAGEN_API_URL |
是 | API基本URL(例如。, https://yourcompany.api.tellagen.com) |