Postman MCP Server

repository·main·Indexed 41 days ago

https://github.com/delano/postman-mcp-server

An MCP (Model Context Protocol) server that provides an AI-driven interface to the Postman API, allowing LLMs to manage collections, environments, workspaces, and APIs. Version 0.2.0 supports CRUD operations for collections, environment variable management, API definition versioning, mock servers, and monitors.

Tokens
31.3K
Snippets
85
Records
160
Agent score
96%

What's inside Postman MCP Server

  1. Overview of Postman API capabilities

    main

    The Postman MCP Server provides comprehensive coverage of the Postman API, categorized into several functional domains:

    • Core Resource Management: Managing Workspaces (personal, team, private, public, partner), Collections (supporting Postman Collection Format v2.1.0), Environments, APIs (with schema version control), Mock servers, and Monitors.
    • Version Control: Support for forking collections and environments, merge/pull operations, Git repository integration for APIs, version history tracking, and pull request workflows.
    • Enterprise Features: Private API Network management, secret scanning, audit logging, advanced role-based access control (RBAC), team-level controls, and tag management.
    • Security: API security validation using OWASP rules, secret detection, workspace visibility controls, and multiple authentication options (API key, SCIM).
    • Collaboration: Resource-wide comments, thread-based discussions, and team workspace management.
  2. Key features of the Postman MCP Server

    main

    The Postman MCP Server provides several core capabilities for managing and executing Postman workflows:

    • Collection Running: Execute collections locally or in CI/CD environments. Supports environment integration, folder-specific runs, and multiple iterations.
    • Authentication: Uses API key-based authentication with secure key handling and support for CI/CD variables.
    • Reporting: Supports multiple reporter formats including CLI, JSON, JUnit, and HTML. Output paths are customizable and content filtering options are available.
    • CI/CD Integration: Supports multiple providers with environment variable handling, artifact management, and pipeline configuration.
  3. Postman MCP Server Features Overview

    main

    The Postman MCP Server provides programmatic access to the Postman API for the following domains:

    Collections

    • CRUD Operations: Create, retrieve, update, and delete collections.
    • Folder Management: Organize requests into folders.
    • Request/Response Management: Add, update, or delete requests and manage associated responses.
    • Version Control: Fork, merge, and pull changes.
    • Comments: Manage comments on collections.

    Environments

    • Management: Full CRUD support for creating and retrieving environments.

    APIs

    • Management: Create, retrieve, update, and delete APIs.
    • Schema & Tagging: Manage API schemas (including multi-file support) and tags.
    • Comments: Manage comments on APIs.

    Additional Features

    • Private API Network: Manage elements and folders within a private network.
    • Webhooks: Create webhooks to trigger collections with custom payloads.
    • Enterprise: Advanced role controls and SCIM support.
  4. Postman API Implementation Summary Overview

    main
    The Postman API implementation within the MCP server is verified and cross-checked against a set of specialized summary documents. These documents define the expected functionality for various Postman domains, ensuring the MCP server tools correctly implement the Postman API capabilities.
  5. Manage Postman Monitors via API

    main

    The Postman API allows you to perform CRUD operations on monitors, which are used for scheduled or manual testing of collections.

    Key Capabilities:

    • Create/Update/Delete: Manage monitor configurations including names, collections, and environments.
    • Scheduling: Configure runs using cron expressions and timezones.
    • Execution: Trigger manual runs in either synchronous or asynchronous modes.
    • Monitoring: Retrieve run results, statistics, and failure data.

    Important Constraints:

    • You cannot create monitors for collections that were added via an API definition.
    • When running a monitor asynchronously (async=true), the immediate response will not include statistics, executions, or failures. You must use GET /monitors/{monitorId} to retrieve that information later.
  6. Limitations of the Postman MCP Server

    main

    When using the Postman MCP Server, be aware of the following constraints:

    • Authentication: Interactive authentication flows are not supported. You must provide pre-configured tokens.
    • File Handling: Local file references are not supported. All files must be uploaded to Postman to be accessible.
    • Real-time Feedback: Feedback is limited to CLI reporter output; the server does not support streaming responses.
  7. Version Control: Fork, Merge, and Pull Collections

    main

    The API supports version control workflows similar to Git, allowing you to fork collections, merge changes, and manage pull requests.

    Forking and Merging

    • Create Fork: POST /collections/fork/{collectionId}. Creates a copy of a collection in a specified workspace.
    • Get Forks: GET /collections/{collectionId}/forks or GET /collections/collection-forks to list all forked collections.
    • Merge/Pull Changes: PUT /collection-merges. This is an asynchronous operation. After initiating a merge, use the returned task ID to track progress.
    • Track Merge Status: GET /collections-merges-tasks/{taskId}. Task status is available for 24 hours after completion.
    • Pull Changes: PUT /collections/{collectionId}/pulls to pull changes from a source.
    • Check Source Status: GET /collections/{collectionId}/source-status. Note that this may take a few minutes to reflect updated status.

    Pull Requests

    • Get Pull Request: GET /pull-requests/{pullRequestId}.
    • Update Pull Request: PUT /pull-requests/{pullRequestId}. Requires name and description fields.
    • Review Pull Request: POST /pull-requests/{pullRequestId}/tasks. Used to approve or reject a pull request with a comment.
  8. Requirements for Prompt Handlers

    main

    When implementing Prompt Handlers in the Postman API MCP server, follow these requirements:

    • Naming Convention: Prompt IDs must use snake_case (e.g., create_collection instead of Create Collection).
    • Validation: Use TypeScript type guards to perform input validation.
    • Schema: Each prompt must have a defined input schema and be capable of generating appropriate messages.
  9. Use the `createdBy` ID for workspace resource identifiers

    main

    When interacting with workspaces, you must capture and store the createdBy field (the owner ID) from the workspace response. This ID is required to construct valid resource identifiers when accessing other resources related to that specific workspace.

    Example workspace response structure:

    {
      "id": "5ead536b-e095-403c-89f9-f9f03872537a",
      "name": "My Workspace",
      "type": "personal",
      "visibility": "personal",
      "createdBy": "31912785"
    }
    {
      "id": "5ead536b-e095-403c-89f9-f9f03872537a",
      "name": "My Workspace",
      "type": "personal",
      "visibility": "personal",
      "createdBy": "31912785"
    }
  10. How Resource Template Handlers work

    main

    Resource Template Handlers manage parameterized URIs, allowing for access to specific entities and their nested sub-resources.

    • URI Format: postman://{resource-type}/{id}/[sub-resource]
    • Capabilities: Supports nested resources like workspace collections or API versions.
    • Validation: Template parameters must be validated before initiating API requests.
    postman://workspaces/{id}/collections     # Collections in a workspace
    postman://apis/{id}/versions              # Versions of an API
    postman://collections/{id}/requests       # Requests in a collection