Skip to main content
Glama
runninghare

REST-to-Postman MCP

by runninghare

REST-to-Postman MCP

A Model Context Protocol (MCP) server that converts REST API code (e.g., NestJS controllers, FastAPI/Flask endpoints) to Postman collections and environments. This tool helps developers automatically sync their REST API endpoints and environment configurations with Postman.

Features

  • Convert REST API endpoints to Postman collections

  • Sync environment variables with Postman environments

  • Support for various authentication methods (e.g., Bearer token)

  • Intelligent merging of new endpoints with existing collections

  • Automatic handling of sensitive environment variables

  • Support for both stdio and SSE transport modes

Related MCP server: Codebase Insights MCP Server

Prerequisites

  • Bun v1.2.2 or later

  • Postman API Key

  • Postman Workspace ID

Installation & Usage

This is a Model Context Protocol (MCP) stdio server that requires access to your Postman workspace to create/update collections and environments.

Installing via Smithery

To install REST-to-Postman MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @runninghare/rest-to-postman-mcp --client claude

Running the MCP Server with npx

To use the MCP server with npx:

npx -y rest-to-postman@latest --postman-api-key your_api_key --postman-workspace-id your_workspace_id

Or use environment variables:

export POSTMAN_API_KEY=your_api_key
export POSTMAN_ACTIVE_WORKSPACE_ID=your_workspace_id
npx -y rest-to-postman@latest 

You can integrate this command with various AI code editors that support MCP:

  • Claude Desktop

  • Cursor

  • Windsurf

  • Roo Cline Editor

Important Note: The server requires Postman API credentials to function. Make sure you have both the API key and workspace ID ready before starting the server.

Tool Descriptions

The server provides two main tools:

1. REST to Postman Environment (rest_to_postman_env)

Creates or updates a Postman environment with your application's environment variables.

Input Parameters:

  • envName (string): Name of the Postman environment

  • envVars (object): Key-value pairs of environment variables

Example Input:

{
    "envName": "REST Environment",
    "envVars": {
        "API_URL": "https://api.example.com",
        "API_TOKEN": "secret-token-1"
    }
}

2. REST to Postman Collection (rest_to_postman_collection)

Creates or updates a Postman collection with your REST API endpoints.

Input Parameters:

  • collectionRequest (object): Postman collection configuration containing:

    • info: Collection metadata

    • auth: Authentication settings

    • item: Array of API endpoints

Example Input:

{
    "info": {
        "name": "REST Collection",
        "description": "REST Collection", 
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {   
                "key": "Authorization",
                "value": "Bearer {{API_TOKEN}}",
                "type": "string"
            }
        ]
    },  
    "item": [
        {
            "name": "Get Users",
            "request": {
                "method": "GET",    
                "url": {
                    "raw": "{{API_URL}}/users",
                    "protocol": "https",
                    "host": ["api", "example", "com"],
                    "path": ["users"]
                }   
            }
        }
    ]
}

Response Format

Both tools return a success message confirming the creation/update of the Postman resource:

{
    "content": [{
        "type": "text",
        "text": "Successfully created/updated Postman environment: REST Environment"
    }]
}

Use this MCP in Cursor

You can use this MCP server in Cursor. Here's an example which generates a Postman Collection based on a Nest.js Typescript controller.

Prompt:

Create a postman collection named "Campaign Endpoints" based on this next.js controller. The baseUrl is `http://localhost:7022`. The collection should have a Bear token which applies to all the endpoints

Here's the automatically generated Postman Collection:

Note all the endpoints from the Campaign Controller are generated, along with the Bear token setting.

Development

Local Setup

  1. Clone the repository:

git clone https://github.com/runninghare/rest-to-postman.git
cd rest-to-postman
  1. Install dependencies:

bun install
  1. Create a .env file:

POSTMAN_API_KEY=your_api_key_here
POSTMAN_ACTIVE_WORKSPACE_ID=your_workspace_id_here

Running in Development Mode

For development, you can run the server directly using Bun:

# Start in stdio mode (default)
bun run src/mcp.ts

# Start in SSE mode
bun run src/mcp.ts --sse

Building

To build the project:

bun run build

This will create a bundled output in the dist directory.

Scripts

  • bun run build - Build the project

  • bun run dev - Run the server in development mode

  • bun run startSSE - Start the server in SSE mode

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

2 tools
rest_to_postman_collectionA

Creates or updates a Postman collection with the provided collection configuration. This tool helps synchronize your REST API endpoints with Postman. When updating an existing collection, it intelligently merges the new endpoints with existing ones, avoiding duplicates while preserving custom modifications made in Postman. Here's an example:

{ "info": { "name": "REST Collection", "description": "REST Collection", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "auth": { "type": "bearer", "bearer": [ {
"key": "Authorization", "value": "Bearer {{API_TOKEN}}", "type": "string" } ] },
"item": [ { "name": "Get Users", "request": { "method": "GET",
"url": { "raw": "{{API_URL}}/users", "protocol": "https", "host": ["api", "example", "com"], "path": ["users"] }
} }, { "name": "Create User", "request": { "method": "POST", "url": { "raw": "{{API_URL}}/users" }, "body": { "mode": "raw", "raw": "{"name":"John Doe","email":"john.doe@example.com"}" } }
} ] }

ParametersJSON Schema
NameRequiredDescriptionDefault
collectionRequestYesThe Postman collection configuration containing info, items, and other collection details

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes key behaviors: it can create or update collections, intelligently merges endpoints to avoid duplicates, and preserves custom modifications. However, it lacks details on permissions, error handling, or rate limits, which are important for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose but includes a lengthy example that may not be necessary for understanding the tool's function. While the example is helpful, it makes the description less concise, and some details could be moved to documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (1 parameter with nested objects, no annotations, no output schema), the description is moderately complete. It covers the tool's purpose and behavior but lacks information on return values, error cases, or prerequisites, which are important for a tool that mutates data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds minimal parameter semantics by mentioning 'collection configuration' and providing an example, but it does not explain parameter constraints or usage beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Creates or updates a Postman collection with the provided collection configuration.' It specifies the verb ('creates or updates'), the resource ('Postman collection'), and distinguishes it from sibling tools by mentioning synchronization with REST API endpoints, unlike the sibling 'rest_to_postman_env' which likely handles environments.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage: 'This tool helps synchronize your REST API endpoints with Postman.' It explains when to use it (for creating or updating collections) and hints at the update behavior (intelligent merging). However, it does not explicitly state when not to use it or name specific alternatives beyond the sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rest_to_postman_envA

Creates or updates a Postman environment with the provided environment variables. This tool helps synchronize your REST application's environment configuration with Postman. It supports both creating new environments and updating existing ones in your Postman workspace. Environment variables related to sensitive data (containing 'token' in their names) are automatically marked as secrets. Here's an example:

{ "envName": "REST Environment", "envVars": { "API_URL": "https://api.example.com", "API_TOKEN": "secret-token-1" } }

ParametersJSON Schema
NameRequiredDescriptionDefault
envNameYesThe name of the Postman environment to create or update
envVarsYesA record of environment variables to be added to the Postman environment. Format: { [key: string]: string }

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals important behavioral traits: support for both create and update operations, automatic secret marking for variables containing 'token', and workspace context. However, it doesn't disclose authentication requirements, rate limits, error handling, or whether the operation is idempotent, leaving significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core functionality in the first sentence. The example is helpful but could be more concise. The text is well-structured with clear sentences, though the example takes up significant space relative to the explanatory content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description provides adequate basic information about what the tool does and includes a helpful example. However, it lacks important contextual details: no information about return values, error conditions, authentication requirements, or workspace selection logic. The example helps but doesn't compensate for these missing elements.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters. The description adds minimal value beyond the schema: it provides an example showing the expected JSON structure and mentions the secret-marking behavior for 'token' variables, but doesn't explain parameter semantics beyond what's in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('creates or updates') and resource ('Postman environment with environment variables'). It distinguishes from the sibling tool 'rest_to_postman_collection' by focusing on environments rather than collections, providing clear differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context ('helps synchronize your REST application's environment configuration with Postman') but doesn't explicitly state when to use this tool versus alternatives. No guidance is provided on prerequisites, error conditions, or specific scenarios where this tool is preferred over manual configuration or other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updates
    • First observedrest_to_postman_collection
    • First observedrest_to_postman_env

TDQS

A3.6/5.0
Disambiguation5/5

The two tools have completely distinct purposes: one handles Postman collections (API endpoint configurations), while the other handles Postman environments (environment variables). There is no overlap in functionality, making it impossible to confuse them.

Naming Consistency5/5

Both tools follow a perfect 'rest_to_postman_' prefix pattern with descriptive suffixes ('collection' and 'env'). The naming is completely consistent in style and structure throughout the set.

Tool Count2/5

With only 2 tools, this server feels severely under-scoped for a REST-to-Postman integration purpose. A complete synchronization system would typically need tools for operations like listing collections/environments, deleting resources, or handling authentication flows, not just create/update operations.

Completeness2/5

The toolset is significantly incomplete for REST-to-Postman synchronization. While create/update operations exist for collections and environments, there are no tools for reading existing resources, deleting them, managing workspaces, or handling more complex Postman features like monitors or mocks. This creates dead ends for agents trying to perform full lifecycle management.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Automatically converts Postman API collections into MCP-compatible tools for AI assistants. Enables users to interact with any API through natural language by generating JavaScript tools from Postman requests.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Analyzes API codebases from GitHub and Bitbucket repositories to generate Postman collections, business reports, and detailed code insights. Supports multiple frameworks including FastAPI, Spring Boot, Flask, Express, and OpenAPI/Swagger specifications.
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Integrates Postman with Cursor IDE to manage collections and requests through natural language. It features specialized tools for automatically migrating API endpoints and metadata directly from .NET controller code into Postman collections.
    8
    68
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/runninghare/rest-to-postman'

If you have feedback or need assistance with the MCP directory API, please join our Discord server