About API Tester
API Tester is an MCP server in the Commerce category: 一键测试任意 API,自动生成 TypeScript 类型定义! 还在手动调用接口、复制响应、再粘贴到 quicktype.io 生成类型? 现在,只需在 Cursor 或 Claude 中输入一条指令,即可: ✅ 发送 GET/POST/PUT 等任意 HTTP 请求 ✅ 查看实时响应状态与数据预览 ✅ 自动将返回的 JSON 转换为精准的 TypeScript 接口 ✅ 支持自定义 Headers、请求体和期望状态码.
Install
git clone https://github.com/xingonliu/api-testerThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about API Tester
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
MCP API Tester Server
这是一个基于 Model Context Protocol (MCP) 的 API 测试工具服务器。它可以测试任意 HTTP API 并自动生成 TypeScript 类型定义。
安装
全局安装
npm install -g mcp-api-tester
本地安装
npm install mcp-api-tester
从源码安装
git clone https://github.com/xingonliu/api-tester
cd mcp-api-tester
npm install
npm run build
使用方法
作为 npm 包使用
安装后,你可以通过以下方式运行:
# 全局安装后
mcp-api-tester
# 或者使用 npx
npx mcp-api-tester
# 本地安装后
npx mcp-api-tester
开发模式
1. HTTP模式
npm run dev
服务器将在 http://localhost:3000/mcp 运行
2. stdio模式(MCP标准方式)
npm run dev:stdio
3. 构建生产版本
npm run build
node dist/stdio-server.js
MCP客户端配置
要连接到这个服务器,在MCP客户端配置中添加:
全局安装后
{
"mcpServers": {
"api-tester": {
"command": "mcp-api-tester"
}
}
}
本地安装或直接使用
{
"mcpServers": {
"api-tester": {
"command": "node",
"args": ["path/to/dist/stdio-server.js"]
}
}
}
使用 npx
{
"mcpServers": {
"api-tester": {
"command": "npx",
"args": ["mcp-api-tester"]
}
}
}
工具功能
apiTester 工具
- 功能: 测试任意HTTP API并生成TypeScript类型定义
- 输入: URL、HTTP方法、请求头、请求体等
- 输出: API响应数据和自动生成的TypeScript接口
文件结构
├── src/
│ ├── index.ts # HTTP服务器版本
│ ├── stdio-server.ts # stdio服务器版本(MCP标准)
│ ├── tools/
│ │ └── apiTester.ts # API测试工具实现
│ └── utils/
│ └── quicktypeGen.ts # TypeScript类型生成工具
├── dist/ # 编译后的JavaScript文件
└── mcp-config.json # MCP客户端配置示例
现在你的MCP服务器应该可以正常工作了!🎉
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.