Servidor Mcp do Postman
MCP Server para executar Coleções Postman com Newman
Visão geral
O que é o MCP Postman?
O MCP Postman é um servidor projetado para executar coleções do Postman usando o Newman, que é um executor de coleções via linha de comando para o Postman. Esta ferramenta permite que os desenvolvedores automatizem seus fluxos de trabalho de teste de API, executando coleções diretamente da linha de comando, facilitando a integração em pipelines de CI/CD.
Recursos do MCP Postman
- Integração Sem Costura: Integra-se facilmente com coleções existentes do Postman, permitindo uma configuração e execução rápidas.
- Interface de Linha de Comando: Utiliza o Newman para executar coleções, proporcionando um CLI poderoso para automação.
- Relatórios Personalizáveis: Gera relatórios detalhados dos resultados dos testes, ajudando os desenvolvedores a identificar rapidamente problemas.
- Suporte a Múltiplos Ambientes: Suporta vários ambientes, permitindo cenários de teste flexíveis.
- Repositório Público: Disponível no GitHub, permitindo colaboração e contribuições da comunidade.
Como Usar o MCP Postman
-
Instalação: Primeiro, certifique-se de que você tem o Node.js instalado em sua máquina. Em seguida, instale o Newman globalmente usando npm:
npm install -g newman -
Clone o Repositório: Clone o repositório do MCP Postman do GitHub:
git clone https://github.com/shannonlal/mcp-postman.git -
Execute Coleções: Navegue até o diretório clonado e execute sua coleção do Postman usando o Newman:
newman run sua-colecao.json -
Veja os Relatórios: Após executar a coleção, visualize os relatórios gerados para analisar os resultados.
Perguntas Frequentes
O que é o Newman?
O Newman é uma ferramenta de linha de comando que permite executar coleções do Postman diretamente do terminal. É essencial para automatizar testes de API e integrá-los em pipelines de CI/CD.
Posso usar o MCP Postman para testes automatizados?
Sim, o MCP Postman é especificamente projetado para testes automatizados de APIs usando coleções do Postman, tornando-o ideal para fluxos de trabalho de integração e implantação contínuas.
O MCP Postman é um projeto de código aberto?
Sim, o MCP Postman é um projeto de código aberto hospedado no GitHub, permitindo que os desenvolvedores contribuam e melhorem a ferramenta.
Como posso contribuir para o MCP Postman?
Você pode contribuir fazendo um fork do repositório, fazendo suas alterações e enviando um pull request no GitHub. Certifique-se de seguir as diretrizes de contribuição fornecidas no repositório.
Onde posso encontrar mais informações sobre o MCP Postman?
Para mais informações, você pode visitar o repositório do MCP Postman no GitHub, onde você pode encontrar documentação, problemas e discussões da comunidade.
Detalhe
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
Configuração do Servidor
{
"mcpServers": {
"mcp-postman": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--shannonlal--mcp-postman--mcp-postman",
"node ./build/index.js"
],
"env": {}
}
}
}