MCP 测试
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- AI 智能
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 需要 · Anthropic
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 文件与系统权限
-
- 只读
- 读取环境变量
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: mcp-headless-test
description: Run live tests of the Ariadne MCP server using Claude Code in headless mode. Tests tool discover…
category: AI 智能
runtime: Node.js
---
# mcp-headless-test 输出预览
## PART A: 任务判断
- 适用问题:提示词、Agent 工作流、模型评估或自动化推理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Purpose / Prerequisites / Running the Tests”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于提示词、Agent 工作流、模型评估或自动化推理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Purpose / Prerequisites / Running the Tests”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、读取环境变量、写入/修改文件、会按任务需要访问外部网络、需要准备 Anthropic API Key 给出执行前确认项。
## Running Rules
- 读取文件、读取环境变量、写入/修改文件;会按任务需要访问外部网络;需要准备 Anthropic API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、读取环境变量、写入/修改文件。
先用一个小任务确认它会围绕“Purpose / Prerequisites / Running the Tests”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: mcp-headless-test
description: Run live tests of the Ariadne MCP server using Claude Code in headless mode. Tests tool discover…
category: AI 智能
source: tomevault-io/skills-registry
---
# mcp-headless-test
## 什么时候使用
- 用于组织测试、定位失败并形成修复闭环 适合处理AI Agent、提示词、模型评估与自动化推理,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;使用前要准备…
- 面向提示词、Agent 工作流、模型评估或自动化推理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Purpose / Prerequisites / Running the Tests」组织步骤,不把推断写成作者事实。
- 读取文件、读取环境变量、写入/修改文件;会按任务需要访问外部网络;需要准备 Anthropic API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "mcp-headless-test" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Purpose / Prerequisites / Running the Tests
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Node.js | 读取文件、读取环境变量、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 需要准备 Anthropic API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} MCP Headless Test Pipeline
Purpose
Validate the Ariadne MCP server by running it with Claude Code in headless mode (claude -p). This tests the real user experience rather than just programmatic MCP client behavior.
Prerequisites
Before running tests, ensure:
- Claude Code CLI is installed and configured
- API key is set (either
ANTHROPIC_API_KEYenv var or Claude's configured key) - MCP package is built:
npm run build -w packages/mcp
Running the Tests
Quick Run
cd packages/mcp
./tests/claude-headless-test.sh
Verbose Mode (for debugging)
./tests/claude-headless-test.sh --verbose
Test Scenarios
The script runs 3 tests:
| Test | Name | What It Validates |
|---|---|---|
| 1 | Tool Discovery | Claude can see the list_entrypoints tool |
| 2 | Tool Invocation | Tool runs successfully on fixture code |
| 3 | Filtered Analysis | File/folder filtering parameters work |
Interpreting Results
Success Output
========================================
Ariadne MCP - Claude Headless Tests
========================================
[INFO] Checking prerequisites...
[INFO] All prerequisites met.
[INFO] Test 1: Tool Discovery
[INFO] Checking if Claude can see the list_entrypoints tool...
[INFO] PASS: Tool 'list_entrypoints' discovered
[INFO] Test 2: Tool Invocation
[INFO] Running list_entrypoints on fixture code...
[INFO] - Found 'entry point' in output
[INFO] PASS: Tool invocation succeeded
[INFO] Test 3: Filtered Analysis
[INFO] Testing file/folder filtering parameters...
[INFO] PASS: Filtered analysis completed
========================================
Test Summary
========================================
Total: 3
Passed: 3
Failed: 0
[INFO] All tests passed!
Failure Indicators
| Indicator | Meaning | Action |
|---|---|---|
Claude Code CLI not found |
claude command not in PATH |
Install Claude Code CLI |
MCP server not built |
Missing dist/server.js |
Run npm run build -w packages/mcp |
Tool 'list_entrypoints' not found |
Claude didn't discover the MCP tool | Check MCP config, server logs |
Tool invocation did not produce... |
Tool ran but output unexpected | Check if fixtures exist, review Claude's response |
FAIL: Filtered analysis... |
Folder filtering parameter not working | Check tool schema, parameter handling |
Verifying Correctness
Test 1: Tool Discovery
Expected behavior: Claude should list list_entrypoints when asked about available tools.
Manual verification:
claude -p "What MCP tools do you have?" \
--mcp-config ./packages/mcp/tests/mcp-test-config.json \
--output-format json
Look for output containing:
- Tool name:
list_entrypoints - Description mentioning "entry point" and "call tree"
Test 2: Tool Invocation
Expected behavior: Claude should successfully invoke the tool and return analysis results.
Manual verification:
claude -p "Use list_entrypoints to analyze the codebase" \
--mcp-config ./packages/mcp/tests/mcp-test-config.json
Valid output should contain:
- "Entry Points" header
- Function signatures (e.g.,
function_name(...): return_type) - Tree size indicators (e.g.,
-- N functions) - File locations (e.g.,
Location: ...) - Total count (e.g.,
Total: X entry points)
Test 3: Filtered Analysis
Expected behavior: Tool accepts folders parameter and analyzes only specified directories.
Manual verification:
claude -p "Use list_entrypoints with folders=['functions']" \
--mcp-config ./packages/mcp/tests/mcp-test-config.json
Valid output: Should show entry points only from the functions/ subdirectory of the fixtures.
Test Configuration
The tests use packages/mcp/tests/mcp-test-config.json:
{
"mcpServers": {
"ariadne": {
"type": "stdio",
"command": "node",
"args": ["./packages/mcp/dist/server.js"],
"env": {
"PROJECT_PATH": "./packages/core/tests/fixtures/typescript/code"
}
}
}
}
This points to TypeScript fixtures in packages/core/tests/fixtures/typescript/code/ for deterministic, reproducible tests.
Server Lifecycle Notes
Important: The MCP server process stays alive across tool calls within a session, BUT each tool call creates a fresh Project instance and re-indexes the codebase. This is intentional to support scoped analysis (file/folder filtering).
Performance implication: Large codebases may take 2+ seconds per tool call due to re-indexing.
Troubleshooting
Claude hangs or times out
- Check
ANTHROPIC_API_KEYis valid - Try with
--verboseflag to see debug output - Ensure network connectivity to Anthropic API
Tool not discovered
Verify MCP config path is correct
Check server.js exists:
ls packages/mcp/dist/server.jsTest server directly:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | \ PROJECT_PATH=. node packages/mcp/dist/server.js
Unexpected tool output
- Check fixtures exist:
ls packages/core/tests/fixtures/typescript/code/ - Test with E2E tests first:
npm test -w packages/mcp - Review server stderr for errors (use
--verbose)
Related Files
| File | Purpose |
|---|---|
packages/mcp/tests/claude-headless-test.sh |
Test runner script |
packages/mcp/tests/mcp-test-config.json |
MCP server configuration |
packages/mcp/src/start_server.ts |
Server implementation |
packages/mcp/src/list_entrypoints.e2e.test.ts |
Programmatic E2E tests |
Source: CRJFisher/ariadne — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核