@testneo/mcp-server
@testneo/mcp-server (v1)
用于 TestNeo 质量工作流的模型上下文协议 (MCP) 服务器。
该服务器向兼容 MCP 的 IDE 客户端(Cursor、Claude Desktop、VS Code MCP 客户端等)公开 TestNeo 项目/执行工具。
公共镜像 (MCP Market / GitHub)
用于列表展示和共享的独立开源镜像地址为:
https://github.com/gururajhm-neo/testneo-mcp
此目录是 TestNeo API 单体仓库内的事实来源。在修改此包后,若要刷新公共仓库,请运行:
./scripts/sync-public-mcp-repo.sh /path/to/your/local/testneo-mcp-clone然后从该克隆仓库执行 git commit + git push。许可证:GPL-3.0 — 参见 LICENSE。安全报告:参见 SECURITY.md。
Related MCP server: code-graph-mcp
响应
每个工具都会将
_telemetry合并到 JSON 结果中:包含request_id、tool、duration_ms、backend_paths(从该进程追踪到的每个后端调用的METHOD path),以及模式标记telemetry_schema_version和尽力而为的维度(project_id,可为空的tenant_id)。testneo_get_failure_bundle(以及涉及大量分类的testneo_run_agent_workflow步骤)在include_nlp_patch_suggestion为 true(默认值)时,可能包含suggested_nlp_patch。完整工具列表和契约:docs/MCP_TOOL_REFERENCE.md(通过scripts/sync-public-mcp-repo.sh与单体仓库的docs/mcp-tool-reference.md保持同步)。项目执行前提条件(默认开启): 生成和执行类工具会返回
project_precondition_failed,除非项目解析出一个真实的 http(s) 基础 URL(website_url或环境变量base_url)。拒绝example.com占位符。仅在特殊情况下禁用:TESTNEO_MCP_RELAX_PROJECT_PRECONDITIONS=true。执行契约标准化: 执行智能工具会发出
contract_version: execution_intelligence.v1和规范状态(queued | running | passed | failed | cancelled | unknown),同时保留原始后端状态。
v1 范围
以读取为主的工具 + 受保护的写入操作:
testneo_validate_connectiontestneo_list_projectstestneo_get_project_route_map(读取项目级路由强化映射/配置文件)testneo_list_unified_contexts(按名称 + ID 浏览上下文)testneo_get_unified_context_by_name(无需 UI 即可解析context_id)testneo_list_recent_executionstestneo_get_execution_statustestneo_get_execution_summarytestneo_get_execution_logstestneo_get_pass_fail_trendtestneo_watch_executiontestneo_get_failure_bundletestneo_run_agent_workflow(triage_failure_workflow,rerun_decision_workflow,qa_intelligence_workflow)testneo_ingest_figma_context(Figma ETL + 统一上下文创建)testneo_generate_tests_from_context(统一上下文 -> NLP 测试生成;可选路由强化)testneo_preview_generated_tests(人机协作预览:NLP + Playwright 规范草案)testneo_apply_route_hardening(只读:使用短语映射规范化模糊的导航行)testneo_set_project_route_map(持久化项目级路由映射/配置文件;受保护的写入)testneo_execute_generated_test_case(受保护的已生成测试用例执行)testneo_update_test_case_nlp(更新已生成测试的 NLP 命令)testneo_export_playwright_spec(将生成的测试导出为 Playwright SDK.spec.ts)testneo_run_playwright_spec_preview(从规范草案执行解析后的ai.run流程)testneo_figma_to_tests_workflow(端到端 Figma -> 上下文 -> 测试 -> 预览)testneo_search_failurestestneo_rerun_failed(默认预览;执行需要TESTNEO_MCP_ALLOW_WRITE=true和confirm=true)testneo_trigger_playwright_execution(需要TESTNEO_MCP_ALLOW_WRITE=true和confirm=true)Swagger/OpenAPI 智能
testneo_swagger_preview(只读:从 base64 解析规范 → 标签、端点计数)testneo_swagger_upload_and_generate(Web 项目:Swagger + 可选业务规则 → 上下文 + NLP 测试;写入 + 确认)testneo_swagger_impact_analysis/testneo_swagger_impact_actions(Web:与快照对比差异,分类操作;写入 + 确认)testneo_api_project_upload_openapi/testneo_api_project_openapi_impact(经典 API 项目;写入 + 确认)
设置
cd packages/testneo-mcp-server
npm install
npm run build所需环境变量:
TESTNEO_BASE_URL(例如:http://localhost:8001)TESTNEO_API_KEY
可选:
TESTNEO_MCP_ALLOW_WRITE=false(默认)TESTNEO_MCP_RELAX_PROJECT_PRECONDITIONS=false(默认) — 仅在生成/执行工具中跳过可执行基础 URL 检查时设置为trueTESTNEO_MCP_TELEMETRY_JSONL=false(默认) — 设置为true以将每个工具调用的 JSON 行输出到 stderr(outcome、request_id、duration_ms、backend_paths)TESTNEO_MCP_POLICY_MODE=strict(默认)或warn— 前提条件策略行为(strict会在发现阻碍性问题时拦截,warn会降低某些检查的级别)TESTNEO_MCP_TIMEOUT_MS=20000TESTNEO_MCP_SWAGGER_TIMEOUT_MS=120000(Swagger 多部分上传 + 重型 OpenAPI 影响 JSON 调用)TESTNEO_MCP_USER_AGENT=@testneo/mcp-serverTESTNEO_ROUTE_HARDENING=true(默认) — 设置为false以全局禁用短语→路径重写TESTNEO_ROUTE_PROFILE=none(默认)或saucedemo— 可选的预设短语映射(其他应用不需要)TESTNEO_ROUTE_MAP_JSON— 短语→路径的 JSON 对象(例如{"checkout overview":"/checkout"});当配置文件为saucedemo时合并到预设之上,或当配置文件为none时单独使用。路径应以/开头。
生成: testneo_generate_tests_from_context 默认 auto_align_saucedemo_route_map=true,因此当 auth 预设为 SauceDemo 且您没有自定义环境变量映射(profile 为 none,JSON 映射为空)时,导航行会获取 SauceDemo URL。
测试(无 API)
运行生产构建,然后进行路由强化、统一上下文发现和项目前提条件分类器(不对 TestNeo API 进行 HTTP 调用):
npm test冒烟测试
TESTNEO_BASE_URL="http://localhost:8001" TESTNEO_API_KEY="tn_xxx" npm run smokeCursor/IDE 命令
MCP 命令应运行:
node /absolute/path/to/testneo-api/packages/testneo-mcp-server/dist/index.js有关配置指南和示例提示词,请参阅 docs/IDE_SETUP.md。
安全说明
API 密钥仅从环境变量中读取。
写入工具默认禁用。
触发工具需要显式的
confirm=true。写入工具支持可选的
idempotency_key,以防止重试时重复执行。
代理工作流 (阶段 2A)
testneo_run_agent_workflow 在核心工具之上添加了一个编排层,并返回结构化的步骤追踪:
triage_failure_workflow:近期失败 -> 顶级失败包 -> 循环主题rerun_decision_workflow:近期失败 -> 重跑候选计划(先预览)qa_intelligence_workflow:统一智能报告(趋势 + 失败 + 分类 + 重跑预览)
Figma 转测试工作流 (阶段 2B)
MCP 现在支持在人工审批下的上下文驱动生成:
摄取 Figma 元数据并将 ETL 输出链接到统一上下文中
通过现有的 LangGraph 流水线从上下文实体生成 NLP 测试
以 NLP 和 Playwright SDK
.spec.ts草案格式预览生成的测试通过受保护的写入操作执行已批准的生成测试
Available Tools
48 toolstestneo_ai_assistant_queryA
Same Web AI Assistant as the product UI (/web/ai-assistant): natural-language Q&A over a project, optionally scoped to a unified context (PDF/Figma/requirements ingest). POST /api/web/v1/etl/ai-assistant/query. Pass context_id or context_name_query; omit both for project-wide analytics-style questions. Uses your Web AI chat quota. Optional recommend_context / rag_context match the web request body for AI-Q and document-aware answers.
Inputs: project_id (required), query (required), context_id, context_name_query, +5 more.
testneo_api_project_openapi_impactB
Run OpenAPI impact analysis for API (non-web) test cases against a new or stored spec. Pass openapi_spec to diff an inline revision, or omit to analyze using the spec already saved on the project. Guarded: allow-write + confirm=true (service may flag tests). Backend: POST /api/v1/projects/{id}/openapi-impact.
Inputs: project_id (required), openapi_spec, auto_flag, business_rules, +2 more.
testneo_api_project_upload_openapiA
Upload OpenAPI JSON/YAML to a classic API project (stores spec on Project.openapi_spec). Use before testneo_api_project_openapi_impact. Guarded: allow-write + confirm=true. Backend: POST /api/v1/projects/{id}/upload-openapi (multipart field: file).
Inputs: project_id (required), openapi_file_base64 (required), openapi_filename (required), confirm, +1 more.
testneo_apply_route_hardeningA
Rewrite vague Navigate-to NLP lines into {{base_url}}/path using server env (TESTNEO_ROUTE_PROFILE, TESTNEO_ROUTE_MAP_JSON) plus optional per-call overrides. Read-only; does not call the TestNeo API.
Inputs: nlp_commands (required), route_hardening.
testneo_bootstrap_web_mcp_projectA
One-shot onboarding: validate → create web project with optional default environment (base_url + credentials) in a single POST when add_base_url_variable=true. Returns a trace + recommended_next_tools. Guarded like other writes.
Inputs: name (required), website_url (required), description, project_environment_name, +6 more.
testneo_create_web_projectA
Create a new web automation project (stored under your API key account). Mirrors POST /api/web/v1/projects. Guarded: TESTNEO_MCP_ALLOW_WRITE=true and confirm=true. By default creates a default web environment with base_url (and optional username/password variables) in the same request; set create_default_environment=false for project-only. New projects get Lighthouse performance audits enabled unless project_settings overrides.
Inputs: name (required), website_url (required), description, environment, +8 more.
testneo_create_web_project_environmentB
Create a named web project environment with optional variables (e.g. base_url for {{base_url}} in NLP). Backend: POST /api/web/v1/projects/{project_id}/environments. Guarded: allow-write + confirm=true.
Inputs: project_id (required), name (required), is_default, is_active, +3 more.
testneo_delete_saved_api_test_chainA
Delete a saved API test chain by id. Guarded: TESTNEO_MCP_ALLOW_WRITE + confirm=true. Backend: DELETE /api/web/v1/projects/{id}/api-test-chains/{chain_id}.
Inputs: project_id (required), chain_id (required), confirm, idempotency_key.
testneo_execute_generated_test_caseA
Execute a generated test case by numeric test_case_id OR by project_id + name_query (resolved via GET …/test-cases/?search= then exact/unique name match). Human-in-loop gated. POST /api/web/v1/test-cases/{id}/execute — passes use_agent when TESTNEO_MCP_DEFAULT_EXECUTION_MODE=local and TESTNEO_MCP_PREFER_LOCAL_AGENT=true (same routing as batch). Optional wait_for_agent_seconds + env TESTNEO_MCP_WAIT_FOR_AGENT_MS / TESTNEO_MCP_REQUIRE_LOCAL_AGENT_FOR_BATCH control preflight polling. Use testneo_find_test_cases to browse matches before running.
Inputs: no named parameters.
testneo_export_playwright_specB
Export a test case as Playwright SDK TypeScript spec text.
Inputs: test_case_id (required).
testneo_figma_image_to_tests_workflowA
No Figma token: upload exported UI image (PNG/JPEG/GIF/WebP) like the product 'Upload Figma Image' flow → wait for vision ETL → create unified context → generate tests → preview. Guarded: TESTNEO_MCP_ALLOW_WRITE + confirm=true. Backend: POST /api/web/v1/etl/upload-figma-image (multipart field: file).
Inputs: project_id (required), image_file_base64 (required), image_filename (required), context_name (required), +11 more.
testneo_figma_to_tests_workflowC
End-to-end workflow: ingest Figma -> create unified context -> generate tests -> preview NLP + Playwright drafts.
Inputs: project_id (required), figma_token (required), figma_file_id (required), context_name (required), +4 more.
testneo_find_test_casesA
List web test cases in a project using the backend text search (?search= on GET /api/web/v1/test-cases/). Matches name/description per API rules. Read-only — use returned id + name with testneo_run_generated_test_pipeline (test_case_id) or pass project_id + name_query to run by name.
Inputs: project_id (required), search (required), limit, skip.
testneo_generate_tests_from_contextB
Generate NLP test cases from an existing unified context (Figma, requirements, etc.). Resolve context via testneo_list_unified_contexts or testneo_get_unified_context_by_name (name_query, not scraped UI ids). Omit auth_preamble for public / no-login apps (default: no SauceDemo login injected, no SauceDemo route auto-align). Pass auth_preamble { enabled:true, preset:'saucedemo' } only for demos against saucedemo.com. Custom maps: TESTNEO_ROUTE_MAP_JSON or testneo_set_project_route_map; optional auto_align_saucedemo_route_map + SauceDemo preset ties route phrases to SauceDemo paths.
Inputs: project_id (required), context_id (required), test_types, include_ui_tests, +12 more.
testneo_get_execution_logsC
Get execution logs for an execution ID.
Inputs: execution_id (required), limit, offset.
testneo_get_execution_statusC
Fetch primary execution status, steps and summary metadata for an execution ID.
Inputs: execution_id (required), include_steps.
testneo_get_execution_summaryB
Get analytics summary for an execution (status, pass/fail, duration, video metadata).
Inputs: execution_id (required).
testneo_get_failure_bundleA
Get a compact failure triage bundle: summary, event sample, logs, inferred theme, next actions, plus a concrete suggested NLP patch (diff + testneo_update_test_case_nlp payload) when execution summary includes test_case_id.
Inputs: execution_id (required), logs_limit, event_limit, include_nlp_patch_suggestion.
testneo_get_local_agent_statusA
Returns whether a TestNeo self-hosted agent is registered and recently heartbeating (local runner). Includes setup_url on the same origin as TESTNEO_BASE_URL (for example …/web/agent). Read-only.
Inputs: no named parameters.
testneo_get_pass_fail_trendC
Summarize pass/fail trend for a project over a date range.
Inputs: project_id (required), range, limit.
testneo_get_project_route_mapC
Get project-level MCP route-hardening map/profile from project_settings.mcp_route_hardening.
Inputs: project_id (required).
testneo_get_unified_context_by_nameB
Resolve unified context_id from a natural-language name against this project’s contexts (calls list internally). Great for onboarding and demos.
Inputs: project_id (required), name_query (required), match_mode, prefer_context_id, +1 more.
testneo_ingest_figma_contextB
Ingest Figma metadata via ETL, optionally wait for completion, then create a linked unified context for test generation.
Inputs: project_id (required), figma_token (required), figma_file_id (required), context_name (required), +4 more.
testneo_list_projectsB
List projects available to the current API key user.
Inputs: limit, offset.
testneo_list_recent_executionsC
List recent executions, optionally filtered by project/status/release/build.
Inputs: project_id, status_filter, release, build, +2 more.
testneo_list_saved_api_test_chainsA
List user-saved API test chain suites for a web project (ordered test_case_ids). Read-only: GET /api/web/v1/projects/{id}/api-test-chains.
Inputs: project_id (required).
testneo_list_tests_by_tagsA
List web test case ids for a project matching one or more tags. Tags may include a leading @; each tag is queried separately (union with tag_match=any, intersection with all). Backend: GET /api/web/v1/test-cases/?tag_filter= (one tag per request).
Inputs: project_id (required), tags (required), tag_match.
testneo_list_unified_contextsB
List unified contexts for a project with id + human-readable names. Use before testneo_generate_tests_from_context so agents do not have to scrape context_id from the UI.
Inputs: project_id (required), compact, max_compact_lines.
testneo_preview_generated_testsA
Preview generated tests in both NLP and Playwright SDK spec.ts draft format for human-in-loop approval. Applies route hardening (env + optional route_hardening) to Navigate-to lines when a phrase map is configured.
Inputs: generated_test_cases (required), max_items, route_hardening.
testneo_rerun_failedB
Rerun failed tests for a project using test-case execute endpoint (guarded write action).
Inputs: project_id (required), limit, confirm, range, +1 more.
testneo_run_agent_workflowC
Run an agentic multi-step QA workflow (triage_failure, rerun_decision, qa_intelligence) over TestNeo data.
Inputs: workflow_type (required), project_id (required), range, top_failures, +1 more.
testneo_run_api_test_chainA
Create and execute a multi-test run using an ordered API chain: either explicit test_case_ids (preserves order) or saved_chain_id from testneo_list_saved_api_test_chains. Same execution routing as testneo_run_batch_by_tags (local agent wait, use_agent, etc.). Guarded: TESTNEO_MCP_ALLOW_WRITE + confirm=true.
Inputs: project_id (required), test_case_ids, saved_chain_id, confirm, +8 more.
testneo_run_batch_by_tagsB
Create and execute a multi-test run for tests matching tags (write: requires TESTNEO_MCP_ALLOW_WRITE + confirm=true). Resolves tags like testneo_list_tests_by_tags, then POST /api/web/v1/multi-test-runs/create and POST …/execute. When TESTNEO_MCP_DEFAULT_EXECUTION_MODE=local and TESTNEO_MCP_PREFER_LOCAL_AGENT=true, sets use_agent for the local TestNeo agent. While use_agent: polls GET /agents/my-agent until connected or until TESTNEO_MCP_WAIT_FOR_AGENT_MS / wait_for_agent_seconds elapses (avoids failing if you start the agent seconds after invoking the tool). Optional TESTNEO_MCP_OPEN_AGENT_SETUP_ON_AGENT_FAILURE opens setup_url on hard agent failure.
Inputs: project_id (required), tags (required), tag_match, confirm, +8 more.
testneo_run_generated_test_pipelineC
End-to-end: execute a generated test by test_case_id OR (project_id + name_query), poll until terminal, return analytics summary + step-level execution, optional failure triage bundle, and project pass/fail trend. POST /api/web/v1/test-cases/{id}/execute sends use_agent when local+prefer-local (same as testneo_execute_generated_test_case). name_match_mode: auto|exact|substring. Optional wait_for_agent_seconds for preflight.
Inputs: no named parameters.
testneo_run_playwright_spec_previewC
Run a Playwright SDK spec preview by extracting ai.run commands and executing via Playwright SDK execute endpoint.
Inputs: project_id (required), test_name (required), playwright_spec_ts (required), mode, +2 more.
testneo_save_api_test_chainB
Persist a named API test chain (ordered NLP/API web tests) for a project. Guarded: TESTNEO_MCP_ALLOW_WRITE + confirm=true. Backend: POST /api/web/v1/projects/{id}/api-test-chains.
Inputs: project_id (required), name (required), test_case_ids (required), description, +2 more.
testneo_search_failuresB
Search failed executions for a project by test name or execution id fragment.
Inputs: project_id (required), query (required), limit.
testneo_set_project_route_mapB
Persist project-level route-hardening map/profile in project_settings.mcp_route_hardening (guarded write action).
Inputs: project_id (required), profile, enabled, extra_map, +3 more.
testneo_suggest_api_test_chainsA
Scan Swagger/NLP-derived API-style web tests for a project and return suggested business-flow chains (ordering, phases, suite summaries). Read-only: GET /api/web/v1/projects/{id}/api-test-chains/suggest. Use before recommending which suite to run or before testneo_save_api_test_chain / testneo_run_api_test_chain.
Inputs: project_id (required).
testneo_swagger_impact_actionsB
Bulk apply impact triage on web test cases: mark_stale | archive | keep, then promote modified spec snapshot when possible. Guarded: allow-write + confirm=true. Backend: POST /api/web/v1/ai-test-gen/impact-actions.
Inputs: project_id (required), actions (required), confirm, idempotency_key.
testneo_swagger_impact_analysisB
Compare an uploaded Swagger revision against the last snapshot for a web project, diff endpoints, and list impacted swagger-sourced NLP tests. Persists the modified spec bytes for the next baseline. Guarded: allow-write + confirm=true. Backend: POST /api/web/v1/ai-test-gen/impact-analysis.
Inputs: project_id (required), swagger_file_base64 (required), swagger_filename (required), confirm, +1 more.
testneo_swagger_previewA
Parse Swagger/OpenAPI (JSON or YAML) from base64 and return spec format, tags, and endpoint counts. Read-only; no DB writes. Backend: POST /api/web/v1/ai-test-gen/preview.
Inputs: swagger_file_base64 (required), swagger_filename (required).
testneo_swagger_upload_and_generateA
Upload Swagger + optional business rules → unified context indexing + NLP web test cases (multipart). Guarded: TESTNEO_MCP_ALLOW_WRITE + confirm=true. Respects project execution preconditions. Large payloads: set TESTNEO_MCP_SWAGGER_TIMEOUT_MS. Backend: POST /api/web/v1/ai-test-gen/upload-and-generate.
Inputs: project_id (required), swagger_file_base64 (required), swagger_filename (required), business_rules_text, +7 more.
testneo_trigger_playwright_executionB
Trigger NLP execution via Playwright SDK execute endpoint (write tool, requires confirm + allow-write).
Inputs: project_id (required), test_name (required), nlp_commands (required), mode, +2 more.
testneo_update_test_case_nlpB
Update NLP commands for a specific test case ID and return verification snapshot. Optionally rewrites Navigate-to lines using route hardening (same env / route_hardening as generate).
Inputs: test_case_id (required), nlp_commands (required), apply_route_hardening, route_hardening, +1 more.
testneo_validate_connectionA
Validate token and fetch basic account context.
Inputs: no named parameters.
testneo_validate_prC
Run TestNeo PR validation planning from diff or git refs. Returns shared workflow context, impacted tests, planned verification stages, and Claude-ready findings using the new orchestration contracts.
Inputs: project_id (required), repository (required), pull_request (required), git (required), +4 more.
testneo_watch_executionB
Poll execution summary until terminal status or timeout window.
Inputs: execution_id (required), max_polls, poll_interval_ms, include_event_sample, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 48 tools
The tool set covers diverse areas, but several tools have overlapping purposes (e.g., multiple execution and batch-run tools). Descriptions help differentiate them, but an agent could still be confused when choosing between similar-sounding tools like testneo_execute_generated_test_case and testneo_run_generated_test_pipeline.
All tools share the 'testneo_' prefix, but the naming pattern is inconsistent: some use verb_noun (testneo_create_web_project), others use noun_verb combinations (testneo_api_project_openapi_impact) or longer phrases (testneo_figma_to_tests_workflow). While readable, the lack of a strict convention reduces predictability.
With 48 tools, the server is excessively large for typical use. Although the domain is broad, this count is likely overwhelming and indicates a lack of focus, potentially leading to agent confusion and performance issues.
The tool set covers creation, reading, and some updating across multiple entities, but critical delete operations are missing for projects, test cases, contexts, and environments. This gap means agents may need fallback strategies or fail when attempting to clean up resources.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Official MCP server for Qase — manage test cases, runs, suites, defects via AI tools.
MCP server for Product Management
Free test management over MCP: projects, test cases, plans, runs, environments and tasks.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP serverr for Lastest to manage your tests, AI create them, run them, and speed up AI-development.22Functional Source , Version 1.1, ALv2 Future
- AlicenseAqualityDmaintenanceMCP server for comprehensive code analysis, navigation, and quality assessment across 25+ programming languages.988MIT
- AlicenseAqualityBmaintenanceAn MCP server that brings senior-QA discipline to AI coding assistants, enabling test planning, TDD, mutation testing, and code review.50247 PyPI9Apache 2.0
- AlicenseAqualityDmaintenanceMCP server that generates ISO/IEC/IEEE 29119-3 compliant test plan drafts from project information, providing a structured resource for the standard's test plan outline and a tool for draft creation.1113 npmMIT