Skip to main content
Glama
lucad87

MCP Server - Test Migration (WDIO to Playwright)

by lucad87

migrate_config

Convert WebDriverIO configuration files to Playwright format while preserving existing settings for test automation migration.

Instructions

Migrates wdio.conf.js to playwright.config.ts. Preserves existing Playwright config if present.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wdioConfigYesContent of wdio.conf.js file
existingPlaywrightConfigNoOptional existing playwright.config.ts content to merge with

Implementation Reference

  • The main handler function `handleMigrateConfig` which parses WDIO config and generates or merges into a Playwright config.
    export async function handleMigrateConfig(args) {
      const { wdioConfig, existingPlaywrightConfig } = args;
    
      const wdioSettings = parseWdioConfig(wdioConfig);
    
      let playwrightConfig;
      if (existingPlaywrightConfig) {
        playwrightConfig = mergePlaywrightConfig(existingPlaywrightConfig, wdioSettings);
      } else {
        playwrightConfig = generatePlaywrightConfig(wdioSettings);
      }
    
      return {
        content: [{
          type: 'text',
          text: `# Playwright Configuration Migration
    
    ## Original WDIO Settings Detected:
    ${JSON.stringify(wdioSettings, null, 2)}
    
    ## Generated playwright.config.ts:
    
    \`\`\`typescript
    ${playwrightConfig}
    \`\`\`
    
    ## Migration Notes:
    1. Review baseURL and adjust if needed
    2. Update testDir to point to your migrated tests
    3. The testIdAttribute is set to 'data-test-id' by default
    4. Adjust browser projects based on your needs
    5. Configure webServer if running local dev server
    
    ## Next Steps:
    1. Save as \`playwright.config.ts\` in project root
    2. Install Playwright: \`npm install -D @playwright/test\`
    3. Install browsers: \`npx playwright install\`
    4. Run tests: \`npx playwright test\`
    `,
        }],
      };
  • Tool definition and input schema for `migrate_config`.
    name: 'migrate_config',
    description: 'Migrates wdio.conf.js to playwright.config.ts. Preserves existing Playwright config if present.',
    inputSchema: {
      type: 'object',
      properties: {
        wdioConfig: {
          type: 'string',
          description: 'Content of wdio.conf.js file',
        },
        existingPlaywrightConfig: {
          type: 'string',
          description: 'Optional existing playwright.config.ts content to merge with',
        },
      },
      required: ['wdioConfig'],
    },
  • src/server.js:100-100 (registration)
    Registration of the `migrate_config` tool in the server.
    'migrate_config': handleMigrateConfig,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full behavioral burden. It successfully discloses the merge/preservation behavior for existing Playwright configs. However, it omits critical safety context: whether this performs a disk write or returns content, error handling for invalid WDIO configs, and whether the operation is destructive or reversible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely efficient at two sentences. The first sentence front-loads the core action, and the second adds a crucial behavioral qualifier. Zero redundant words or tautologies; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a two-parameter tool, covering the core transformation and merge logic. However, given the lack of output schema and annotations, the description should ideally indicate the return format (generated config content) and clarify side effects (disk vs memory operation). As-is, it leaves operational ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description mentions preservation behavior which maps to the existingPlaywrightConfig parameter, but this largely restates the schema's 'to merge with' semantics. No additional parameter constraints, format details, or syntax guidance is provided beyond the structured schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific transformation (wdio.conf.js → playwright.config.ts) using a concrete verb ('migrates'). It distinguishes from siblings like 'migrate_to_playwright' by specifying this is config-file-only migration, though it could more explicitly clarify the relationship to the broader migration tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to select this tool versus 'migrate_to_playwright' or other siblings. While the config-specific scope implies usage context, there is no 'when to use' or 'when not to use' instruction to help the agent decide between configuration migration versus full test migration.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/lucad87/mcp-server-tests-migration'

If you have feedback or need assistance with the MCP directory API, please join our Discord server