Skip to content

Commit d4a0de1

Browse files
feat: add code toolset (#87)
* feat: add code generation toolset and update enabled resources - Introduced `getCodeGenerationInstructions` tool to provide step-by-step guidance for generating API client code from Postman collections. - Added `getCollectionMap` tool to retrieve a recursive index of all folders and requests in a Postman collection. - Updated `enabledResources` to include new tools and modified the `excludedFromGeneration` list. - Enhanced the `run` function to support a new `--code` argument for selecting code generation tools. - Adjusted `ServerContext` to accommodate the new 'code' server type. * feat: add code toolset bundling flows * feat: add searchPostmanElements tool * Various README updates for code toolset * Tweaks to code manifest description and long description --------- Co-authored-by: Josh Dzielak <[email protected]>
1 parent e2cd46a commit d4a0de1

21 files changed

+1487
-44
lines changed

.github/workflows/mcpb-pack.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
mv manifest-minimal.tmp.json manifest-minimal.json
3030
jq --arg v "$pkg_version" '.version = $v' manifest-full.json > manifest-full.tmp.json
3131
mv manifest-full.tmp.json manifest-full.json
32+
jq --arg v "$pkg_version" '.version = $v' manifest-code.json > manifest-code.tmp.json
33+
mv manifest-code.tmp.json manifest-code.json
3234
3335
- name: Build project
3436
run: npm run build
@@ -53,9 +55,15 @@ jobs:
5355
mcpb pack
5456
mv "${current_dir}.mcpb" "${current_dir}-full.mcpb"
5557
58+
# Package code version
59+
cp manifest-code.json manifest.json
60+
mcpb pack
61+
mv "${current_dir}.mcpb" "${current_dir}-code.mcpb"
62+
5663
# Set environment variables
5764
echo "MCPB_MINIMAL_FILENAME=${current_dir}-minimal.mcpb" >> $GITHUB_ENV
5865
echo "MCPB_FULL_FILENAME=${current_dir}-full.mcpb" >> $GITHUB_ENV
66+
echo "MCPB_CODE_FILENAME=${current_dir}-code.mcpb" >> $GITHUB_ENV
5967
6068
- name: Upload minimal release asset
6169
uses: svenstaro/upload-release-action@7027b7670c56b9473901daad1fb8a09ab534688e
@@ -75,6 +83,15 @@ jobs:
7583
tag: ${{ github.ref }}
7684
overwrite: true
7785

86+
- name: Upload code release asset
87+
uses: svenstaro/upload-release-action@7027b7670c56b9473901daad1fb8a09ab534688e
88+
with:
89+
repo_token: ${{ secrets.GITHUB_TOKEN }}
90+
file: ${{ env.MCPB_CODE_FILENAME }}
91+
asset_name: ${{ env.MCPB_CODE_FILENAME }}
92+
tag: ${{ github.ref }}
93+
overwrite: true
94+
7895
publish-mcp:
7996
needs: build-and-release
8097
runs-on: ubuntu-latest

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Postman supports the following tool configurations:
66

77
* **Minimal** — (Default) Only includes essential tools for basic Postman operations This offers faster performance and simplifies use for those who only need basic Postman operations. Ideal for users who want to modify a single Postman elements, such as collections, workspaces, or environments.
88
* **Full** — Includes all available Postman API tools (100+ tools). This configuration is ideal for users who engage in advanced collaboration and Postman's Enterprise features.
9+
* **Code** — Includes tools to generate high-quality, well-organized client code from public and internal API definitions. This configuration is ideal for users who need to consume APIs or simply get context about APIs to their agents.
910

1011
For a complete list of the Postman MCP Server's tools, see the [Postman MCP Server collection](https://www.postman.com/postman/postman-public-workspace/collection/681dc649440b35935978b8b7). This collection offers both the remote [full](https://www.postman.com/postman/postman-public-workspace/mcp-request/6821a76b17ccb90a86df48d3) and [minimal](https://www.postman.com/postman/postman-public-workspace/mcp-request/689e1c635be722a98b723238) servers, and the [local server](https://www.postman.com/postman/postman-public-workspace/mcp-request/6866a655b36c67cc435b5033).
1112

@@ -19,8 +20,9 @@ Postman also offers servers as an [npm package](https://www.npmjs.com/package/@p
1920
* **Collection management** - Create and [tag](https://learning.postman.com/docs/collections/use-collections/collaborate-with-collections/#tag-a-collection) collections, update collection and request [documentation](https://learning.postman.com/docs/publishing-your-api/api-documentation-overview/), add [comments](https://learning.postman.com/docs/collaborating-in-postman/comments/), or perform actions across multiple collections without leaving your editor.
2021
* **Workspace and environment management** - Create [workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/overview/) and [environments](https://learning.postman.com/docs/sending-requests/variables/managing-environments/), plus manage your environment variables.
2122
* **Automatic spec creation** - Create [specs](https://learning.postman.com/docs/design-apis/specifications/overview/) from your code and use them to generate collections.
23+
* **Client code generation** - Generate production-ready client code that consumes APIs following best practices and project conventions. The `code` toolset produces code that precisely matches your API definitions, organizes it into an intuitive tree structure mirroring your Postman collections and requests, and leverages example responses to create accurate response types and error handling.
2224

23-
Designed for developers who want to integrate their AI tools with Postmans context and features. Supports quick natural language queries queries to advanced agent workflows.
25+
Designed for developers who want to integrate their AI tools with Postman's context and features. Supports quick natural language queries to advanced agent workflows.
2426

2527
### Support for EU
2628

@@ -55,6 +57,7 @@ The remote Postman MCP Server is hosted by Postman over streamable HTTP and prov
5557
The remote server supports the following tool configurations:
5658

5759
* **Minimal** — (Default) Only includes essential tools for basic Postman operations, available at `https://mcp.postman.com/minimal` and `https://mcp.eu.postman.com/minimal` for EU users.
60+
* **Code** — Includes tools for searching public and internal API definitions and generating client code, available at `https://mcp.postman.com/code` and `https://mcp.eu.postman.com/code` for EU users.
5861
* **Full** — Includes all available Postman API tools (100+ tools), available at `https://mcp.postman.com/mcp` and `https://mcp.eu.postman.com/mcp` for EU users.
5962

6063
### Install in Cursor
@@ -65,15 +68,15 @@ To install the remote Postman MCP Server in Cursor, click the install button.
6568

6669
**Note:** Ensure that the Authorization header uses the `Bearer <YOUR_API_KEY>` format.
6770

68-
By default, the server uses **Minimal** mode. To access **Full** mode, change the `url` value to `https://mcp.postman.com/mcp` in the `mcp.json` file.
71+
By default, the server uses **Minimal** mode. To access **Full** mode, change the `url` value to `https://mcp.postman.com/mcp` in the `mcp.json` file. To access **Code** mode, change the value to `https://mcp.postman.com/code`.
6972

7073
### Install in Visual Studio Code
7174

7275
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=postman_mcp_server&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fmcp.postman.com%2Fminimal%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20YOUR_API_KEY%22%7D%7D)
7376

7477
To install the remote Postman MCP Server in VS Code, click the install button or use the [Postman VS Code Extension](https://marketplace.visualstudio.com/items?itemName=Postman.postman-for-vscode).
7578

76-
By default, the server uses **Minimal** mode. To access **Full** mode, change the `url` value to `https://mcp.postman.com/mcp` in the `mcp.json` file.
79+
By default, the server uses **Minimal** mode. To access **Full** mode, change the `url` value to `https://mcp.postman.com/mcp` in the `mcp.json` file. To access **Code** mode, change the value to `https://mcp.postman.com/code`.
7780

7881
#### Manual configuration
7982

@@ -84,8 +87,7 @@ You can use the Postman MCP Server with MCP-compatible extensions in VS Code, su
8487
"servers": {
8588
"postman-api-http-server": {
8689
"type": "http",
87-
"url": "https://mcp.postman.com/{minimal OR mcp}",
88-
// Use "https://mcp.postman.com/mcp" for full or "https://mcp.postman.com/minimal" for minimal mode.
90+
"url": "https://mcp.postman.com/{minimal OR code OR mcp}",
8991
// For the EU server, use the "https://mcp.eu.postman.com" URL.
9092
"headers": {
9193
"Authorization": "Bearer ${input:postman-api-key}"
@@ -114,6 +116,12 @@ For **Minimal** mode:
114116
claude mcp add --transport http postman https://mcp.postman.com/minimal --header "Authorization: Bearer <POSTMAN_API_KEY>"
115117
```
116118

119+
For **Code** mode:
120+
121+
```bash
122+
claude mcp add --transport http postman https://mcp.postman.com/code --header "Authorization: Bearer <POSTMAN_API_KEY>"
123+
```
124+
117125
For **Full** mode:
118126

119127
```bash
@@ -133,6 +141,7 @@ STDIO is a lightweight solution that's ideal for integration with editors and to
133141
The local server supports the following tool configurations:
134142

135143
* **Minimal** — (Default) Only includes essential tools for basic Postman operations.
144+
* **Code** — Includes tools for searching public and internal API definitions and generating client code
136145
* **Full** — Includes all available Postman API tools (100+ tools). Use the `--full` flag to enable this configuration.
137146

138147
**Note:** Use the `--region` flag to specify the Postman API region (`us` or `eu`), or set the `POSTMAN_API_BASE_URL` environment variable directly. By default, the server uses the `us` option.
@@ -144,7 +153,7 @@ The local server supports the following tool configurations:
144153

145154
To install the local Postman MCP Server in VS Code, click the install button.
146155

147-
By default, the server uses **Full** mode. To access **Minimal** mode, remove the `--full` flag from the `mcp.json` configuration file.
156+
By default, the server uses **Full** mode. To access **Minimal** mode, remove the `--full` flag from the `mcp.json` configuration file. To access **Code** mode, replace the `--full` flag with `--code`.
148157

149158
#### Manual configuration
150159

@@ -158,7 +167,8 @@ You can manually integrate your MCP server with Cursor or VS Code to use it with
158167
"command": "npx",
159168
"args": [
160169
"@postman/postman-mcp-server",
161-
"--full" // (optional) Use this flag to enable full mode.
170+
"--full", // (optional) Use this flag to enable full mode...
171+
"--code", // (optional) ...OR this flag to enable code mode.
162172
"--region us" // (optional) Use this flag to specify the Postman API region (us or eu). Defaults to us.
163173
],
164174
"env": {
@@ -182,14 +192,15 @@ You can manually integrate your MCP server with Cursor or VS Code to use it with
182192

183193
To install the local Postman MCP Server in Cursor, click the install button.
184194

185-
By default, the server uses **Full** mode. To access **Minimal** mode, remove the `--full` flag from the `mcp.json` configuration file.
195+
By default, the server uses **Full** mode. To access **Minimal** mode, remove the `--full` flag from the `mcp.json` configuration file. To access **Code** mode, replace the `--full` flag with `--code`.
186196

187197
### Claude integration
188198

189199
To integrate the MCP server with Claude, check the latest [Postman MCP Server release](https://github.com/postmanlabs/postman-mcp-server/releases) and get the `.mcpb` file.
190200

191-
* **Minimal** - `postman-api-mcp-minimal.mcpb`
192-
* **Full** - `postman-api-mcp-full.mcpb`
201+
* **Minimal** - `postman-mcp-server-minimal.mcpb`
202+
* **Full** - `postman-mcp-server-full.mcpb`
203+
* **Code** - `postman-mcp-server-code.mcpb`
193204

194205
For more information, see the [Claude Desktop Extensions](https://www.anthropic.com/engineering/desktop-extensions) documentation.
195206

@@ -203,6 +214,12 @@ For **Minimal** mode:
203214
claude mcp add postman --env POSTMAN_API_KEY=YOUR_KEY -- npx @postman/postman-mcp-server@latest
204215
```
205216

217+
For **Code** mode:
218+
219+
```bash
220+
claude mcp add postman --env POSTMAN_API_KEY=YOUR_KEY -- npx @postman/postman-mcp-server@latest --code
221+
```
222+
206223
For **Full** mode:
207224

208225
```bash
@@ -239,7 +256,6 @@ If you're migrating from Postman MCP Server version 1.x to 2.x, be aware of the
239256

240257
## Questions and support
241258

242-
* See the [Postman Agent Generator](https://postman.com/explore/agent-generator) page for updates and new capabilities.
243259
* See [Add your MCP requests to your collections](https://learning.postman.com/docs/postman-ai-agent-builder/mcp-requests/overview/) to learn how to use Postman to perform MCP requests.
244260
* Visit the [Postman Community](https://community.postman.com/) to share what you've built, ask questions, and get help.
245261
* You can connect to both the remote and local servers and test them using the [Postman MCP Server collection](https://www.postman.com/postman/postman-public-workspace/collection/681dc649440b35935978b8b7).

dist/package.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/enabledResources.js

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/index.js

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)