Postman Mcp Server
MCP Server per eseguire Collezioni Postman con Newman
Panoramica
Cos'è MCP Postman?
MCP Postman è un server progettato per eseguire collezioni Postman utilizzando Newman, che è un esecutore di collezioni da riga di comando per Postman. Questo strumento consente agli sviluppatori di automatizzare i loro flussi di lavoro di test API eseguendo collezioni direttamente dalla riga di comando, facilitando l'integrazione nelle pipeline CI/CD.
Caratteristiche di MCP Postman
- Integrazione senza soluzione di continuità: Si integra facilmente con le collezioni Postman esistenti, consentendo una rapida configurazione ed esecuzione.
- Interfaccia a riga di comando: Utilizza Newman per eseguire le collezioni, fornendo un potente CLI per l'automazione.
- Report personalizzabili: Genera report dettagliati dei risultati dei test, aiutando gli sviluppatori a identificare rapidamente i problemi.
- Supporto per ambienti: Supporta più ambienti, consentendo scenari di test flessibili.
- Repository pubblico: Disponibile su GitHub, consente collaborazione e contributi dalla comunità.
Come utilizzare MCP Postman
-
Installazione: Prima di tutto, assicurati di avere Node.js installato sulla tua macchina. Quindi, installa Newman globalmente utilizzando npm:
npm install -g newman -
Clona il Repository: Clona il repository MCP Postman da GitHub:
git clone https://github.com/shannonlal/mcp-postman.git -
Esegui Collezioni: Naviga nella directory clonata ed esegui la tua collezione Postman utilizzando Newman:
newman run your-collection.json -
Visualizza Report: Dopo aver eseguito la collezione, visualizza i report generati per analizzare i risultati.
Domande Frequenti
Cos'è Newman?
Newman è uno strumento da riga di comando che consente di eseguire collezioni Postman direttamente dal terminale. È essenziale per automatizzare i test API e integrarli nelle pipeline CI/CD.
Posso utilizzare MCP Postman per test automatizzati?
Sì, MCP Postman è specificamente progettato per il test automatizzato delle API utilizzando collezioni Postman, rendendolo ideale per flussi di lavoro di integrazione e distribuzione continua.
MCP Postman è open-source?
Sì, MCP Postman è un progetto open-source ospitato su GitHub, che consente agli sviluppatori di contribuire e migliorare lo strumento.
Come posso contribuire a MCP Postman?
Puoi contribuire forking il repository, apportando le tue modifiche e inviando una pull request su GitHub. Assicurati di seguire le linee guida per i contributi fornite nel repository.
Dove posso trovare ulteriori informazioni su MCP Postman?
Per ulteriori informazioni, puoi visitare il repository GitHub di MCP Postman dove puoi trovare documentazione, problemi e discussioni della comunità.
Dettaglio
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.
<a href="https://glama.ai/mcp/servers/qfx34b2s2v"><img width="380" height="200" src="https://glama.ai/mcp/servers/qfx34b2s2v/badge" alt="Postman Server MCP server" /></a>
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:
npx -y @smithery/cli install mcp-postman --client claude
Manual Installation
### Clone the repository
git clone <repository-url>
cd mcp-postman
### Install dependencies
pnpm install
### Build the project
pnpm build
Usage
Configuration
Add the server to your Claude desktop configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"postman-runner": {
"command": "node",
"args": ["/absolute/path/to/mcp-postman/build/index.js"]
}
}
}
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:
{
"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
}
}
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
### Run tests
pnpm test
### Run tests with coverage
pnpm test:coverage
Building
### Build the project
pnpm build
### Clean build artifacts
pnpm 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
Configurazione Server
{
"mcpServers": {
"mcp-postman": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--shannonlal--mcp-postman--mcp-postman",
"node ./build/index.js"
],
"env": {}
}
}
}