Skip to content

Conversation

@codegen-sh
Copy link

@codegen-sh codegen-sh bot commented Nov 16, 2025

🐛 Problem

The MCP setup script was failing with a "Terminated" error during the Playwright installation verification step. The script used which playwright to verify installation, but playwright is not a standalone command—it's invoked via npx @playwright/mcp.

✅ Solution

This PR replaces the failing verification logic with proper npm package checks and adds comprehensive tooling for MCP setup.

Changes Made

1. Fixed Setup Script (scripts/setup_mcp_fixed.sh)

  • ✅ Replaced which playwright with npm list -g @playwright/mcp --depth=0
  • ✅ Replaced which context7-mcp with npm list -g @upstash/context7-mcp --depth=0
  • ✅ Added color-coded output for better readability
  • ✅ Improved error handling and user feedback
  • ✅ Generates configuration files automatically

2. Verification Script (scripts/verify_mcp_setup.sh)

  • 🧪 Comprehensive testing of all three MCP servers
  • 🧪 Tests Node.js environment (node, npm, npx)
  • 🧪 Verifies Playwright MCP package and Chromium installation
  • 🧪 Verifies Context7 MCP package
  • 🧪 Verifies Codegen MCP server files
  • 🧪 Provides detailed pass/fail/warning reports

3. MCP Configuration Template (config/mcp.json.template)

  • 📋 Ready-to-use configuration with correct invocation commands
  • 📋 Works with Claude Desktop, Cline, and other MCP clients
  • 📋 Includes all three MCP servers (Codegen, Playwright, Context7)

4. Complete Documentation (docs/MCP_SETUP.md)

  • 📚 Step-by-step setup instructions
  • 📚 Troubleshooting guide for common issues
  • 📚 Configuration examples for different MCP clients
  • 📚 Testing and verification procedures

🧪 Testing

Run the verification script to test your MCP setup:

chmod +x scripts/verify_mcp_setup.sh
./scripts/verify_mcp_setup.sh

Expected output:

=== MCP Setup Verification ===

Testing Node.js Environment
----------------------------
✓ Node.js installed (v20.x.x)
✓ npm installed (10.x.x)
✓ npx available

Testing Playwright MCP
----------------------
✓ Playwright MCP package installed (x.x.x)
✓ Playwright MCP executable works
✓ Chromium browser installed

...
✓ All tests passed! Your MCP setup is ready to use.

📦 Files Added/Modified

  • scripts/setup_mcp_fixed.sh - Fixed setup script (replaces original)
  • scripts/verify_mcp_setup.sh - New verification tool
  • config/mcp.json.template - Ready-to-use MCP configuration
  • docs/MCP_SETUP.md - Complete setup and troubleshooting guide

🔧 How to Use

  1. Run the fixed setup script:

    ./scripts/setup_mcp_fixed.sh
  2. Verify installation:

    ./scripts/verify_mcp_setup.sh
  3. Copy configuration to your MCP client:

    cp config/mcp.json.template ~/.config/Claude/mcp.json
  4. Restart your MCP client

📖 Documentation

See docs/MCP_SETUP.md for:

  • Complete setup instructions
  • Troubleshooting common issues
  • Configuration for different MCP clients
  • Testing procedures

✨ Benefits

  • ✅ No more "Terminated" errors during setup
  • ✅ Proper verification of all MCP servers
  • ✅ Clear success/failure feedback
  • ✅ Ready-to-use configuration templates
  • ✅ Comprehensive documentation
  • ✅ Easy troubleshooting with verification script

Fixes the issue where which playwright causes script termination because Playwright MCP is not a standalone binary but is invoked via npx @playwright/mcp.


💻 View my work • 👤 Initiated by @ZeeeepaAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks


Summary by cubic

Fixes the MCP setup crash caused by using which playwright by switching to npm-based checks, and adds tools to verify and configure MCP servers. This removes the "Terminated" error and makes setup reliable for Playwright, Context7, and Codegen.

  • Bug Fixes

    • Replaced which playwright/context7-mcp with npm list -g checks.
    • Improved error handling and clear output during setup.
  • New Features

    • scripts/verify_mcp_setup.sh: Verifies Node/npm/npx, Playwright MCP (incl. Chromium), Context7 MCP, and Codegen server files.
    • config/mcp.json.template: Correct commands for npx-based servers and Codegen path.
    • docs/MCP_SETUP.md: Step-by-step setup, troubleshooting, and client config examples.

Written for commit 6ba8440. Summary will update automatically on new commits.

- Replace 'which playwright' with proper npm package verification
- Replace 'which context7-mcp' with npm list check
- Add comprehensive verification script for all MCP servers
- Create mcp.json.template with correct server configurations
- Add detailed MCP_SETUP.md documentation
- Improve error handling and user feedback
- Add color-coded output for better readability

Fixes 'Terminated' error that occurs during setup when verification
commands fail. The issue was that 'playwright' is not a standalone
command but is invoked via 'npx @playwright/mcp'.

Files added:
- scripts/setup_mcp_fixed.sh: Fixed setup script
- scripts/verify_mcp_setup.sh: Comprehensive verification tool
- config/mcp.json.template: Ready-to-use configuration
- docs/MCP_SETUP.md: Complete setup and troubleshooting guide

Co-authored-by: Zeeeepa <[email protected]>
@korbit-ai
Copy link

korbit-ai bot commented Nov 16, 2025

By default, I don't review pull requests opened by bots. If you would like me to review this pull request anyway, you can request a review via the /korbit-review command in a comment.

@coderabbitai
Copy link

coderabbitai bot commented Nov 16, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@korbit-ai
Copy link

korbit-ai bot commented Nov 16, 2025

I was unable to write a description for this pull request. This could be because I only found files I can't scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant