mcpField
C
Code2postman Mcp

Code2postman Mcp

Local
github.com/marioToribi0Developer Tools3Updated 52w ago

About Code2postman Mcp

Code2postman Mcp is an open-source MCP server for turning code directories into structured Postman collections. It identifies API endpoints and supports organizing, configuring, and editing collections through MCP tools.

Key features

  1. 01Scans code for API endpoints and parameters
  2. 02Generates structured Postman collections
  3. 03Organizes requests into folders
  4. 04Configures variables and authentication
  5. 05Adds pre-request and test scripts

Use cases

  1. 01Create a Postman collection from a codebase
  2. 02Organize discovered endpoints for API testing
  3. 03Extend an existing collection with requests and settings

MCP support

The MCP server exposes tools to inspect local files and create or modify Postman collections, including requests, folders, variables, authentication, and scripts.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"code2postman": {
"command": "uvx",
"args": [
"code2postman-mcp"
]
}
}
}
Run commanduvx code2postman-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypicode2postman-mcp

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Code2Postman MCP

Code2Postman MCP - A Model Context Protocol (MCP) server implementation that automatically converts code directories into Postman collections.

Overview

Code2Postman MCP is an open-source tool that leverages the Model Context Protocol to help developers quickly generate Postman collections from their codebase. This tool analyzes your code files, identifies API endpoints, and creates structured Postman collections that you can use for testing, documentation, and sharing. It is an MCP that generate postman's collection from code and local repositories.

Features

  • Code Analysis: Automatically scan your codebase to identify API endpoints and their parameters
  • Collection Generation: Create complete Postman collections with proper structure
  • Folder Organization: Organize endpoints logically in folders based on code structure
  • Variables Support: Add and manage collection variables for greater flexibility
  • Authentication Configuration: Set up authentication methods automatically based on code patterns
  • Event Scripts: Generate pre-request and test scripts when applicable

Supported Tools

  • create_postman_collection - Create a new Postman collection
  • add_postman_collection_item - Add a request item to a collection
  • read_postman_collection - Read an existing Postman collection
  • add_postman_collection_info - Add metadata to a collection
  • add_postman_collection_event - Add pre-request or test scripts
  • add_postman_collection_variable - Add variables to a collection
  • add_postman_collection_auth - Configure authentication for a collection
  • add_postman_collection_protocol_behavior - Configure protocol behaviors
  • delete_postman_collection_item - Remove items from a collection
  • update_postman_collection_variable - Update existing variables
  • add_postman_collection_folder - Create folders for organizing requests
  • add_item_to_folder - Add items to specific folders
  • get_tree_directory_from_path - Get a file tree structure from a directory
  • read_file - Read the contents of a specific file

Installation

pip install code2postman-mcp

Usage with Claude Desktop

  1. Add Code2Postman MCP to your claude_desktop_config.json file:
"code2postman-mcp": {
    "command": "uvx",
    "args": ["code2postman-mcp"]
}
  1. Launch Claude Desktop and start using the MCP tools to analyze your code and generate Postman collections.

Command Line Usage

You can also use Code2Postman MCP directly from the command line:

uvx code2postman-mcp

Examples

Creating a Postman Collection from Source Code
  1. First, analyze your codebase to identify API endpoints.
  2. Create a new Postman collection.
  3. Add identified endpoints as items to the collection.
  4. Configure authentication if needed.
  5. Add collection variables for flexibility.
  6. Export the collection as a JSON file that can be imported into Postman.
Adding to an Existing Collection

You can also extend existing Postman collections by:

  1. Reading an existing collection.
  2. Adding new items or folders.
  3. Updating variables or authentication methods.
  4. Saving the updated collection.

Development

To contribute to Code2Postman MCP:

  1. Clone the repository:

    git clone https://github.com/yourusername/code2postman-mcp.git
    
  2. Install development dependencies:

    cd code2postman-mcp
    uv pip install -e .
    
  3. Run tests:

    uv run pytest tests/
    

License

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.