Postman MCP Server
An MCP (Model Context Protocol) server that enables running Postman collections using Newman. This server allows LLMs to execute API tests and get detailed results through a standardized interface.
Features
- Run Postman collections using Newman
- Support for environment files
- Support for global variables
- Detailed test results including:
- Overall success/failure status
- Test summary (total, passed, failed)
- Detailed failure information
- Execution timings
Installation
Installing via Smithery
To install Postman Runner for Claude Desktop automatically via Smithery:
1npx -y @smithery/cli install mcp-postman --client claude
Manual Installation
1# Clone the repository 2git clone <repository-url> 3cd mcp-postman 4 5# Install dependencies 6pnpm install 7 8# Build the project 9pnpm build
Usage
Configuration
Add the server to your Claude desktop configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json
:
1{ 2 "mcpServers": { 3 "postman-runner": { 4 "command": "node", 5 "args": ["/absolute/path/to/mcp-postman/build/index.js"] 6 } 7 } 8}
Available Tools
run-collection
Runs a Postman collection and returns the test results.
Parameters:
collection
(required): Path or URL to the Postman collectionenvironment
(optional): Path or URL to environment fileglobals
(optional): Path or URL to globals fileiterationCount
(optional): Number of iterations to run
Example Response:
1{ 2 "success": true, 3 "summary": { 4 "total": 5, 5 "failed": 0, 6 "passed": 5 7 }, 8 "failures": [], 9 "timings": { 10 "started": "2024-03-14T10:00:00.000Z", 11 "completed": "2024-03-14T10:00:01.000Z", 12 "duration": 1000 13 } 14}
Example Usage in Claude
You can use the server in Claude by asking it to run a Postman collection:
"Run the Postman collection at /path/to/collection.json and tell me if all tests passed"
Claude will:
- Use the run-collection tool
- Analyze the test results
- Provide a human-friendly summary of the execution
Development
Project Structure
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
Running Tests
1# Run tests 2pnpm test 3 4# Run tests with coverage 5pnpm test:coverage
Building
1# Build the project 2pnpm build 3 4# Clean build artifacts 5pnpm clean
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
ISC