Skip to main content
Glama
testlink-mcp-server

testlink-mcp-server

by adama007

testlink-mcp-server

MCP (Model Context Protocol) server exposing the TestLink XML-RPC API as typed tools for LLM agents (Claude Desktop, Claude Code, etc.).

Stack

Concern

Choice

Runtime

Node.js ≥ 18, TypeScript, ESM

MCP transport

@modelcontextprotocol/sdk over stdio

TestLink transport

xmlrpc client, devKey injected on every call

Schema validation

zod (per-tool input schemas)

Tests

vitest, XML-RPC client fully mocked

Related MCP server: Testmo MCP Server

Project structure

testlink-mcp-server/
├── src/
│   ├── index.ts            # MCP server entry point (registers all tool groups, stdio transport)
│   ├── client.ts            # TestLinkClient: XML-RPC wrapper, retry/timeout, error normalization
│   ├── types.ts              # TestLinkClientConfig, TestLinkError
│   ├── mcp-helpers.ts         # toToolResult(): uniform success/error → MCP content mapping
│   ├── xmlrpc.d.ts            # minimal ambient types for the untyped `xmlrpc` package
│   └── tools/
│       ├── projects.ts        # list_projects, create_project
│       ├── testsuites.ts       # list/create/update/delete_test_suite
│       ├── testcases.ts         # read/create/update/delete_test_case, list_test_cases_in_suite
│       ├── customfields.ts       # get/update_custom_field_value, list_custom_fields_for_project
│       ├── requirements.ts        # list/create/get_requirement, create_requirement_specification, assign_requirements
│       ├── testplans.ts            # list/create/delete_test_plan, add_test_case_to_test_plan, get_test_cases_for_test_plan
│       ├── builds.ts                # create/list/close_build
│       ├── executions.ts             # create/read_test_execution
│       └── diagnostics.ts             # list_available_api_methods (system.listMethods introspection)
├── test/client.test.ts
├── package.json
├── tsconfig.json
├── vitest.config.ts
└── .env.example

Installation

npm install
npm run build

Configuration

Copy .env.example to .env and fill in your instance's details:

cp .env.example .env

Variable

Required

Description

TESTLINK_URL

yes

Full XML-RPC endpoint, e.g. http://host/testlink/lib/api/xmlrpc/v1/xmlrpc.php

TESTLINK_API_KEY

yes

Personal API key from TestLink → My Settings → API interface

TESTLINK_TIMEOUT_MS

no

Per-call network timeout (default 15000)

TESTLINK_RETRIES

no

Retry attempts on transient network errors only (default 2)

TESTLINK_RETRY_DELAY_MS

no

Base backoff delay, doubled per attempt (default 500)

TESTLINK_API_KEY is a credential — keep it out of source control (.env is already git-ignored) and out of shared MCP configs where other users could read it.

Running standalone

npm run dev     # ts-node style, via tsx
# or
npm run build && npm start

The server speaks MCP over stdio — it has no meaningful output when run directly in a terminal; it's meant to be launched by an MCP host.

Claude Desktop configuration

Add a block like this to claude_desktop_config.json (Windows: %APPDATA%\Claude\claude_desktop_config.json; macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "testlink": {
      "command": "node",
      "args": ["C:/data/mcp-server/testlink/dist/index.js"],
      "env": {
        "TESTLINK_URL": "http://your-testlink-host/testlink/lib/api/xmlrpc/v1/xmlrpc.php",
        "TESTLINK_API_KEY": "your-devkey-here"
      }
    }
  }
}

Restart Claude Desktop after editing the config. Run npm run build first — the config points at the compiled dist/index.js, not the TypeScript source.

Tools exposed

Tool

TestLink API method

list_projects

tl.getProjects

create_project

tl.createTestProject

list_test_suites

tl.getFirstLevelTestSuitesForTestProject / tl.getTestSuitesForTestSuite

create_test_suite

tl.createTestSuite

update_test_suite

tl.updateTestSuite ⚠️

delete_test_suite

tl.deleteTestSuite ⚠️

read_test_case

tl.getTestCase

create_test_case

tl.createTestCase

update_test_case

tl.updateTestCase

delete_test_case

tl.deleteTestCase ⚠️

list_test_cases_in_suite

tl.getTestCasesForTestSuite

get_custom_field_value

tl.getTestCaseCustomFieldDesignValue

update_custom_field_value

tl.updateTestCase (customfields param)

list_custom_fields_for_project

best-effort probe, see caveat below ⚠️

list_requirements

tl.getRequirements

create_requirement_specification

tl.createRequirementSpecification

create_requirement

tl.createRequirement

assign_requirements

tl.assignRequirements

get_requirement

client-side filter over tl.getRequirements ⚠️

list_test_plans

tl.getProjectTestPlans

create_test_plan

tl.createTestPlan

add_test_case_to_test_plan

tl.addTestCaseToTestPlan

get_test_cases_for_test_plan

tl.getTestCasesForTestPlan

delete_test_plan

tl.deleteTestPlan ⚠️

create_build

tl.createBuild

list_builds

tl.getBuildsForTestPlan

close_build

tl.closeBuild ⚠️

create_test_execution

tl.reportTCResult

read_test_execution

tl.getLastExecutionResult

list_available_api_methods

system.listMethods (introspection)

Known API limitations (⚠️ above)

TestLink's official XML-RPC surface is oriented around CI reporting (create projects/suites/cases/plans/builds, report results) and historically has no stock endpoints for update/delete on test suites, test cases, or test plans, nor for closing a build or listing custom field definitions. This server implements those tools anyway, calling the conventionally-named method (tl.updateTestSuite, tl.deleteTestSuite, tl.deleteTestCase, tl.deleteTestPlan, tl.closeBuild), because some installations add them via patches or newer releases.

Before relying on any ⚠️-marked tool, call list_available_api_methods (wraps the standard XML-RPC system.listMethods introspection call) to confirm your TestLink server actually exposes it. If it doesn't, the call fails as a clear XML-RPC "unknown method" fault surfaced through this server's normal error path — not a silent no-op.

  • get_requirement: TestLink has no single-requirement lookup; this fetches the full project requirement list via tl.getRequirements and filters client-side by requirement id or doc id. Fine for small/medium requirement sets; not paginated.

  • list_custom_fields_for_project: TestLink's API can only read a named custom field's value on a specific test case — it cannot enumerate a project's custom field definitions. This tool takes a representative test case plus a list of candidate field names (visible in TestLink Admin → Custom Fields) and probes each one, returning only the fields that resolved to a non-empty value. It cannot discover field names you don't already supply.

Error handling

TestLink signals failures two ways, both normalized into a single TestLinkError:

  1. XML-RPC faults — transport-level errors (bad method, malformed params).

  2. In-band error payloads — TestLink often returns HTTP 200 with a body like [{code: 200, message: "..."}], or {status: false, message: "..."} for write operations. TestLinkClient inspects every response and throws TestLinkError for both cases, so callers never have to special-case a "successful" HTTP response that's actually a failure.

Every tool handler wraps its call in toToolResult(), so failures come back as an MCP tool result with isError: true and a JSON body {error: true, method, code, message} — never an uncaught exception that kills the server process.

Network-level errors (ECONNRESET, ETIMEDOUT, ECONNREFUSED, ENOTFOUND, EAI_AGAIN, EPIPE) are retried with exponential backoff up to TESTLINK_RETRIES times; logical TestLink API errors are never retried, since retrying a duplicate-name or bad-devKey error just repeats the same failure.

Tests

npm test

test/client.test.ts mocks the xmlrpc module entirely and covers: devKey injection, both TestLink in-band error shapes, the retry path on transient network errors, no-retry on logical errors, system.* calls skipping devKey, and the client-side requirement lookup's not-found path.

Security notes

  • TESTLINK_API_KEY grants full API access under whichever TestLink user issued it — treat it like any other credential.

  • If TESTLINK_URL is https://, the client uses xmlrpc.createSecureClient; prefer HTTPS whenever your TestLink instance supports it, since the XML-RPC API otherwise sends the devKey in plaintext.

  • All tool inputs are validated against explicit zod schemas before reaching the TestLink client — malformed input is rejected by the MCP layer rather than forwarded to the XML-RPC endpoint.

Available Tools

30 tools
add_test_case_to_test_planB

Add a specific test case version to a test plan, optionally for a platform (tl.addTestCaseToTestPlan).

Inputs: version (required), testPlanId (required), testProjectId (required), testCaseExternalId (required), +3 more.

assign_requirementsB

Link one or more requirements to a test case (tl.assignRequirements).

Inputs: assignments (required), testProjectId (required), testCaseExternalId (required).

close_buildA

Mark a build as closed/inactive. CAVEAT: TestLink's public API has no dedicated close-build endpoint on most installations — run the list_available_api_methods tool first to confirm your server exposes tl.closeBuild.

Inputs: buildId (required), testPlanId (required).

create_buildC

Create a new build under a test plan (tl.createBuild).

Inputs: buildName (required), testPlanId (required), buildNotes.

create_projectA

Create a new TestLink test project (tl.createTestProject).

Inputs: testcaseprefix (required), testprojectname (required), notes, active, +5 more.

create_requirementC

Create a requirement inside a requirement specification (tl.createRequirement).

Inputs: docId (required), title (required), userId (required), reqSpecId (required), +4 more.

create_requirement_specificationB

Create a requirement specification container, the parent grouping for requirements (tl.createRequirementSpecification).

Inputs: docId (required), title (required), userId (required), testProjectId (required), +3 more.

create_test_caseB

Create a new test case inside a test suite (tl.createTestCase).

Inputs: summary (required), authorLogin (required), testSuiteId (required), testCaseName (required), +8 more.

create_test_executionC

Report a test case execution result against a build within a test plan (tl.reportTCResult).

Inputs: status (required), testPlanId (required), bugId, guess, +9 more.

create_test_planB

Create a new test plan inside a project (tl.createTestPlan).

Inputs: testPlanName (required), testProjectName (required), notes, active, +1 more.

create_test_suiteB

Create a test suite inside a project, optionally nested under a parent suite (tl.createTestSuite).

Inputs: testProjectId (required), testSuiteName (required), order, details, +3 more.

delete_test_caseA

Delete a test case by internal id. CAVEAT: tl.deleteTestCase is not part of TestLink's stock public API on most installations — run the list_available_api_methods tool first to confirm your server exposes it.

Inputs: testCaseId (required).

delete_test_planA

Delete a test plan. CAVEAT: tl.deleteTestPlan is not part of TestLink's stock public API on most installations — run the list_available_api_methods tool first to confirm your server exposes it.

Inputs: testPlanId (required).

delete_test_suiteB

Delete a test suite. CAVEAT: tl.deleteTestSuite is not part of TestLink's stock public API on most installations — run the list_available_api_methods tool first to confirm your server exposes it.

Inputs: testSuiteId (required).

get_custom_field_valueA

Read a custom field's value for a specific test case version (tl.getTestCaseCustomFieldDesignValue).

Inputs: version (required), testProjectId (required), customFieldName (required), testCaseExternalId (required).

get_requirementA

Fetch a single requirement by requirement id or doc id. TestLink's API has no direct single-requirement lookup — this calls tl.getRequirements for the project and filters client-side.

Inputs: testProjectId (required), docId, requirementId.

get_test_cases_for_test_planB

List the test cases (with execution status) attached to a test plan (tl.getTestCasesForTestPlan).

Inputs: testPlanId (required), buildId, executed, keywordId, +4 more.

list_available_api_methodsA

List every XML-RPC method the connected TestLink server actually exposes (standard system.listMethods introspection). Use this to check whether non-standard methods relied on by update_test_suite, delete_test_suite, delete_test_case, delete_test_plan, and close_build are available before calling them — those are not part of every stock TestLink installation.

Inputs: no named parameters.

list_buildsA

List every build defined for a test plan (tl.getBuildsForTestPlan).

Inputs: testPlanId (required).

list_custom_fields_for_projectA

Best-effort custom field discovery. TestLink's XML-RPC API has NO endpoint to enumerate custom field definitions for a project — only to read a named field's value on a specific test case. Supply a representative test case plus a list of candidate field names (visible in TestLink Admin > Custom Fields) and this probes each one, returning only the fields that resolved to a non-empty value for that test case.

Inputs: version (required), testProjectId (required), testCaseExternalId (required), candidateFieldNames (required).

list_projectsA

List every TestLink test project visible to the authenticated API key (tl.getProjects).

Inputs: no named parameters.

list_requirementsA

List requirements for a project, optionally scoped to a test plan/platform/requirement specification (tl.getRequirements).

Inputs: testProjectId (required), reqSpecId, platformId, testPlanId.

list_test_cases_in_suiteB

List the test cases contained in a test suite (tl.getTestCasesForTestSuite).

Inputs: testSuiteId (required), deep, details.

list_test_plansB

List all test plans for a project (tl.getProjectTestPlans).

Inputs: testProjectId (required).

list_test_suitesA

List test suites: top-level suites for a project (tl.getFirstLevelTestSuitesForTestProject), or child suites of a given suite (tl.getTestSuitesForTestSuite) when parentSuiteId is supplied.

Inputs: testProjectId (required), parentSuiteId.

read_test_caseA

Fetch a test case by internal id, or by external id (+ optional version) (tl.getTestCase).

Inputs: version, testCaseId, testCaseExternalId.

read_test_executionB

Fetch the last execution result for a test case within a test plan/build/platform (tl.getLastExecutionResult).

Inputs: testPlanId (required), buildId, getBugs, buildName, +4 more.

update_custom_field_valueA

Write one or more custom field values on a test case (tl.updateTestCaseCustomFieldDesignValue). Requires the exact version and project id the field values belong to — TestLink stores custom field values per test case version, not just per external id.

Inputs: version (required), customFields (required), testProjectId (required), testCaseExternalId (required).

update_test_caseA

Update fields on an existing test case, identified by external id (tl.updateTestCase). To write custom field values, use update_custom_field_value instead — tl.updateTestCase has no custom field parameter of its own.

Inputs: testCaseExternalId (required), steps, summary, version, +4 more.

update_test_suiteA

Update an existing test suite's name, details, parent, or order. CAVEAT: tl.updateTestSuite is not part of TestLink's stock public API on most installations — run the list_available_api_methods tool first to confirm your server exposes it.

Inputs: testSuiteId (required), order, details, parentId, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 30 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action, such as list_projects vs create_project, read_test_case vs get_custom_field_value. Even similar tools like list_test_cases_in_suite and get_test_cases_for_test_plan are clearly differentiated by context (suite vs plan) and description.

    Naming Consistency4/5

    The naming pattern is predominantly verb_noun (list_, create_, update_, delete_, read_, get_). Minor inconsistency between read_ and get_ (e.g., read_test_case vs get_requirement) but the pattern is otherwise predictable and readable.

    Tool Count3/5

    With 30 tools, the server is on the heavier side, but the count is justified by the breadth of the TestLink domain (projects, suites, cases, requirements, plans, builds, executions). Still, it feels slightly over-scoped, especially with several caveat-ridden delete methods.

    Completeness4/5

    The tool set covers the main lifecycle for projects, test suites, test cases, test plans, builds, and executions. Minor gaps exist (e.g., no update_test_plan, no update_requirement, no delete_requirement), but they can be worked around and do not critically hinder core workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with TestRail test management systems through comprehensive API integration. Supports retrieving and updating test cases, projects, suites, runs, and results, plus adding attachments and managing test data through natural language commands.
      18
      31 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with Testmo test management platform for creating, reading, updating, and deleting test cases, managing folders, and organizing test runs through natural language.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact directly with TestRail instances for managing test projects, suites, cases, runs, results, plans, milestones, and attachments through the TestRail API with secure authentication.
      77
      55 npm
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with TestRail test management system, supporting full CRUD operations on projects, suites, sections, test cases, runs, results, plans, and milestones.
      35
      327 npm
      1
      MIT