这是一个 MCP(Model Context Protocol)服务器,它通过 Newman 运行 Postman 集合。此服务器允许 LLMs 通过标准化接口执行 API 测试并获取详细结果。
要通过 Smithery 自动安装 Claude 桌面版的 Postman Runner:
npx -y @smithery/cli install mcp-postman --client claude
# Clone the repository
git clone <repository-url>
cd mcp-postman
# Install dependencies
pnpm install
# Build the project
pnpm build

将服务器添加到你的 Claude 桌面配置文件 ~/Library/Application Support/Claude/claude_desktop_config.json
中:
{
"mcpServers": {
"postman-runner": {
"command": "node",
"args": ["/absolute/path/to/mcp-postman/build/index.js"]
}
}
}

运行一个 Postman 集合并返回测试结果。
参数:
collection
(必需): Postman 集合的路径或 URLenvironment
(可选): 环境文件的路径或 URLglobals
(可选): 全局变量文件的路径或 URLiterationCount
(可选): 要运行的迭代次数示例响应:
{
"success": true,
"summary": {
"total": 5,
"failed": 0,
"passed": 5
},
"failures": [],
"timings": {
"started": "2024-03-14T10:00:00.000Z",
"completed": "2024-03-14T10:00:01.000Z",
"duration": 1000
}
}

你可以通过让 Claude 运行一个 Postman 集合来使用该服务器:
"运行位于 /path/to/collection.json 的 Postman 集合并告诉我所有测试是否通过"
Claude 将会:
src/ ├── index.ts # Entry point ├── server/ │ ├── server.ts # MCP Server implementation │ └── types.ts # Type definitions └── newman/ └── runner.ts # Newman runner implementation test/ ├── server.test.ts # Server tests ├── newman-runner.test.ts # Runner tests └── fixtures/ # Test fixtures └── sample-collection.json
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage

# Build the project
pnpm build
# Clean build artifacts
pnpm clean

git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)ISC