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

api-tester-liqi

v1.0.0

Published

MCP Server for API testing with health checks, database validation, and Postman integration

Readme

@liqi_511/api-tester

基于 Model Context Protocol (MCP) 的 API 测试工具,支持连通性检查、数据库验证和 Postman 集成。

特性

  • 🚀 开箱即用 - 零配置启动
  • 🔧 高度可配置 - 支持多服务配置
  • 📮 Postman 集成 - 自动导入请求历史
  • 🗄️ 数据库验证 - 直连数据库验证数据
  • 批量测试 - 一键运行测试用例
  • 🧪 Newman 支持 - CLI 自动化测试

安装

npm install -g @liqi_511/api-tester

快速入门

👉 新手入门指南 - 5分钟快速上手

文档目录

| 文档 | 说明 | |------|------| | 新手入门 | 快速上手指南 | | API 参考 | 所有 MCP 工具详细参数 | | 开发指南 | 开发贡献指南 |

快速开始

1. 配置你的服务

创建 config/services.json

{
  "my-service": {
    "name": "my-service",
    "host": "localhost",
    "port": 3000,
    "baseUrl": "http://localhost:3000",
    "db": {
      "host": "localhost",
      "port": 3306,
      "user": "root",
      "password": "your_password",
      "database": "your_db",
      "dialect": "mysql"
    }
  }
}

2. 设置环境变量(可选)

# Postman API Key(用于自动导入)
export POSTMAN_API_KEY="your-postman-api-key"

# 自定义配置路径
export SERVICES_CONFIG_PATH="./my-services.json"

3. 启动 MCP Server

api-tester

或在 Claude Code 中配置 settings.json

{
  "mcpServers": {
    "api-tester": {
      "command": "api-tester"
    }
  }
}

MCP 工具

| 工具 | 描述 | Postman | |------|------|---------| | http_request | 发送 HTTP 请求 | autoImportPostman | | health_check | 检查服务连通性 | - | | run_api_test | 执行批量测试用例 | ✓ | | db_query | 查询/验证数据库 | - | | assert_response | 断言响应 | - | | run_with_newman | Newman CLI 运行 | - |

使用示例

http_request

{
  "tool": "http_request",
  "service": "my-service",
  "method": "POST",
  "path": "/api/users",
  "body": { "name": "test", "age": 20 },
  "autoImportPostman": true
}

run_api_test

{
  "tool": "run_api_test",
  "service": "my-service",
  "testCases": [
    { "name": "获取列表", "method": "GET", "path": "/api/users", "expected": { "errno": 0 } },
    { "name": "创建用户", "method": "POST", "path": "/api/users", "body": { "name": "test" }, "expected": { "errno": 0 } }
  ]
}

db_query

{
  "tool": "db_query",
  "service": "my-service",
  "table": "users",
  "operation": "select",
  "where": { "id": 1 }
}

CLI 选项

api-tester --help     # 显示帮助
api-tester --list      # 列出已配置的服务
api-tester --config ./my-config.json  # 指定配置文件

项目结构

@liqi_511/api-tester/
├── bin/
│   └── mcp-api-tester.js     # CLI 入口
├── lib/
│   ├── index.js              # 主入口
│   ├── config/
│   │   └── services.js       # 配置加载器
│   └── tools/
│       ├── http.js           # HTTP 请求
│       ├── health.js         # 健康检查
│       ├── test.js           # 批量测试
│       ├── db.js             # 数据库
│       ├── assert.js         # 断言
│       ├── newman.js         # Newman
│       └── postman-api.js    # Postman API
├── config/
│   ├── services.json         # 默认配置
│   └── services.example.json # 示例配置
└── README.md

发布到 npm

# 登录 npm
npm login

# 发布
npm publish

# 发布 beta 版本
npm publish --tag beta

License

MIT