npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

smarttest-mcp

v1.1.2

Published

Local MCP Server for automated testing (SmartTest) - Works with Gemini API & Local CLIs

Readme

SmartTest Local MCP

🚀 ระบบทดสอบอัตโนมัติที่ทำงาน offline - เลียนแบบ TestSprite MCP แต่ใช้ Gemini API และทำงานได้โดยไม่ต้องจ่ายเงิน

npm version License

✨ คุณสมบัติ

  • ทำงาน Offline - ไม่ต้องเชื่อมต่อ TestSprite cloud
  • 9 MCP Tools - เพิ่มฟีเจอร์ Auto-fix และ Coverage Analysis
  • Zero API Key - รองรับการใช้ gemini และ claude CLI ในเครื่อง (ไม่ต้องมี API Key!)
  • Gemini AI SDK - รองรับ Google Generative AI ผ่าน API Key สำหรับการประมวลผลความเร็วสูง
  • รองรับ Multi-language - สร้างไฟล์ทดสอบตามภาษาจริงของโปรเจกต์ (e.g., .test.js, .py, .go, .java, .rs)
  • รองรับทุกประเภท - Frontend, Backend, Fullstack
  • MIT License - ใช้งานได้ฟรี

📦 การติดตั้ง

คุณสามารถเลือกใช้งานได้ 2 แบบ:

1. ใช้งานทันทีผ่าน npx (แนะนำ)

ไม่ต้องติดตั้งลงเครื่อง เรียกใช้ได้เลย:

npx smarttest-mcp

2. ติดตั้งลงเครื่อง (Global Install)

ถ้าต้องการใช้บ่อยๆ หรืออยากใช้คำสั่งสั้นๆ smarttest:

npm install -g smarttest-mcp

🔑 การตั้งค่า

1. โหมดไม่ต้องใช้ API Key (Zero API Key Mode) 🆕

หากคุณมีการติดตั้ง gemini หรือ claude CLI ในระบบและล็อกอินไว้แล้ว SmartTest จะสลับไปใช้งาน CLI เหล่านั้นโดยอัตโนมัติหากไม่พบ GEMINI_API_KEY:

# ตรวจสอบว่ามี CLI หรือไม่
gemini "hello"
# ถ้าใช้งานได้ SmartTest จะใช้ตัวนี้ทันที

2. โหมดใช้ Gemini API Key (ความเร็วสูง)

  1. ไปที่ Google AI Studio
  2. สร้าง API Key ฟรี
  3. ตั้งค่า environment variable:
# Linux/Mac
export GEMINI_API_KEY=your-api-key-here

# Windows
set GEMINI_API_KEY=your-api-key-here

2. การเชื่อมต่อกับ Clients (Config)

🤖 Claude Desktop / CLI

แก้ไขไฟล์ config ที่:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "smarttest": {
      "command": "npx",
      "args": ["-y", "smarttest-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

💎 Gemini CLI / General MCP Clients

หากใช้ Gemini CLI หรือ Tools อื่นๆ ที่รองรับ MCP ให้เพิ่ม config ดังนี้:

{
  "mcpServers": {
    "smarttest": {
      "command": "npx",
      "args": ["-y", "smarttest-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

📝 Cursor / VSCode

เพิ่มใน MCP settings ของ Editor:

{
  "mcpServers": {
    "SmartTestLocal": {
      "command": "npx",
      "args": ["-y", "smarttest-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

🛠️ MCP Tools (9 Tools)

| Tool | คำอธิบาย | |------|-----------| | smarttest_bootstrap | เริ่มต้นระบบ สร้าง config file | | smarttest_generate_code_summary | วิเคราะห์และสรุปโครงสร้าง codebase | | smarttest_generate_standardized_prd | สร้าง PRD มาตรฐาน | | smarttest_generate_frontend_test_plan | สร้างแผนทดสอบ Frontend | | smarttest_generate_backend_test_plan | สร้างแผนทดสอบ Backend | | smarttest_generate_code_and_execute | สร้างโค้ดทดสอบและรัน (รองรับหลายภาษา) | | smarttest_rerun_tests | รัน test ซ้ำ | | smarttest_analyze_and_fix | 🆕 วิเคราะห์ Error และแนะนำวิธีแก้ (Auto-fix) | | smarttest_analyze_coverage | 🆕 วิเคราะห์ Test Coverage และแนะนำ test เพิ่ม |

📋 การใช้งาน

Workflow แนะนำ

1. smarttest_bootstrap
   ↓
2. smarttest_generate_code_summary
   ↓
3. smarttest_generate_standardized_prd
   ↓
4. smarttest_generate_frontend/backend_test_plan
   ↓
5. smarttest_generate_code_and_execute
   ↓
6. (หาก Fail) smarttest_analyze_and_fix
   ↓
7. (ตรวจสอบคุณภาพ) smarttest_analyze_coverage

ตัวอย่างการใช้งานใน Cursor

คุณ: ช่วยทดสอบโปรเจกต์นี้ด้วย SmartTest Local

Cursor: รับทราบครับ ผมจะเริ่มด้วยการ bootstrap โปรเจกต์...

[ใช้ tool: smarttest_bootstrap]
✅ Bootstrapped successfully

[ใช้ tool: smarttest_generate_code_summary]
✅ Code summary generated

[ใช้ tool: smarttest_generate_standardized_prd]
✅ PRD generated

[ใช้ tool: smarttest_generate_frontend_test_plan]
✅ Generated 15 frontend test cases

[ใช้ tool: smarttest_generate_code_and_execute]
✅ Generated 15 test files in .smarttest/generated_tests/

📁 โครงสร้างไฟล์ที่สร้าง

your-project/
├── .smarttest/
│   ├── config.json              # Config ของ project
│   ├── code_summary.json        # สรุปโครงสร้างโค้ด
│   ├── standard_prd.json        # PRD มาตรฐาน
│   ├── frontend_test_plan.json  # แผนทดสอบ Frontend
│   ├── backend_test_plan.json   # แผนทดสอบ Backend
│   ├── test_report.json         # รายงานผลการทดสอบ
│   └── generated_tests/         # โค้ดทดสอบที่สร้าง
│       ├── TC001.test.js
│       ├── TC002.test.js
│       └── ...
└── prd_files/                   # ไฟล์ PRD ดิบ (ถ้ามี)
    └── ...

🆚 ความแตกต่างจาก TestSprite

| รายการ | TestSprite | SmartTest Local | |---------|------------|------------------| | API Key | ต้องจ่ายเงิน | ใช้ Gemini API ฟรี | | Cloud Execution | ต้องเชื่อมต่อ cloud | ทำงาน offline | | License | BUSL-1.1 | MIT | | Test Runner | รันใน cloud | รันในเครื่อง | | AI Model | ไม่ระบุ | Gemini 1.5 Flash |

🚀 CLI Commands

สามารถใช้ npx smarttest-mcp แทน smarttest ได้ทุกคำสั่ง:

# ตรวจสอบ environment
smarttest init
# หรือ
npx smarttest-mcp init

# ตรวจสอบ project
smarttest validate /path/to/project
# หรือ
npx smarttest-mcp validate /path/to/project

# รัน MCP server (default)
smarttest
# หรือ
npx smarttest-mcp

🛠️ Development

# Clone repo
git clone https://github.com/your-repo/smarttest-mcp
cd smarttest-mcp

# Install dependencies
npm install

# Build
npm run build

# Run
npm start

📝 License

MIT License - ใช้งานได้ฟรีทั้งการใช้ส่วนตัวและเชิงพาณิชย์

🤝 มีส่วนร่วม

ยินดีรับ PR และ Issue ทุกชนิด!

⚠️ ข้อจำกัด

  • หากไม่ใช้ API Key ต้องมี Gemini/Claude CLI ติดตั้งในเครื่อง
  • ประสิทธิภาพในโหมด CLI อาจขึ้นอยู่กับความเร็วของการเรียก shell command
  • ขึ้นอยู่กับ quota ของ Gemini API (ถ้าใช้ API Key)
  • Test code ที่สร้างอาจต้องแก้ไขเล็กน้อยก่อนรัน

📞 ติดต่อ


⭐ ถ้าชอบ project นี้ อย่าลืมให้ดาว!