Test Impact Analysis MCP Server
The Test Impact Analysis (TIA) MCP Server provides intelligent code change impact analysis, test recommendation, and risk assessment for software testing. Its capabilities include:
repo_monitor— Monitor repositories for new commits, check status, and reset watermarks/baselines. Supports cron-based scheduling and filtering by name/module.repo_clone— Clone repositories in full mode (entire branch) or incremental mode (only MR/PR changes since a date or MR ID). Supports local stdio or returns structured git commands for remote HTTP clients.impact_analysis— Analyze code changes to identify affected test cases using glob file-to-test mapping rules and optional BFS call-chain tracing via a static analysis engine. Returns prioritized affected test cases with confidence levels.test_recommendation— Recommend a prioritized test execution order and generate a minimal viable test set based on impact analysis and risk scores (risk weight × confidence).risk_assessment— Quantify change risk on a 0–100 scale across three dimensions (file count, affected module risk levels, confidence penalty), with a risk grade (Low/Medium/High/Critical) and mitigation suggestions.TIA-init— One-time setup for remote HTTP clients: auto-issues API keys and returns appropriate command/skill files for Claude Code, Codex, or OpenCode.
Additional features:
Supports GitHub, Local, and Generic REST API platforms (GitLab, Gitee, Gitea, etc.)
Dual transport: local stdio (zero-config) and remote HTTP (secured by IP allowlist)
Integrates with codebase-memory-mcp for method-level call-chain analysis across 158 languages, with automatic fallback to glob matching if unavailable
Compatible with Claude Code, OpenCode, and Codex (OpenAI) AI coding frameworks
Two-layer security model separating open-source code from enterprise-specific configs
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Test Impact Analysis MCP Serveranalyze impact of latest commit in user-center"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🌐 Language / 语言 / 語言: English | 简体中文 | 繁體中文 | 日本語
我想... | 看这里 |
快速把项目跑起来 | |
了解能做什么 | |
看有哪些工具可用 | |
接入外部分析引擎 | |
配置 Claude Code / OpenCode | |
看完整设计蓝图 |
📦 包含内容
分类 | 内容 | 说明 |
🛠️ MCP 工具 | repo_monitor / repo_clone / impact_analysis / test_recommendation / risk_assessment | 5 个工具 |
🔌 Transport 双模 | stdio(本地零配置)/ http(远程 IP 白名单) | 双模 |
🌐 平台适配器 | GitHub / Local / Generic REST API | 3 种平台 |
🔬 分析引擎 | codebase-memory-mcp(158 语言静态分析,方法级调用链) | 1 个引擎 |
📊 影响分析 | glob 规则匹配 + BFS 调用链追踪 + 四级置信度 | Phase 2-4 |
🔒 安全分层 | 源码层(提交GitHub) ↔ 企业配置层(.gitignore) | 双层 |
从初始 7 个工具合并为 3 个(精简 57%),Phase 2-4 新增 2 个分析工具(5 个)。安全认证从两层(API KEY + IP)精简为一层(IP 白名单)。简单、实用、免维护。
Related MCP server: MCP RAG Agent Server
🎯 项目定位
┌──────────────────────────────────────────────────────┐
│ Claude Code / OpenCode / Codex (Host) │
│ ├─ CronCreate → 定时触发 repo_monitor │
│ ├─ /repo_xxx 斜杠命令 → 快捷操控 │
│ └─ MCP Client (stdio / http transport) │
└─────────┬──────────────┬──────────────────────────────┘
│ stdio (本地) │ http (远程)
┌─────────▼────────┐ ┌──▼───────────────────────────────┐
│ 直接进程通信 │ │ Express App (port 3100) │
│ (零配置) │ │ └─ IP 白名单 → 通过/403 │
│ 直接执行 git clone │ └──────────────────────────────────┘
└──────────────────┘
┌──────────────────────────────────────────────────────┐
│ TIA MCP Server │
│ │
│ ┌─────────────────────────────────────────────┐ │
│ │ 模块 1: Git Monitor │ │
│ │ repo_monitor + repo_clone │ │
│ │ GitHub / Local / Generic 三平台适配 │ │
│ └─────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────┐ │
│ │ 模块 2: Impact Analysis + 引擎增强 │ │
│ │ impact_analysis + codebase-memory-mcp │ │
│ │ BFS 调用链逆向追踪 + glob 文件级兜底 │ │
│ └─────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────┐ │
│ │ 模块 3: Test Recommendation │ │
│ │ test_recommendation │ │
│ │ 推荐分 = 风险权重 × 置信度 │ │
│ └─────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────┐ │
│ │ 模块 4: Risk Assessment │ │
│ │ risk_assessment │ │
│ │ 文件+模块+置信度 三维评分 (0-100) │ │
│ └─────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────┘🚀 快速开始
1️⃣ 克隆并安装
git clone git@github.com:WayneLiu519888/Test-Impact-Analysis-MCP.git
cd Test-Impact-Analysis-MCP
npm install # 自动安装 git hooks2️⃣ 配置你的仓库
cp examples/monitors.conf.example.json enterprise/monitors.conf.json
vim enterprise/monitors.conf.json # 填入你要监控的仓库3️⃣ 配置 MCP 连接
Stdio 本地模式(零配置):
// .claude/settings.local.json
{ "enabledMcpjsonServers": ["test-impact-analysis"] }HTTP 远程模式(需先配置 IP 白名单):
{
"mcpServers": {
"test-impact-analysis": {
"type": "http",
"url": "http://your-server:3100/mcp"
}
}
}4️⃣ 开始使用
/repo_status # 查看仓库水位
/repo_check module=用户中心 # 检查新提交
/repo_clone full module=用户中心 # 克隆代码
impact_analysis(name="backend") # 变更影响分析
test_recommendation(name="backend") # 测试推荐
risk_assessment(name="backend") # 风险评估✨ 完成! 代码变更自动感知 + 增量代码拉取 + 精准测试影响分析。
🛠️ 5 个 MCP 工具
我想... | 使用此工具 | 说明 |
查看/检查/重置仓库水位 |
| 三合一: |
克隆代码到本地 |
| 全量( |
分析变更对测试的影响 |
| glob 规则匹配 + 引擎调用链追踪 + 自动推断 |
推荐测试执行顺序 |
| 推荐分 = 风险权重 × 置信度,生成最小可行测试集 |
评估变更风险 |
| 文件+模块+置信度三维评分 (0-100),含缓解建议 |
所有 5 个工具在 stdio 和 HTTP 模式下均可用。
🔬 分析引擎集成
TIA 支持接入外部代码静态分析引擎,提供方法级精确调用链分析能力。首个支持的引擎是 codebase-memory-mcp。
codebase-memory-mcp 引擎
单一静态二进制(~36MB),基于 tree-sitter 支持 158 种编程语言,零运行时依赖。
# 安装(PowerShell,3 步)
mkdir D:\0_WayneArchiveFiles\MCP-Servers\codebase-memory-mcp
curl -o "$env:TEMP\cbm.zip" "https://github.com/DeusData/codebase-memory-mcp/releases/latest/download/codebase-memory-mcp-windows-amd64.zip"
Expand-Archive "$env:TEMP\cbm.zip" D:\0_WayneArchiveFiles\MCP-Servers\codebase-memory-mcp
.\codebase-memory-mcp.exe --version # → codebase-memory-mcp 0.8.1
# 启用引擎
# 编辑 engines.conf.json → "enabled": true工作流程
impact_analysis 调用
└─ .java/.ts/.py 等 → codebase-memory-mcp CLI 子进程
├─ index_repository → 索引代码到本地 SQLite
├─ get_architecture → 提取方法/入口点
├─ query_graph → 提取全部 CALLS 调用边
└─ 翻译为 PanoramaIndex → BFS 调用链逆向遍历
└─ 合并到 TIA 影响分析报告✅ 代码分析 100% 本地 | 🔌 引擎不可用时静默降级到 glob 匹配 | 📖 完整配置指导
🌐 跨平台支持
同一套 MCP 工具,三个 AI 编程框架共享。
维度 | Claude Code | OpenCode | Codex (OpenAI) |
命令目录 |
|
|
|
文件格式 |
|
|
|
调用方式 |
|
|
|
MCP 配置 |
|
|
|
📥 安装方式
Claude Code (stdio)
// .claude/settings.local.json
{ "enabledMcpjsonServers": ["test-impact-analysis"] }Claude Code (HTTP 远程)
{
"mcpServers": {
"test-impact-analysis": {
"type": "http",
"url": "http://your-server:3100/mcp"
}
}
}# 服务端启动
MCP_TRANSPORT=http MCP_PORT=3100 npx tsx src/index.tsOpenCode / Codex
详见项目内 .opencode/commands/ 和 .codex/skills/ 目录。
📂 仓库目录
Test-Impact-Analysis-MCP/
│
├── src/
│ ├── index.ts # MCP Server 入口 + Transport 双模
│ ├── types.ts / state.ts # 类型定义 / 配置状态管理
│ ├── security.ts # IP 白名单
│ ├── paths.ts # 路径定位 + 企业配置层
│ ├── platforms/ # Git 平台适配器(GitHub/Local/Generic)
│ ├── tools/ # MCP 工具模块(schemas + helpers + 3 handler)
│ ├── impact-analysis/ # 影响分析 / 推荐 / 风险评估
│ ├── engines/ # 分析引擎框架
│ │ └── adapters/ # codebase-memory-mcp 适配器
│ └── tests/ # 65 个单元测试
│
├── examples/ # 配置模板(.example.json)
├── docs/ # 多语言文档
├── .claude/commands/ # Claude Code 斜杠命令
├── .opencode/commands/ # OpenCode 命令
├── .codex/skills/ # Codex 技能
│
├── enterprise/ # 🔒 企业配置层(.gitignore 排除)
│ ├── monitors.conf.json # 仓库监控配置
│ ├── server.conf.json # IP 白名单配置
│ ├── impact-rules.conf.json # 影响分析规则
│ └── engines.conf.json # 引擎配置
│
└── Repository/ # 🚫 克隆的代码(.gitignore 排除)🔒 信息安全
┌─────────────────────────────────┐
│ 开源层(提交 GitHub ✅) │
│ src/ docs/ examples/ README │
│ 不含企业 URL / 仓库 / 内网 IP │
├─────────────────────────────────┤
│ 企业层(.gitignore 排除 ❌) │
│ enterprise/ 整目录 │
│ 仓库地址 / IP 白名单 / 业务模块 │
└─────────────────────────────────┘两层防护:.gitignore 排除 enterprise/ + Pre-commit hook 实时拦截。
HTTP 安全:IP 白名单(精确 IP + CIDR 子网),白名单内可直接连接全部 5 个工具。
❓ FAQ
Node.js >= 18 | TypeScript / ESM | Git CLI | tsx 运行时
npm start # npx tsx src/index.ts
npm run dev # tsx --watch(热重载)
npx tsc --noEmit # 类型检查
npm test # 65 个测试TIA 运行在企业内网,网络隔离已由企业基础设施保障。IP 白名单作为唯一接入控制——简单、零维护、无密钥管理成本。
不会。 代码分析 100% 本地执行,语义向量模型编译进二进制,无外部 API 调用。启动时仅检查 GitHub Release 版本号(不含代码)。
自动静默降级到 TIA 内置的 glob 文件匹配规则。引擎失败不阻断分析流程。
GitLab / 华为 CodeHub / Gitee / 自建 GitLab / Gogs / Gitea — 通过 URL 模板适配,自动识别响应格式。
repo_clone mode=full— 首次拉取全量代码repo_clone mode=incremental— 只拉迭代内的 MR 变更,需要平台支持 MR API
📋 环境要求
依赖 | 版本 |
Node.js | >= 18 |
TypeScript | 5.x |
tsx | >= 4 |
@modelcontextprotocol/sdk | >= 1.0 |
Git | 任意 |
🔧 可用命令
命令 | 说明 |
| 启动 MCP Server(默认 stdio) |
| 开发热重载(tsx --watch) |
| 运行 65 个单元测试 |
| 类型检查 |
| 源码层安全自查 |
🗺️ 开发路线图
阶段 | 内容 | 状态 |
Phase 1 | Git Monitor — 仓库变更感知与代码拉取 | ✅ |
Phase 1.5 | Transport 双模 + IP 白名单 | ✅ |
Phase 1.6 | repo_clone 远程模式 | ✅ |
Phase 2 | Impact Analysis — 代码变更影响分析 | ✅ |
Phase 3 | Test Recommendation — 智能测试推荐 | ✅ |
Phase 4 | Risk Assessment — 变更风险量化 | ✅ |
Phase 5a | 分析引擎框架 + codebase-memory-mcp 接入 | ✅ |
Phase 5c | 更多分析引擎横向扩展 | 💡 |
Phase 6 | 信息安全分层重构 | ✅ |
📄 许可证
MIT — 自由使用,按需修改,欢迎回馈。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/WayneLiu519888/Test-Impact-Analysis-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server