Token导航 LogoToken导航TokenDH.com
MCP Travis logo
运维云端未说明官方级别未说明来源级核验

MCP Travis

MCP Server

一个将Travis CI API暴露为工具和资源的MCP服务器,用于Claude和其他MCP兼容客户端,提供构建触发、日志查看、性能分析等功能。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
TypeScriptClaude日志分析Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Montana

提供方

Montana

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

mcp特拉维斯

模型上下文协议(MCP)服务器,将Travis CI API公开为Claude和其他兼容MCP的客户端的工具和资源。

特征:

  • 触发、重启和取消构建
  • 查看构建日志和作业详细信息
  • 将构建与调试失败进行比较
  • 获取组织/用户统计信息
  • 分析构建趋势和性能指标
  • 获取智能优化建议
  • 监控Travis CI服务状态
  • 通过自然语言管理构建

用法

https://github.com/user-attachments/assets/0e8cfa5b-f78f-4a27-8348-8a38e518bf98

一旦你看到你在Claude内部触发了构建,你就可以转到有问题的存储库:

如您所见,它是由Travis MCP触发的。更重要的是,如果你有一个想要重新启动的内部版本号,你也可以这样做:

你需要确保的是你有 mcp-travis 已激活,请参阅下文:

下面我将解释更多关于Travis MCP服务器的功能。

快速示例

以下是您可以使用此MCP服务器向Claude询问的一些问题:

  • “显示Travis build 276783990的日志” -查看完整的构建日志
  • “比较版本276783990和276783991” -查看两个版本之间的变化
  • “向我展示travis ci/travis web的构建见解” -分析构建趋势和性能
  • “我如何优化构建276783990?” -获取优化建议以加快构建速度
  • “在分支部署上触发travis-ci/travis-web的构建_2025.11.10” -开始新的构建
  • “铁路组织的Travis CI状态如何?” -获取组织统计信息
  • “特拉维斯·CI倒下了吗?” -检查服务运行状态
  • “重新启动版本276783990” -重新启动失败的构建
  • “取消构建276783990” -停止正在运行的构建
  • “获取276783990版本的作业详细信息” -查看单个作业配置

特性

资源

资源描述
travis:recent-builds?repo=owner/name&limit=20检索具有可选限制的存储库的最新版本
travis:env-vars?repo=owner/name获取存储库的环境变量
travis:build-log?jobId=123456789获取特定作业ID的构建日志

工具

工具说明
travis_triggerBuild使用可选的配置覆盖触发存储库/分支的构建
travis_restartBuild使用构建ID重新启动构建
travis_cancelBuild使用生成ID取消生成
travis_getBuildJobs获取特定构建的所有作业ID和详细信息
travis_getBuildLogs从构建中的所有作业中获取并组合日志(便利工具)
travis_getOwnerStats获取Travis CI用户或组织的统计数据和信息
travis_getServiceStatus检查Travis CI服务的运行状态
travis_compareBuilds比较两个版本,看看它们之间有什么变化
travis_getBuildInsights随着时间的推移,获取存储库的聚合构建统计数据和见解
travis_getOptimizationRecommendations分析构建日志,为缓存、并行化和性能提供优化建议

获取构建日志

有多种方法可以检索构建日志:

1.快速方法(推荐)

使用 travis_getBuildLogs 只需一个构建ID即可一次获取所有日志:

Ask Claude: "Show me all logs for build 276783990"

这会自动在一个请求中获取所有作业及其日志,如您将在下面的视频中看到的:

![Watch the video](https://github.com/user-attachments/assets/93cb09b1-2dbd-4dd4-8cd6-1cbf9cb2a1a2)

2.详细方法

当您需要更多控制时,首先获取作业详细信息,然后获取特定日志:

第一步: 获取所有作业ID及其详细信息

Ask Claude: "Get job details for build 276783990"

这使用 travis_getBuildJobs 并返回:

{
  "buildId": 276783990,
  "jobs": [
    {
      "id": 123456789,
      "number": "276783990.1",
      "state": "passed",
      "config": { "language": "node_js", "node_js": "18" },
      "allow_failure": false
    },
    {
      "id": 123456790,
      "number": "276783990.2",
      "state": "failed",
      "config": { "language": "node_js", "node_js": "20" },
      "allow_failure": false
    }
  ]
}

第二步: 获取特定作业的日志

Ask Claude: "Show me the log for job 123456790"

这使用了 travis:build-log?jobId={jobId} 资源仅用于获取该作业的日志。

使用案例: 此方法在以下情况下很有用:

  • 您只想检查失败的作业
  • 在查看日志之前,您需要查看作业配置
  • 您正在调试特定的测试矩阵配置

3.资源方法

直接使用单个作业日志的资源URI:

travis:build-log?jobId=123456789

获取组织/用户统计信息

使用 travis_getOwnerStats 要了解用户或组织的Travis CI活动的概述:

Ask Claude: "Show me Travis CI stats for travis-ci"
Ask Claude: "Get statistics for the rails organization"

这将返回:

  • 所有者类型(用户/组织)
  • 名称和GitHub ID
  • 总存储库计数和活动存储库计数
  • 最近活动的存储库及其上次构建状态
  • 视觉指示器:✓ (通过),✗ (失败),○ (无构建)

输出示例:

Travis CI Statistics for: travis-ci
================================================================================

Owner Information:
┌─────────────────────┬────────────────────────────┐
│ Owner Type          │ User                       │
│ Name                │ Travis CI                  │
│ GitHub ID           │ 639823                     │
└─────────────────────┴────────────────────────────┘

Repository Statistics:
--------------------------------------------------------------------------------
Total Repositories:     100  ████████████████████████████████████████
Active Repositories:    100  ████████████████████████████████████████
Inactive Repositories:    0  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Recent Active Repositories:
--------------------------------------------------------------------------------
Status  Repository                Last Build           Date
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✓     travis-ci/travis-web      #12345 - passed     2025-11-10
  ✗     travis-ci/travis-api      #67890 - failed     2025-11-09

Build Health Overview:
[✓] Passed: 1   ████████████████████
[✗] Failed: 1   ████████████████████

正在检查Travis CI服务状态

使用 travis_getServiceStatus 检查Travis CI是否遇到问题:

Ask Claude: "Is Travis CI down?"
Ask Claude: "Check Travis CI status"
Ask Claude: "What's the Travis CI service status?"

这将返回:

  • 总体运行状态
  • 单个组件的状态(API、构建、通知等)
  • 活动事件(如有)
  • 定期维护(如有)
  • 链接到完整状态页面

使用案例: 快速确定构建失败是由于Travis CI基础设施问题还是您的代码造成的。

输出示例:

Travis CI Service Status
================================================================================

┌────────────────────────────────────────────────────────────┐
│  Overall Status: ✓ ALL SYSTEMS OPERATIONAL                │
│  Last Updated: 2025-11-11T00:55:49.971Z                   │
└────────────────────────────────────────────────────────────┘

Service Components Health:
--------------------------------------------------------------------------------
Component              Status          Uptime
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Log Processing       operational     ████████████████████ 100%
✓ API                  operational     ████████████████████ 100%
✓ Builds Processing    operational     ████████████████████ 100%
✓ GitHub Integration   operational     ████████████████████ 100%
✓ Notifications        operational     ████████████████████ 100%

Incidents & Maintenance:
--------------------------------------------------------------------------------
✓ No active incidents
✓ No scheduled maintenance

Status Dashboard: https://www.traviscistatus.com

比较建筑

使用 travis_compareBuilds 了解两个版本之间的变化:

Ask Claude: "Compare Travis builds 276783990 and 276783991"
Ask Claude: "Why did build 100 pass but build 101 fail?"

这将返回一个详细的比较,显示:

  • 带有视觉指示器的构建状态(通过/失败)
  • 存储库和分支机构信息
  • 提交差异(SHA、消息、作者、日期)
  • 构建持续时间比较
  • 时间线(开始/结束时间)
  • 按作业与配置进行比较
  • 每个构建的通过/失败摘要
  • 下一步的明智建议

输出示例:

Build Comparison
================================================================================

Build #276783990 vs Build #276783991
--------------------------------------------------------------------------------

Build States:
┌──────────────────┬────────────┬────────────┐
│                  │  #276783990│  #276783991│
├──────────────────┼────────────┼────────────┤
│ State            │    ✓ PASS  │    ✗ FAIL  │
│ Duration         │      5m 30s│      3m 15s│
│ Jobs Passed      │          2 │          1 │
│ Jobs Failed      │          0 │          1 │
└──────────────────┴────────────┴────────────┘
⚠ States differ!

Repository:
  Build #276783990: travis-ci/travis-web
  Build #276783991: travis-ci/travis-web

Branch:
  Build #276783990: main
  Build #276783991: main

Commits:
  Build #276783990:
    SHA: a5962064
    Message: Release_251110
    Author: John Doe
    Date: 2025-11-10T10:00:00Z
  Build #276783991:
    SHA: b7a83f21
    Message: Update dependencies
    Author: Jane Smith
    Date: 2025-11-10T14:00:00Z
  ⚠ Different commits!

Build Duration:
  Build #276783990: 5m 30s  ████████████████████████████████████████
  Build #276783991: 3m 15s  ███████████████████░░░░░░░░░░░░░░░░░░░░
  Build #276783991 was 135s faster (40% improvement)

Job States:
  Build #276783990:                     Build #276783991:
  ┌─────────────────────────┐          ┌─────────────────────────┐
  │ ✓ Job #1.1: PASS        │          │ ✓ Job #2.1: PASS        │
  │   Node.js 18            │          │   Node.js 18            │
  ├─────────────────────────┤          ├─────────────────────────┤
  │ ✓ Job #1.2: PASS        │          │ ✗ Job #2.2: FAIL        │
  │   Node.js 20            │          │   Node.js 20            │
  └─────────────────────────┘          └─────────────────────────┘
       2/2 Jobs Passed                       1/2 Jobs Passed

Matrix Health:
Node 18  ✓✓  [100% pass]  ████████████████████
Node 20  ✓✗  [ 50% pass]  ██████████░░░░░░░░░░

Recommendation:
  • Build #276783990 passed but #276783991 failed
  • Check commit differences and failed job logs for #276783991
  • Use: "Show me logs for build 276783991" to investigate

使用案例:

  • 调试先前通过的构建开始失败的原因
  • 识别性能回归(持续时间变化)
  • 比较不同配置的矩阵构建
  • 追踪哪个提交导致了失败
  • 了解建筑之间的环境差异

获取构建见解和指标

使用 travis_getBuildInsights 分析构建趋势并获取汇总统计数据:

Ask Claude: "Show me build insights for travis-ci/travis-web"
Ask Claude: "What are the build trends for owner/repo?"
Ask Claude: "Analyze recent builds for owner/repo on the main branch"

这将返回全面的分析,包括:

  • 多个版本的总体通过/失败率
  • 近期趋势分析(改善/下降/稳定)
  • 构建持续时间统计数据(平均值、中位数、最快、最慢)
  • 按分支细分构建成功率
  • 最近提交信息失败
  • 可采取行动的见解和建议

参数:

  • repo (必填):存储库段符(例如,“travis-ci/travis-web”)
  • limit (可选):要分析的最新版本数(默认值:50,最大值:100)
  • branch (可选):将分析筛选到特定分支

输出示例:

Build Insights for: travis-ci/travis-web
================================================================================

Analyzing 50 most recent build(s)

Overall Statistics:
--------------------------------------------------------------------------------
Passed: 42 (84.0%)  ████████████████████████████████████████░░░░░░
Failed: 8           ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Recent Trend (Last 10 Builds):
--------------------------------------------------------------------------------
Pass Rate: 90.0% [IMPROVING]

  100% ┤
   90% ┤                                  ●━━━━━━━━
   80% ┤                           ●━━━━━━
   70% ┤                    ●━━━━━━
   60% ┤             ●━━━━━━
   50% ┤      ●━━━━━━
   40% ┤━━━━━━
       └──────────────────────────────────────────
        Build #1 → #10 (Most Recent)

Build Duration Analysis:
--------------------------------------------------------------------------------
Average: 5m 30s  ████████████████████████░░░░
Median:  5m 15s  ███████████████████████░░░░░
Fastest: 3m 20s  ███████████████░░░░░░░░░░░░░
Slowest: 8m 45s  ████████████████████████████████████████

Branch Breakdown:
--------------------------------------------------------------------------------
Branch            Builds    Pass Rate    ████████████████████
main                  35      85.7%      ████████████████████████████████████░░░░
develop               10      80.0%      ████████████████████████████████░░░░░░░░
feature/new-ui         5      80.0%      ████████████████████████████████░░░░░░░░

Recent Failures:
--------------------------------------------------------------------------------
✗ Build #276783991 (main) - 2025-11-10
  "Update dependencies to latest versions"
✗ Build #276783985 (develop) - 2025-11-09
  "Fix authentication bug in user login flow"

Insights & Recommendations:
--------------------------------------------------------------------------------
✓ Excellent build stability! 84.0% pass rate
  Recent builds are improving - great work!

使用案例:

  • 监控整体项目健康状况并建立稳定性
  • 识别构建成功/失败率的趋势
  • 构建时间中的点性能回归
  • 比较存储库中的分支稳定性
  • 就CI/CD改进做出数据驱动的决策
  • 跟踪最近更改对构建可靠性的影响

获取构建优化建议

使用 travis_getOptimizationRecommendations 分析构建日志并获得可操作的优化建议:

Ask Claude: "How can I optimize build 276783990?"
Ask Claude: "Give me optimization recommendations for build 276783990"
Ask Claude: "What can I do to speed up build 276783990?"

这将向您展示一些事情,总结可以更改的内容:

那么,它总共应该为您节省多少时间:

此工具分析构建中的所有作业日志,并为以下内容提供智能建议:

  • 依赖缓存:检测包安装并建议缓存策略
  • 构建工件缓存:确定可以从缓存中受益的编译步骤
  • 测试优化:建议测试并行化和拆分策略
  • Docker优化:建议Docker层缓存和映像优化
  • 设置开销减少:标识冗余设置操作
  • 作业持续时间分析:突出显示最慢的作业以进行目标优化

它检测到的内容:

  • 包管理器操作(npm、yarn、pip、bundle等)
  • 构建/编译步骤(TypeScript、Webpack、Maven、Gradle、Go、Rust等)
  • 测试执行模式
  • Docker操作(pull、build)
  • 缓存命中和未命中
  • 冗余设置操作

看看它在行动:

![Watch the video](https://github.com/user-attachments/assets/93cb09b1-2dbd-4dd4-8cd6-1cbf9cb2a1a2)

输出示例:

Build Optimization Recommendations for Build #276783990
================================================================================

Analyzed 3 job(s) across this build

Key Findings:
--------------------------------------------------------------------------------
Category                   Occurrences    ████████████████████
Dependency Installation           3       ████████████████████
Build Process                     3       ████████████████████
Testing                           3       ████████████████████
Setup Overhead                    0       ░░░░░░░░░░░░░░░░░░░░
Docker Operations                 0       ░░░░░░░░░░░░░░░░░░░░

Detailed Analysis:
--------------------------------------------------------------------------------

Dependency Installation:
  • Job #276783990.1: Detected package installation. Consider caching dependencies.
  • Job #276783990.2: Detected package installation. Consider caching dependencies.
  • Job #276783990.3: Detected package installation. Consider caching dependencies.

Build Process:
  • Job #276783990.1: Build/compilation detected. Consider caching build artifacts.
  • Job #276783990.2: Build/compilation detected. Consider caching build artifacts.
  • Job #276783990.3: Build/compilation detected. Consider caching build artifacts.

Testing:
  • Job #276783990.1: Tests detected. Consider test splitting for parallel execution.
  • Job #276783990.2: Tests detected. Consider test splitting for parallel execution.
  • Job #276783990.3: Tests detected. Consider test splitting for parallel execution.

Optimization Recommendations:
--------------------------------------------------------------------------------

📦 Dependency Caching:
  • Enable Travis CI's built-in cache for dependencies
  • Add to .travis.yml:
    cache:
      directories:
        - node_modules  # for Node.js
        - ~/.npm
        - ~/.cache/pip  # for Python
        - vendor/bundle # for Ruby
  • Use 'npm ci' instead of 'npm install' for faster, reproducible builds

Build Artifact Caching:
  • Cache compiled/built artifacts between builds
  • Add build output directories to cache configuration
  • Consider incremental compilation if supported by your tooling
  • Example: cache: { directories: ['dist', 'build', '.next'] }

Test Optimization:
  • Split tests across multiple jobs for parallel execution
  • Use test sharding/splitting based on timing data
  • Consider running unit tests before slower integration tests
  • Run only affected tests for PR builds
  • Example: Use build matrix to run test suites in parallel

General Best Practices:
  • Use 'fast_finish: true' in build matrix to fail fast
  • Leverage build stages for dependent job execution
  • Consider conditional builds (skip builds for doc-only changes)
  • Monitor build times regularly and set up alerts for regressions

Job Duration Analysis:
--------------------------------------------------------------------------------
Job Performance Comparison:

Job #276783990.1  5m 30s  ████████████████████████████████████████
Job #276783990.2  5m 15s  ██████████████████████████████████████
Job #276783990.3  5m 10s  █████████████████████████████████████

Timeline:
0:00    1:00    2:00    3:00    4:00    5:00    6:00
├───────┼───────┼───────┼───────┼───────┼───────┤
│       │       │       │       │       │       │
Job 1   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████
Job 2   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████
Job 3   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████

⚠ Slowest job takes over 5 minutes - consider optimization strategies above

Next Steps:
--------------------------------------------------------------------------------
1. Review the recommendations above
2. Update your .travis.yml with caching configuration
3. Monitor subsequent build times for improvements
4. Use 'travis_compareBuilds' to compare before/after optimization

使用案例:

  • 通过有针对性的建议加快慢速构建
  • 通过优化构建效率降低CI成本
  • 自动识别缓存机会
  • 获取可操作的步骤以提高构建性能
  • 通过智能分析学习CI/CD最佳实践
  • 验证您的构建是否遵循优化指南

设置

快速设置(推荐)

运行自动安装脚本:

cd mcp-travis
./setup.sh

脚本将:

  • 检查系统要求(Node.js 18+)
  • 安装依赖项
  • 构建项目
  • 配置环境变量(Travis CI API令牌提示)
  • 自动设置Claude Desktop集成

安装完成后,只需 重新启动克劳德桌面 你准备好了!

手动设置

如果您更喜欢手动设置:

需求

要求版本
Node.js18+

环境变量

  1. 复制示例环境文件:
   cp .env.example .env
  1. 配置以下变量:
变量描述示例
TRAVIS_API_URLTravis CI API终点https://api.travis-ci.com
TRAVIS_API_TOKEN您的Travis CI API代币xxxxxxxxxxxxxxxxxxxx
TRAVIS_USER_AGENTAPI请求的用户代理mcp-travis/0.1
注: 使用Travis CI API v3。确保您的令牌具有API访问权限。

发展

npm i
npm run dev

服务器通过stdio(MCP)运行,并打印最少的启动日志。

构建

npm run build
npm start

与MCP客户端一起使用

向您的MCP兼容客户端添加一个指向的条目 mcp-travis (构建的二进制文件),并确保环境变量在客户端的环境/会话中可用。

Claude桌面配置

增添 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-travis": {
      "command": "node",
      "args": [
        "/path/to/mcp-travis/dist/index.js"
      ],
      "env": {
        "TRAVIS_API_URL": "https://api.travis-ci.com",
        "TRAVIS_API_TOKEN": "your_travis_token_here",
        "TRAVIS_USER_AGENT": "mcp-travis/0.1"
      }
    }
  }
}

获取Travis CI API代币:

  1. 首选https://travis-ci.com(或您的Travis CI实例)
  2. 点击您的个人资料图片→ 设置
  3. 转到“设置”选项卡
  4. 查找“API身份验证”部分
  5. 复制您的令牌

配置后,重新启动Claude Desktop以加载MCP服务器。

作者

迈克尔·曼迪©2025

目录标签

目录标签

TypeScriptClaude日志分析持续集成本地部署构建管理性能优化自动化工具

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP