code2postman-mcp

marioToribi0/code2postman-mcp

3.3

If you are the rightful owner of code2postman-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Code2Postman MCP is an open-source tool that leverages the Model Context Protocol to help developers quickly generate Postman collections from their codebase.

Tools

Functions exposed to the LLM to take actions

create_postman_collection

Create a Postman collection from a directory structure. Extension of the file must be .json

Args: file_path: The path to the file to create the Postman collection from (string) name: The name of the project (string) description: The description of the project (string) Returns: The initial Postman collection in JSON format (string)

add_postman_collection_item

Add an item to the Postman collection

Args: file_path: The path to the Postman collection file (string) item: The item dictionary to add (dict containing at least 'name' and 'request' keys) Example: { "name": "Get User", "request": { "method": "GET", "url": "https://api.example.com/users/1" } } Returns: The updated Postman collection data (dict)

read_postman_collection

Read the Postman collection

Args: file_path: The path to the Postman collection file (string) Returns: The Postman collection data (dict)

add_postman_collection_info

Update or add the info section of a Postman collection

Args: file_path: The path to the Postman collection file (string) info: The info dictionary to update/add (dict) Example: { "name": "Updated Collection", "description": "Updated description", "version": "1.0.0", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" } Returns: The updated Postman collection data (dict)

add_postman_collection_event

Add an event to the Postman collection

Args: file_path: The path to the Postman collection file (string) event: The event dictionary with keys like listen, script, etc. (dict) Example: { "listen": "prerequest", "script": { "type": "text/javascript", "exec": ["console.log('This runs before each request');"] } } Returns: The updated Postman collection data (dict)

add_postman_collection_variable

Add a variable to the Postman collection

Args: file_path: The path to the Postman collection file (string) variable: The variable dictionary with keys like key, value, type, etc. (dict) Example: { "key": "base_url", "value": "https://api.example.com", "type": "string" } Returns: The updated Postman collection data (dict)

add_postman_collection_auth

Add or update authentication information for the Postman collection

Args: file_path: The path to the Postman collection file (string) auth: The auth dictionary with type and necessary auth parameters (dict) Example: { "type": "bearer", "bearer": [ { "key": "token", "value": "{{token_variable}}", "type": "string" } ] } Returns: The updated Postman collection data (dict)

add_postman_collection_protocol_behavior

Add or update protocol profile behavior settings for the Postman collection

Args: file_path: The path to the Postman collection file (string) behavior: The protocolProfileBehavior dictionary (dict) Example: { "disableBodyPruning": true, "followRedirects": false } Returns: The updated Postman collection data (dict)

delete_postman_collection_item

Delete an item from the Postman collection by name

Args: file_path: The path to the Postman collection file (string) item_name: The name of the item to delete (string) Returns: The updated Postman collection data (dict)

update_postman_collection_variable

Update a specific variable in the Postman collection by key

Args: file_path: The path to the Postman collection file (string) key: The key of the variable to update (string) new_value: The new value for the variable (string) Returns: The updated Postman collection data (dict)

add_postman_collection_folder

Add a folder to the Postman collection

Args: file_path: The path to the Postman collection file (string) folder_name: The name of the folder (string) items: Optional list of item dictionaries to add to the folder (list of dicts) Returns: The updated Postman collection data (dict)

add_item_to_folder

Add an item to a specific folder in the Postman collection

Args: file_path: The path to the Postman collection file (string) folder_name: The name of the folder to add the item to (string) item: The item dictionary to add (dict) Returns: The updated Postman collection data (dict)

get_tree_directory_from_path

Generate a tree directory structure as a string, excluding files and directories based on the specified programming language using regex patterns.

Args: path: The root path to start generating the tree from language: The programming language to filter files. Possible values: ["python", "javascript", "java", "go", "ruby", "rust", "csharp", "generic"]

Returns: A formatted string representing the directory tree with line counts for each file

read_file

Read content from a file with line numbers, validating the file path first.

Args: file_path: Path to the file to read start_line: Line number to start reading from (0-indexed, default: 0) end_line: Line number to end reading at (0-indexed, inclusive, default: None for all lines)

Returns: A string with numbered lines from the file

Raises: FileNotFoundError: If the file does not exist ValueError: If the line parameters are invalid

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

No resources