Code2Postman MCP

Code2Postman MCP

Automatically generates Postman collections from code directories by analyzing API endpoints and parameters, enabling easy testing, documentation, and sharing.

Category
Visit Server

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured