포스트

Postman 없이 newman으로만 API 테스트 자동화하기 - MCP

  • collection.json (API 테스트 정의)
  • environment.json (환경 변수, 선택)
1
2
newman run collection.json -e environment.json

Postman은 그냥 collection.json을 만들기 위한 편집기일 뿐입니다.

collection.json은 Postman을 쓰지 않고도

직접 작성하거나, 스크립트로 만들거나, Swagger에서 변환해서 만들수도 있습니다.

예를 들어, 아래처럼 바로 작성 가능합니다.

1
2
3
4
5
6
7
8
9
10
11
12
{
  "info": { "name": "My API Test", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" },
  "item": [{
    "name": "GET example",
    "request": { "method": "GET", "url": "https://api.example.com/hello" },
    "event": [{
      "listen": "test",
      "script": { "exec": ["pm.test(\"Status code is 200\", () => pm.response.to.have.status(200));"] }
    }]
  }]
}

그래서 Postman 없이도 바로 newman으로 실행할 수 있습니다.


  • collection.json을 리포지토리에 관리
  • newman으로 테스트를 실행.

만약 CI/CD에서 Postman collection을 llm agent를 사용해 자동으로 만들고 관리하고 테스트하고 싶다면,

GitHub - shannonlal/mcp-postman: MCP Server for running Postman Collections with Newman MCP Server for running Postman Collections with Newman - shannonlal/mcp-postman MCP Server for running Postman Collections with Newman - shannonlal/mcp-postman

으로 newman 테스트를 자동화할 수 있습니다.

Claude나 Cursor에 다음과 같이 설치합니다.

1
2
3
4
5
6
7
8
{
  "mcpServers": {
    "postman-runner": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-postman/build/index.js"]
    }
  }
}

sticker

#postman, #포스트맨, #api, #자동화, #mcp

+추가) newman, postman써보고 더 편한 것 없나 찾다가, 더 편한 걸 찾았습니다! ㅋㅋ https://blog.naver.com/devramyun/223823334344

[20250405] [vscode][backend][Rest-client]엄청 편한 개발용 Rest API 테스트용 vscode-extension 이제 extensions.json에 하나 더 추가하세요~강추 .http 파일을 작성하기만 하면, 버튼 딸깍! 하면 postman… 이제 extensions.json에 하나 더 추가하세요~강추 .http 파일을 작성하기만 하면, 버튼 딸깍! 하면 postman…

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.