@postman/postman-mcp-server 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/package.json +10 -10
- package/dist/src/enabledResources.js +7 -4
- package/dist/src/tools/createCollectionRequest.js +256 -92
- package/dist/src/tools/createCollectionResponse.js +414 -3
- package/dist/src/tools/createSpec.js +16 -4
- package/dist/src/tools/createWorkspace.js +5 -1
- package/dist/src/tools/generateCollection.js +2 -2
- package/dist/src/tools/getCodeGenerationInstructions.js +12 -6
- package/dist/src/tools/getCollection/getCollectionMap.js +2 -2
- package/dist/src/tools/pullCollectionChanges.js +3 -1
- package/dist/src/tools/putCollection.js +10 -0
- package/dist/src/tools/searchPostmanElementsInPrivateNetwork.js +127 -0
- package/dist/src/tools/{searchPostmanElements.js → searchPostmanElementsInPublicNetwork.js} +1 -1
- package/dist/src/tools/updateCollectionRequest.js +258 -95
- package/dist/src/views/getWorkspaces.njk +3 -3
- package/package.json +10 -10
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ContentType } from '../clients/postman.js';
|
|
3
|
+
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
4
|
+
export const method = 'searchPostmanElementsInPrivateNetwork';
|
|
5
|
+
export const description = `Search for API requests and collections in your organization's Private API Network—a curated repository of trusted, internal APIs shared by your team.
|
|
6
|
+
|
|
7
|
+
**What is the Private API Network?**
|
|
8
|
+
The Private API Network is where your organization stores vetted APIs for internal use. These are trusted team workspaces containing approved microservices, internal tools, and shared API collections.
|
|
9
|
+
|
|
10
|
+
**When to Use This Tool:**
|
|
11
|
+
- Finding internal/company trusted APIs (e.g., "find a trusted api for notification service", "find our payment APIs", "search for internal microservices")
|
|
12
|
+
- Discovering trusted APIs shared within your organization
|
|
13
|
+
- Looking up team-approved API collections and requests
|
|
14
|
+
- When the user wants to find collections in the private network (e.g., "find internal access control collections", "search for payment API collections in our network")
|
|
15
|
+
|
|
16
|
+
**Search Scope:**
|
|
17
|
+
- Searches only trusted internal APIs in the Private API Network
|
|
18
|
+
- Returns requests or collections from team workspaces published to the network
|
|
19
|
+
|
|
20
|
+
**Entity Types:**
|
|
21
|
+
- \`requests\`: Search for individual API requests (default)
|
|
22
|
+
- \`collections\`: Search for collections (unique collections extracted from request results; pagination applies to underlying requests)`;
|
|
23
|
+
export const parameters = z.object({
|
|
24
|
+
entityType: z
|
|
25
|
+
.enum(['requests', 'collections'])
|
|
26
|
+
.describe('The type of Postman element to search for. Use `requests` to search for individual API requests, or `collections` to search for collections (unique collections extracted from request results; pagination applies to underlying requests).')
|
|
27
|
+
.default('requests'),
|
|
28
|
+
q: z
|
|
29
|
+
.string()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(512)
|
|
32
|
+
.describe('The search query for API elements in the Private API Network (e.g. "invoices API", "notification service", "payment APIs").'),
|
|
33
|
+
nextCursor: z
|
|
34
|
+
.string()
|
|
35
|
+
.describe('The cursor to get the next set of results in the paginated response. If you pass an invalid value, the API returns empty results.')
|
|
36
|
+
.optional(),
|
|
37
|
+
limit: z
|
|
38
|
+
.number()
|
|
39
|
+
.int()
|
|
40
|
+
.gte(1)
|
|
41
|
+
.lte(10)
|
|
42
|
+
.describe('The max number of search results returned in the response.')
|
|
43
|
+
.default(10)
|
|
44
|
+
.optional(),
|
|
45
|
+
});
|
|
46
|
+
export const annotations = {
|
|
47
|
+
title: "Search for API requests and collections in your organization's Private API Network—a curated repository of trusted, internal APIs shared by your team.",
|
|
48
|
+
readOnlyHint: true,
|
|
49
|
+
destructiveHint: false,
|
|
50
|
+
idempotentHint: true,
|
|
51
|
+
};
|
|
52
|
+
const PRIVATE_NETWORK_FILTER = {
|
|
53
|
+
$and: [
|
|
54
|
+
{
|
|
55
|
+
privateNetwork: {
|
|
56
|
+
$eq: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
export async function handler(args, extra) {
|
|
62
|
+
try {
|
|
63
|
+
const query = new URLSearchParams();
|
|
64
|
+
if (args.limit !== undefined)
|
|
65
|
+
query.set('limit', String(args.limit));
|
|
66
|
+
if (args.nextCursor !== undefined)
|
|
67
|
+
query.set('nextCursor', String(args.nextCursor));
|
|
68
|
+
const endpoint = query.toString() ? `/search?${query.toString()}` : '/search';
|
|
69
|
+
const body = {
|
|
70
|
+
q: args.q,
|
|
71
|
+
elementType: 'requests',
|
|
72
|
+
filters: PRIVATE_NETWORK_FILTER,
|
|
73
|
+
};
|
|
74
|
+
const options = {
|
|
75
|
+
body: JSON.stringify(body),
|
|
76
|
+
contentType: ContentType.Json,
|
|
77
|
+
headers: extra.headers,
|
|
78
|
+
};
|
|
79
|
+
const result = await extra.client.post(endpoint, options);
|
|
80
|
+
if (args.entityType === 'collections') {
|
|
81
|
+
const collectionsMap = new Map();
|
|
82
|
+
const data = result?.data || [];
|
|
83
|
+
for (const item of data) {
|
|
84
|
+
if (item.collection && !collectionsMap.has(item.collection.id)) {
|
|
85
|
+
collectionsMap.set(item.collection.id, {
|
|
86
|
+
collectionId: item.collection.id,
|
|
87
|
+
collectionName: item.collection.name,
|
|
88
|
+
workspaceId: item.workspace?.id,
|
|
89
|
+
workspaceName: item.workspace?.name,
|
|
90
|
+
publisher: item.publisher?.name,
|
|
91
|
+
publisherVerified: item.publisher?.isVerified,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const collections = Array.from(collectionsMap.values());
|
|
96
|
+
return {
|
|
97
|
+
content: [
|
|
98
|
+
{
|
|
99
|
+
type: 'text',
|
|
100
|
+
text: JSON.stringify({
|
|
101
|
+
data: collections,
|
|
102
|
+
meta: {
|
|
103
|
+
nextCursor: result?.meta?.nextCursor,
|
|
104
|
+
collectionsCount: collections.length,
|
|
105
|
+
note: 'Collections extracted from request results. Pagination applies to underlying requests.',
|
|
106
|
+
},
|
|
107
|
+
}, null, 2),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
if (e instanceof McpError) {
|
|
123
|
+
throw e;
|
|
124
|
+
}
|
|
125
|
+
throw asMcpError(e);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { asMcpError, McpError } from './utils/toolHelpers.js';
|
|
3
|
-
export const method = '
|
|
3
|
+
export const method = 'searchPostmanElementsInPublicNetwork';
|
|
4
4
|
export const description = 'Searches for Postman elements in the public network.\n\n**When to Use This Tool:**\n- When the user asks for a specific named request (e.g., "find PayPal requests", "search for Stripe API requests")\n- When the user wants to find collections (e.g., "find Stripe collections", "search for payment API collections")\n- When the user explicitly wants to search the public network\n- Do NOT use this for searching the user\'s own workspaces or collections (use getCollections or getWorkspaces instead)\n\n**Search Scope:**\n- Only searches the public network (public workspaces and collections)\n- Does not search private workspaces, team workspaces, or personal collections\n\n**Entity Types:**\n- `requests`: Search for individual API requests\n- `collections`: Search for collections (unique collections extracted from request results; pagination applies to underlying requests)\n';
|
|
5
5
|
export const parameters = z.object({
|
|
6
6
|
entityType: z
|
|
@@ -7,6 +7,7 @@ export const parameters = z.object({
|
|
|
7
7
|
requestId: z.string().describe("The request's ID."),
|
|
8
8
|
collectionId: z.string().describe("The collection's ID."),
|
|
9
9
|
name: z.string().describe('Name of the request. Only provided fields are updated.').optional(),
|
|
10
|
+
description: z.string().nullable().describe("The request's description.").optional(),
|
|
10
11
|
method: z
|
|
11
12
|
.enum([
|
|
12
13
|
'GET',
|
|
@@ -26,57 +27,87 @@ export const parameters = z.object({
|
|
|
26
27
|
'VIEW',
|
|
27
28
|
])
|
|
28
29
|
.nullable()
|
|
29
|
-
.describe("The request's method.")
|
|
30
|
+
.describe("The request's HTTP method.")
|
|
30
31
|
.optional(),
|
|
31
|
-
|
|
32
|
-
url: z.string().nullable().optional(),
|
|
32
|
+
url: z.string().nullable().describe("The request's URL.").optional(),
|
|
33
33
|
headerData: z
|
|
34
34
|
.array(z.object({
|
|
35
|
-
key: z.string().optional(),
|
|
36
|
-
value: z.string().optional(),
|
|
37
|
-
description: z.string().nullable().optional(),
|
|
35
|
+
key: z.string().describe("The header's key.").optional(),
|
|
36
|
+
value: z.string().describe("The header's value.").optional(),
|
|
37
|
+
description: z.string().nullable().describe("The header's description.").optional(),
|
|
38
38
|
}))
|
|
39
|
+
.describe("The request's headers.")
|
|
39
40
|
.optional(),
|
|
40
41
|
queryParams: z
|
|
41
42
|
.array(z.object({
|
|
42
|
-
key: z.string().optional(),
|
|
43
|
-
value: z.string().optional(),
|
|
44
|
-
description: z
|
|
45
|
-
|
|
43
|
+
key: z.string().describe("The query parameter's key.").optional(),
|
|
44
|
+
value: z.string().describe("The query parameter's value.").optional(),
|
|
45
|
+
description: z
|
|
46
|
+
.string()
|
|
47
|
+
.nullable()
|
|
48
|
+
.describe("The query parameter's description.")
|
|
49
|
+
.optional(),
|
|
50
|
+
enabled: z.boolean().describe('If true, the query parameter is enabled.').optional(),
|
|
46
51
|
}))
|
|
52
|
+
.describe("The request's query parameters.")
|
|
53
|
+
.optional(),
|
|
54
|
+
dataMode: z
|
|
55
|
+
.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql'])
|
|
56
|
+
.nullable()
|
|
57
|
+
.describe("The request body's data mode.")
|
|
47
58
|
.optional(),
|
|
48
|
-
dataMode: z.enum(['raw', 'urlencoded', 'formdata', 'binary', 'graphql']).nullable().optional(),
|
|
49
59
|
data: z
|
|
50
60
|
.array(z.object({
|
|
51
|
-
key: z.string().optional(),
|
|
52
|
-
value: z.string().optional(),
|
|
53
|
-
description: z.string().nullable().optional(),
|
|
54
|
-
enabled: z.boolean().optional(),
|
|
55
|
-
type: z.enum(['text', 'file']).optional(),
|
|
56
|
-
uuid: z.string().optional(),
|
|
61
|
+
key: z.string().describe("The form data's key.").optional(),
|
|
62
|
+
value: z.string().describe("The form data's value.").optional(),
|
|
63
|
+
description: z.string().nullable().describe("The form data's description.").optional(),
|
|
64
|
+
enabled: z.boolean().describe('If true, the form data entry is enabled.').optional(),
|
|
65
|
+
type: z.enum(['text', 'file']).describe("The form data's type.").optional(),
|
|
66
|
+
uuid: z.string().describe("The form data entry's unique identifier.").optional(),
|
|
57
67
|
}))
|
|
58
68
|
.nullable()
|
|
69
|
+
.describe("The request body's form data.")
|
|
59
70
|
.optional(),
|
|
60
|
-
rawModeData: z.string().nullable().optional(),
|
|
71
|
+
rawModeData: z.string().nullable().describe("The request body's raw mode data.").optional(),
|
|
61
72
|
graphqlModeData: z
|
|
62
|
-
.object({
|
|
73
|
+
.object({
|
|
74
|
+
query: z.string().describe('The GraphQL query.').optional(),
|
|
75
|
+
variables: z.string().describe('The GraphQL query variables, in JSON format.').optional(),
|
|
76
|
+
})
|
|
63
77
|
.nullable()
|
|
78
|
+
.describe("The request body's GraphQL mode data.")
|
|
64
79
|
.optional(),
|
|
65
80
|
dataOptions: z
|
|
66
81
|
.object({
|
|
67
|
-
raw: z
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
raw: z
|
|
83
|
+
.object({ language: z.string().describe("The raw mode data's language type.").optional() })
|
|
84
|
+
.catchall(z.unknown())
|
|
85
|
+
.describe('Options for the `raw` data mode.')
|
|
86
|
+
.optional(),
|
|
87
|
+
urlencoded: z
|
|
88
|
+
.record(z.string(), z.unknown())
|
|
89
|
+
.describe('Options for the `urlencoded` data mode.')
|
|
90
|
+
.optional(),
|
|
91
|
+
params: z
|
|
92
|
+
.record(z.string(), z.unknown())
|
|
93
|
+
.describe('Options for the `params` data mode.')
|
|
94
|
+
.optional(),
|
|
95
|
+
binary: z
|
|
96
|
+
.record(z.string(), z.unknown())
|
|
97
|
+
.describe('Options for the `binary` data mode.')
|
|
98
|
+
.optional(),
|
|
99
|
+
graphql: z
|
|
100
|
+
.record(z.string(), z.unknown())
|
|
101
|
+
.describe('Options for the `graphql` data mode.')
|
|
102
|
+
.optional(),
|
|
72
103
|
})
|
|
73
104
|
.nullable()
|
|
105
|
+
.describe("Additional configurations and options set for the request body's various data modes.")
|
|
74
106
|
.optional(),
|
|
75
107
|
auth: z
|
|
76
108
|
.object({
|
|
77
109
|
type: z
|
|
78
110
|
.enum([
|
|
79
|
-
'noauth',
|
|
80
111
|
'basic',
|
|
81
112
|
'bearer',
|
|
82
113
|
'apikey',
|
|
@@ -89,94 +120,224 @@ export const parameters = z.object({
|
|
|
89
120
|
'edgegrid',
|
|
90
121
|
'jwt',
|
|
91
122
|
'asap',
|
|
123
|
+
'noauth',
|
|
92
124
|
])
|
|
93
|
-
.
|
|
125
|
+
.describe('The authorization type.'),
|
|
94
126
|
apikey: z
|
|
95
|
-
.array(z
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
127
|
+
.array(z
|
|
128
|
+
.object({
|
|
129
|
+
key: z.string().describe("The auth method's key value."),
|
|
130
|
+
value: z
|
|
131
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
132
|
+
.describe("The key's value.")
|
|
133
|
+
.optional(),
|
|
134
|
+
type: z
|
|
135
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
136
|
+
.describe("The value's type.")
|
|
137
|
+
.optional(),
|
|
138
|
+
})
|
|
139
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
140
|
+
.describe("The API key's authentication information.")
|
|
100
141
|
.optional(),
|
|
101
|
-
|
|
102
|
-
.array(z
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
142
|
+
awsv4: z
|
|
143
|
+
.array(z
|
|
144
|
+
.object({
|
|
145
|
+
key: z.string().describe("The auth method's key value."),
|
|
146
|
+
value: z
|
|
147
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
148
|
+
.describe("The key's value.")
|
|
149
|
+
.optional(),
|
|
150
|
+
type: z
|
|
151
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
152
|
+
.describe("The value's type.")
|
|
153
|
+
.optional(),
|
|
154
|
+
})
|
|
155
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
156
|
+
.describe('The attributes for AWS Signature authentication.')
|
|
107
157
|
.optional(),
|
|
108
158
|
basic: z
|
|
109
|
-
.array(z
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
159
|
+
.array(z
|
|
160
|
+
.object({
|
|
161
|
+
key: z.string().describe("The auth method's key value."),
|
|
162
|
+
value: z
|
|
163
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
164
|
+
.describe("The key's value.")
|
|
165
|
+
.optional(),
|
|
166
|
+
type: z
|
|
167
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
168
|
+
.describe("The value's type.")
|
|
169
|
+
.optional(),
|
|
170
|
+
})
|
|
171
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
172
|
+
.describe('The attributes for Basic Auth.')
|
|
114
173
|
.optional(),
|
|
115
|
-
|
|
116
|
-
.array(z
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
174
|
+
bearer: z
|
|
175
|
+
.array(z
|
|
176
|
+
.object({
|
|
177
|
+
key: z.string().describe("The auth method's key value."),
|
|
178
|
+
value: z
|
|
179
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
180
|
+
.describe("The key's value.")
|
|
181
|
+
.optional(),
|
|
182
|
+
type: z
|
|
183
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
184
|
+
.describe("The value's type.")
|
|
185
|
+
.optional(),
|
|
186
|
+
})
|
|
187
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
188
|
+
.describe('The attributes for Bearer Token authentication.')
|
|
121
189
|
.optional(),
|
|
122
|
-
|
|
123
|
-
.array(z
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
190
|
+
digest: z
|
|
191
|
+
.array(z
|
|
192
|
+
.object({
|
|
193
|
+
key: z.string().describe("The auth method's key value."),
|
|
194
|
+
value: z
|
|
195
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
196
|
+
.describe("The key's value.")
|
|
197
|
+
.optional(),
|
|
198
|
+
type: z
|
|
199
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
200
|
+
.describe("The value's type.")
|
|
201
|
+
.optional(),
|
|
202
|
+
})
|
|
203
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
204
|
+
.describe('The attributes for Digest access authentication.')
|
|
128
205
|
.optional(),
|
|
129
|
-
|
|
130
|
-
.array(z
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
206
|
+
edgegrid: z
|
|
207
|
+
.array(z
|
|
208
|
+
.object({
|
|
209
|
+
key: z.string().describe("The auth method's key value."),
|
|
210
|
+
value: z
|
|
211
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
212
|
+
.describe("The key's value.")
|
|
213
|
+
.optional(),
|
|
214
|
+
type: z
|
|
215
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
216
|
+
.describe("The value's type.")
|
|
217
|
+
.optional(),
|
|
218
|
+
})
|
|
219
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
220
|
+
.describe('The attributes for Akamai Edgegrid authentication.')
|
|
135
221
|
.optional(),
|
|
136
222
|
hawk: z
|
|
137
|
-
.array(z
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})
|
|
223
|
+
.array(z
|
|
224
|
+
.object({
|
|
225
|
+
key: z.string().describe("The auth method's key value."),
|
|
226
|
+
value: z
|
|
227
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
228
|
+
.describe("The key's value.")
|
|
229
|
+
.optional(),
|
|
230
|
+
type: z
|
|
231
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
232
|
+
.describe("The value's type.")
|
|
233
|
+
.optional(),
|
|
234
|
+
})
|
|
235
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
236
|
+
.describe('The attributes for Hawk authentication.')
|
|
149
237
|
.optional(),
|
|
150
238
|
ntlm: z
|
|
151
|
-
.array(z
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
239
|
+
.array(z
|
|
240
|
+
.object({
|
|
241
|
+
key: z.string().describe("The auth method's key value."),
|
|
242
|
+
value: z
|
|
243
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
244
|
+
.describe("The key's value.")
|
|
245
|
+
.optional(),
|
|
246
|
+
type: z
|
|
247
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
248
|
+
.describe("The value's type.")
|
|
249
|
+
.optional(),
|
|
250
|
+
})
|
|
251
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
252
|
+
.describe('The attributes for NTLM authentication.')
|
|
156
253
|
.optional(),
|
|
157
|
-
|
|
158
|
-
.array(z
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
254
|
+
oauth1: z
|
|
255
|
+
.array(z
|
|
256
|
+
.object({
|
|
257
|
+
key: z.string().describe("The auth method's key value."),
|
|
258
|
+
value: z
|
|
259
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
260
|
+
.describe("The key's value.")
|
|
261
|
+
.optional(),
|
|
262
|
+
type: z
|
|
263
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
264
|
+
.describe("The value's type.")
|
|
265
|
+
.optional(),
|
|
266
|
+
})
|
|
267
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
268
|
+
.describe('The attributes for OAuth1 authentication.')
|
|
269
|
+
.optional(),
|
|
270
|
+
oauth2: z
|
|
271
|
+
.array(z
|
|
272
|
+
.object({
|
|
273
|
+
key: z.string().describe("The auth method's key value."),
|
|
274
|
+
value: z
|
|
275
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
276
|
+
.describe("The key's value.")
|
|
277
|
+
.optional(),
|
|
278
|
+
type: z
|
|
279
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
280
|
+
.describe("The value's type.")
|
|
281
|
+
.optional(),
|
|
282
|
+
})
|
|
283
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
284
|
+
.describe('The attributes for OAuth2 authentication.')
|
|
163
285
|
.optional(),
|
|
164
286
|
jwt: z
|
|
165
|
-
.array(z
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
287
|
+
.array(z
|
|
288
|
+
.object({
|
|
289
|
+
key: z.string().describe("The auth method's key value."),
|
|
290
|
+
value: z
|
|
291
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
292
|
+
.describe("The key's value.")
|
|
293
|
+
.optional(),
|
|
294
|
+
type: z
|
|
295
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
296
|
+
.describe("The value's type.")
|
|
297
|
+
.optional(),
|
|
298
|
+
})
|
|
299
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
300
|
+
.describe('The attributes for JWT authentication.')
|
|
170
301
|
.optional(),
|
|
171
302
|
asap: z
|
|
172
|
-
.array(z
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
303
|
+
.array(z
|
|
304
|
+
.object({
|
|
305
|
+
key: z.string().describe("The auth method's key value."),
|
|
306
|
+
value: z
|
|
307
|
+
.union([z.string(), z.array(z.record(z.string(), z.unknown()))])
|
|
308
|
+
.describe("The key's value.")
|
|
309
|
+
.optional(),
|
|
310
|
+
type: z
|
|
311
|
+
.enum(['string', 'boolean', 'number', 'array', 'object', 'any'])
|
|
312
|
+
.describe("The value's type.")
|
|
313
|
+
.optional(),
|
|
314
|
+
})
|
|
315
|
+
.describe('Information about the supported Postman [authorization type](https://learning.postman.com/docs/sending-requests/authorization/authorization-types/).'))
|
|
316
|
+
.describe('The attributes for ASAP authentication.')
|
|
177
317
|
.optional(),
|
|
178
318
|
})
|
|
179
319
|
.nullable()
|
|
320
|
+
.describe("The request's authentication information.")
|
|
321
|
+
.optional(),
|
|
322
|
+
events: z
|
|
323
|
+
.array(z.object({
|
|
324
|
+
listen: z.enum(['test', 'prerequest']).describe('The event type.'),
|
|
325
|
+
script: z
|
|
326
|
+
.object({
|
|
327
|
+
id: z.string().describe("The script's ID.").optional(),
|
|
328
|
+
type: z
|
|
329
|
+
.string()
|
|
330
|
+
.describe('The type of script. For example, `text/javascript`.')
|
|
331
|
+
.optional(),
|
|
332
|
+
exec: z
|
|
333
|
+
.array(z.string().nullable())
|
|
334
|
+
.describe('A list of script strings, where each line represents a line of code. Separate lines makes it easy to track script changes.')
|
|
335
|
+
.optional(),
|
|
336
|
+
})
|
|
337
|
+
.describe('Information about the Javascript code that can be used to to perform setup or teardown operations in a response.')
|
|
338
|
+
.optional(),
|
|
339
|
+
}))
|
|
340
|
+
.describe('A list of scripts configured to run when specific events occur.')
|
|
180
341
|
.optional(),
|
|
181
342
|
});
|
|
182
343
|
export const annotations = {
|
|
@@ -193,10 +354,10 @@ export async function handler(args, extra) {
|
|
|
193
354
|
const bodyPayload = {};
|
|
194
355
|
if (args.name !== undefined)
|
|
195
356
|
bodyPayload.name = args.name;
|
|
196
|
-
if (args.method !== undefined)
|
|
197
|
-
bodyPayload.method = args.method;
|
|
198
357
|
if (args.description !== undefined)
|
|
199
358
|
bodyPayload.description = args.description;
|
|
359
|
+
if (args.method !== undefined)
|
|
360
|
+
bodyPayload.method = args.method;
|
|
200
361
|
if (args.url !== undefined)
|
|
201
362
|
bodyPayload.url = args.url;
|
|
202
363
|
if (args.headerData !== undefined)
|
|
@@ -215,6 +376,8 @@ export async function handler(args, extra) {
|
|
|
215
376
|
bodyPayload.dataOptions = args.dataOptions;
|
|
216
377
|
if (args.auth !== undefined)
|
|
217
378
|
bodyPayload.auth = args.auth;
|
|
379
|
+
if (args.events !== undefined)
|
|
380
|
+
bodyPayload.events = args.events;
|
|
218
381
|
const options = {
|
|
219
382
|
body: JSON.stringify(bodyPayload),
|
|
220
383
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workspaces
|
|
2
2
|
|
|
3
|
-
| id | name | type | visibility | createdBy | scim |
|
|
4
|
-
|
|
5
|
-
{% for item in workspaces %}| {{ item.id }} | {{ item.name }} | {{ item.type }} | {{ item.visibility }} | {{ item.createdBy }} | {{ item.scim | dump }} |
|
|
3
|
+
| id | name | type | visibility | createdBy | about | createdAt | updatedAt | scim |
|
|
4
|
+
|---|---|---|---|---|---|---|---|---|
|
|
5
|
+
{% for item in workspaces %}| {{ item.id }} | {{ item.name }} | {{ item.type }} | {{ item.visibility }} | {{ item.createdBy }} | {{ item.about }} | {{ item.createdAt }} | {{ item.updatedAt }} | {{ item.scim | dump }} |
|
|
6
6
|
{% endfor %}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postman/postman-mcp-server",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "A simple MCP server to operate on the Postman API",
|
|
5
5
|
"mcpName": "com.postman/postman-mcp-server",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
31
|
-
"dotenv": "^17.
|
|
32
|
-
"newman": "^6.2.
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
31
|
+
"dotenv": "^17.3.1",
|
|
32
|
+
"newman": "^6.2.2",
|
|
33
33
|
"nunjucks": "^3.2.4",
|
|
34
34
|
"uuid": "^13.0.0",
|
|
35
35
|
"zod": "^3.25.76"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/js": "^
|
|
38
|
+
"@eslint/js": "^10.0.1",
|
|
39
39
|
"@types/node": "^24",
|
|
40
|
-
"eslint": "^
|
|
40
|
+
"eslint": "^10.0.2",
|
|
41
41
|
"eslint-config-prettier": "^10.1.8",
|
|
42
|
-
"eslint-plugin-unused-imports": "^4.
|
|
43
|
-
"prettier": "^3.
|
|
42
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
43
|
+
"prettier": "^3.8.1",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
|
-
"typescript-eslint": "^8.
|
|
46
|
-
"vitest": "^4.0.
|
|
45
|
+
"typescript-eslint": "^8.56.1",
|
|
46
|
+
"vitest": "^4.0.18"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20.0.0"
|