@postman/postman-mcp-server 2.2.0 → 2.3.0
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 +3 -0
- package/dist/package.json +18 -18
- package/dist/src/clients/postman.js +25 -15
- package/dist/src/index.js +38 -50
- package/dist/src/tools/createCollection.js +13 -17
- package/dist/src/tools/createCollectionComment.js +9 -9
- package/dist/src/tools/createCollectionFolder.js +7 -7
- package/dist/src/tools/createCollectionFork.js +7 -7
- package/dist/src/tools/createCollectionRequest.js +7 -7
- package/dist/src/tools/createCollectionResponse.js +7 -7
- package/dist/src/tools/createEnvironment.js +6 -6
- package/dist/src/tools/createFolderComment.js +9 -9
- package/dist/src/tools/createMock.js +8 -8
- package/dist/src/tools/createMonitor.js +6 -6
- package/dist/src/tools/createRequestComment.js +9 -9
- package/dist/src/tools/createResponseComment.js +9 -9
- package/dist/src/tools/createSpec.js +10 -10
- package/dist/src/tools/createSpecFile.js +7 -7
- package/dist/src/tools/createWorkspace.js +4 -4
- package/dist/src/tools/deleteApiCollectionComment.js +3 -3
- package/dist/src/tools/deleteCollection.js +3 -3
- package/dist/src/tools/deleteCollectionComment.js +3 -3
- package/dist/src/tools/deleteCollectionFolder.js +3 -3
- package/dist/src/tools/deleteCollectionRequest.js +3 -3
- package/dist/src/tools/deleteCollectionResponse.js +3 -3
- package/dist/src/tools/deleteEnvironment.js +3 -3
- package/dist/src/tools/deleteFolderComment.js +3 -3
- package/dist/src/tools/deleteMock.js +5 -5
- package/dist/src/tools/deleteMonitor.js +3 -3
- package/dist/src/tools/deletePanElementOrFolder.js +3 -3
- package/dist/src/tools/deleteRequestComment.js +3 -3
- package/dist/src/tools/deleteResponseComment.js +3 -3
- package/dist/src/tools/deleteSpec.js +3 -3
- package/dist/src/tools/deleteSpecFile.js +3 -3
- package/dist/src/tools/deleteWorkspace.js +3 -3
- package/dist/src/tools/duplicateCollection.js +7 -7
- package/dist/src/tools/generateCollection.js +11 -11
- package/dist/src/tools/generateSpecFromCollection.js +9 -9
- package/dist/src/tools/getAllElementsAndFolders.js +28 -28
- package/dist/src/tools/getAllPanAddElementRequests.js +22 -22
- package/dist/src/tools/getAllSpecs.js +8 -8
- package/dist/src/tools/getAsyncSpecTaskStatus.js +3 -3
- package/dist/src/tools/getAuthenticatedUser.js +4 -4
- package/dist/src/tools/getCollection.js +7 -7
- package/dist/src/tools/getCollectionComments.js +3 -3
- package/dist/src/tools/getCollectionFolder.js +9 -9
- package/dist/src/tools/getCollectionForks.js +9 -9
- package/dist/src/tools/getCollectionRequest.js +9 -9
- package/dist/src/tools/getCollectionResponse.js +9 -9
- package/dist/src/tools/getCollectionTags.js +3 -3
- package/dist/src/tools/getCollectionUpdatesTasks.js +3 -3
- package/dist/src/tools/getCollections.js +10 -10
- package/dist/src/tools/getCollectionsForkedByUser.js +8 -8
- package/dist/src/tools/getDuplicateCollectionTaskStatus.js +3 -3
- package/dist/src/tools/getEnvironment.js +3 -3
- package/dist/src/tools/getEnvironments.js +4 -4
- package/dist/src/tools/getFolderComments.js +3 -3
- package/dist/src/tools/getGeneratedCollectionSpecs.js +3 -3
- package/dist/src/tools/getMock.js +5 -5
- package/dist/src/tools/getMocks.js +16 -10
- package/dist/src/tools/getMonitor.js +3 -3
- package/dist/src/tools/getMonitors.js +16 -16
- package/dist/src/tools/getRequestComments.js +3 -3
- package/dist/src/tools/getResponseComments.js +3 -3
- package/dist/src/tools/getSourceCollectionStatus.js +3 -3
- package/dist/src/tools/getSpec.js +3 -3
- package/dist/src/tools/getSpecCollections.js +7 -7
- package/dist/src/tools/getSpecDefinition.js +3 -3
- package/dist/src/tools/getSpecFile.js +3 -3
- package/dist/src/tools/getSpecFiles.js +3 -3
- package/dist/src/tools/getStatusOfAnAsyncApiTask.js +3 -3
- package/dist/src/tools/getTaggedEntities.js +11 -11
- package/dist/src/tools/getWorkspace.js +5 -5
- package/dist/src/tools/getWorkspaceGlobalVariables.js +3 -3
- package/dist/src/tools/getWorkspaceTags.js +3 -3
- package/dist/src/tools/getWorkspaces.js +12 -12
- package/dist/src/tools/mergeCollectionFork.js +8 -8
- package/dist/src/tools/patchCollection.js +5 -5
- package/dist/src/tools/patchEnvironment.js +50 -4
- package/dist/src/tools/postPanElementOrFolder.js +51 -3
- package/dist/src/tools/publishDocumentation.js +11 -11
- package/dist/src/tools/publishMock.js +3 -3
- package/dist/src/tools/pullCollectionChanges.js +3 -3
- package/dist/src/tools/putCollection.js +13 -17
- package/dist/src/tools/putEnvironment.js +5 -5
- package/dist/src/tools/resolveCommentThread.js +3 -3
- package/dist/src/tools/runMonitor.js +5 -5
- package/dist/src/tools/syncCollectionWithSpec.js +5 -5
- package/dist/src/tools/syncSpecWithCollection.js +5 -5
- package/dist/src/tools/transferCollectionFolders.js +10 -10
- package/dist/src/tools/transferCollectionRequests.js +10 -10
- package/dist/src/tools/transferCollectionResponses.js +10 -10
- package/dist/src/tools/unpublishDocumentation.js +3 -3
- package/dist/src/tools/unpublishMock.js +3 -3
- package/dist/src/tools/updateApiCollectionComment.js +7 -7
- package/dist/src/tools/updateCollectionComment.js +7 -7
- package/dist/src/tools/updateCollectionFolder.js +7 -7
- package/dist/src/tools/updateCollectionRequest.js +7 -7
- package/dist/src/tools/updateCollectionResponse.js +7 -7
- package/dist/src/tools/updateCollectionTags.js +5 -5
- package/dist/src/tools/updateFolderComment.js +7 -7
- package/dist/src/tools/updateMock.js +7 -7
- package/dist/src/tools/updateMonitor.js +5 -5
- package/dist/src/tools/updatePanElementOrFolder.js +62 -3
- package/dist/src/tools/updateRequestComment.js +7 -7
- package/dist/src/tools/updateResponseComment.js +7 -7
- package/dist/src/tools/updateSpecFile.js +9 -9
- package/dist/src/tools/updateSpecProperties.js +5 -5
- package/dist/src/tools/updateWorkspace.js +5 -5
- package/dist/src/tools/updateWorkspaceGlobalVariables.js +5 -5
- package/dist/src/tools/updateWorkspaceTags.js +5 -5
- package/package.json +18 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -25,16 +25,16 @@ export const annotations = {
|
|
|
25
25
|
destructiveHint: false,
|
|
26
26
|
idempotentHint: true,
|
|
27
27
|
};
|
|
28
|
-
export async function handler(
|
|
28
|
+
export async function handler(args, extra) {
|
|
29
29
|
try {
|
|
30
|
-
const endpoint = `/collections/${
|
|
30
|
+
const endpoint = `/collections/${args.collectionId}/responses/${args.responseId}`;
|
|
31
31
|
const query = new URLSearchParams();
|
|
32
32
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
33
33
|
const bodyPayload = {};
|
|
34
|
-
if (
|
|
35
|
-
bodyPayload.name =
|
|
36
|
-
if (
|
|
37
|
-
bodyPayload.responseCode =
|
|
34
|
+
if (args.name !== undefined)
|
|
35
|
+
bodyPayload.name = args.name;
|
|
36
|
+
if (args.responseCode !== undefined)
|
|
37
|
+
bodyPayload.responseCode = args.responseCode;
|
|
38
38
|
const options = {
|
|
39
39
|
body: JSON.stringify(bodyPayload),
|
|
40
40
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -30,14 +30,14 @@ export const annotations = {
|
|
|
30
30
|
destructiveHint: false,
|
|
31
31
|
idempotentHint: true,
|
|
32
32
|
};
|
|
33
|
-
export async function handler(
|
|
33
|
+
export async function handler(args, extra) {
|
|
34
34
|
try {
|
|
35
|
-
const endpoint = `/collections/${
|
|
35
|
+
const endpoint = `/collections/${args.collectionId}/tags`;
|
|
36
36
|
const query = new URLSearchParams();
|
|
37
37
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
38
38
|
const bodyPayload = {};
|
|
39
|
-
if (
|
|
40
|
-
bodyPayload.tags =
|
|
39
|
+
if (args.tags !== undefined)
|
|
40
|
+
bodyPayload.tags = args.tags;
|
|
41
41
|
const options = {
|
|
42
42
|
body: JSON.stringify(bodyPayload),
|
|
43
43
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -31,16 +31,16 @@ export const annotations = {
|
|
|
31
31
|
destructiveHint: false,
|
|
32
32
|
idempotentHint: true,
|
|
33
33
|
};
|
|
34
|
-
export async function handler(
|
|
34
|
+
export async function handler(args, extra) {
|
|
35
35
|
try {
|
|
36
|
-
const endpoint = `/collections/${
|
|
36
|
+
const endpoint = `/collections/${args.collectionId}/folders/${args.folderId}/comments/${args.commentId}`;
|
|
37
37
|
const query = new URLSearchParams();
|
|
38
38
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
39
39
|
const bodyPayload = {};
|
|
40
|
-
if (
|
|
41
|
-
bodyPayload.body =
|
|
42
|
-
if (
|
|
43
|
-
bodyPayload.tags =
|
|
40
|
+
if (args.body !== undefined)
|
|
41
|
+
bodyPayload.body = args.body;
|
|
42
|
+
if (args.tags !== undefined)
|
|
43
|
+
bodyPayload.tags = args.tags;
|
|
44
44
|
const options = {
|
|
45
45
|
body: JSON.stringify(bodyPayload),
|
|
46
46
|
contentType: ContentType.Json,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
7
7
|
}
|
|
8
8
|
export const method = 'updateMock';
|
|
9
|
-
export const description = 'Updates a mock server
|
|
9
|
+
export const description = 'Updates a mock server.\n- Resource: Mock server entity associated with a collection UID.\n- Use this to change name, environment, privacy, or default server response.\n';
|
|
10
10
|
export const parameters = z.object({
|
|
11
11
|
mockId: z.string().describe("The mock's ID."),
|
|
12
12
|
mock: z
|
|
@@ -33,19 +33,19 @@ export const parameters = z.object({
|
|
|
33
33
|
.optional(),
|
|
34
34
|
});
|
|
35
35
|
export const annotations = {
|
|
36
|
-
title: 'Updates a mock server
|
|
36
|
+
title: 'Updates a mock server.\n- Resource: Mock server entity associated with a collection UID.\n- Use this to change name, environment, privacy, or default server response.\n',
|
|
37
37
|
readOnlyHint: false,
|
|
38
38
|
destructiveHint: false,
|
|
39
39
|
idempotentHint: true,
|
|
40
40
|
};
|
|
41
|
-
export async function handler(
|
|
41
|
+
export async function handler(args, extra) {
|
|
42
42
|
try {
|
|
43
|
-
const endpoint = `/mocks/${
|
|
43
|
+
const endpoint = `/mocks/${args.mockId}`;
|
|
44
44
|
const query = new URLSearchParams();
|
|
45
45
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
46
46
|
const bodyPayload = {};
|
|
47
|
-
if (
|
|
48
|
-
bodyPayload.mock =
|
|
47
|
+
if (args.mock !== undefined)
|
|
48
|
+
bodyPayload.mock = args.mock;
|
|
49
49
|
const options = {
|
|
50
50
|
body: JSON.stringify(bodyPayload),
|
|
51
51
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -117,14 +117,14 @@ export const annotations = {
|
|
|
117
117
|
destructiveHint: false,
|
|
118
118
|
idempotentHint: true,
|
|
119
119
|
};
|
|
120
|
-
export async function handler(
|
|
120
|
+
export async function handler(args, extra) {
|
|
121
121
|
try {
|
|
122
|
-
const endpoint = `/monitors/${
|
|
122
|
+
const endpoint = `/monitors/${args.monitorId}`;
|
|
123
123
|
const query = new URLSearchParams();
|
|
124
124
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
125
125
|
const bodyPayload = {};
|
|
126
|
-
if (
|
|
127
|
-
bodyPayload.monitor =
|
|
126
|
+
if (args.monitor !== undefined)
|
|
127
|
+
bodyPayload.monitor = args.monitor;
|
|
128
128
|
const options = {
|
|
129
129
|
body: JSON.stringify(bodyPayload),
|
|
130
130
|
contentType: ContentType.Json,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ContentType } from '../clients/postman.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
4
|
function asMcpError(error) {
|
|
4
5
|
const cause = error?.cause ?? String(error);
|
|
5
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -11,6 +12,61 @@ export const parameters = z.object({
|
|
|
11
12
|
.string()
|
|
12
13
|
.describe("The element's ID or UUID. For Postman Collections you must pass the collection's UID (`userId`-`collectionId`) value."),
|
|
13
14
|
elementType: z.enum(['api', 'folder', 'collection', 'workspace']).describe('The element type.'),
|
|
15
|
+
body: z.union([
|
|
16
|
+
z.object({
|
|
17
|
+
api: z
|
|
18
|
+
.object({
|
|
19
|
+
parentFolderId: z.number().int().describe("The API's new parent folder ID.").optional(),
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
22
|
+
}),
|
|
23
|
+
z.object({
|
|
24
|
+
collection: z
|
|
25
|
+
.object({
|
|
26
|
+
parentFolderId: z
|
|
27
|
+
.number()
|
|
28
|
+
.int()
|
|
29
|
+
.describe("The collection's new parent folder ID.")
|
|
30
|
+
.optional(),
|
|
31
|
+
environments: z
|
|
32
|
+
.object({
|
|
33
|
+
$add: z
|
|
34
|
+
.array(z.string().describe('The ID of environment to add to the collection.'))
|
|
35
|
+
.optional(),
|
|
36
|
+
$remove: z
|
|
37
|
+
.array(z.string().describe('The ID of environment to remove from the collection.'))
|
|
38
|
+
.optional(),
|
|
39
|
+
})
|
|
40
|
+
.describe("The collection's updated environments.")
|
|
41
|
+
.optional(),
|
|
42
|
+
})
|
|
43
|
+
.optional(),
|
|
44
|
+
}),
|
|
45
|
+
z.object({
|
|
46
|
+
workspace: z
|
|
47
|
+
.object({
|
|
48
|
+
parentFolderId: z
|
|
49
|
+
.number()
|
|
50
|
+
.int()
|
|
51
|
+
.describe("The workspace's new parent folder ID.")
|
|
52
|
+
.optional(),
|
|
53
|
+
})
|
|
54
|
+
.optional(),
|
|
55
|
+
}),
|
|
56
|
+
z.object({
|
|
57
|
+
folder: z
|
|
58
|
+
.object({
|
|
59
|
+
name: z.string().describe("The folder's new name.").optional(),
|
|
60
|
+
description: z.string().describe("The folder's updated description.").optional(),
|
|
61
|
+
parentFolderId: z
|
|
62
|
+
.number()
|
|
63
|
+
.int()
|
|
64
|
+
.describe("The folder's new parent folder ID.")
|
|
65
|
+
.optional(),
|
|
66
|
+
})
|
|
67
|
+
.optional(),
|
|
68
|
+
}),
|
|
69
|
+
]),
|
|
14
70
|
});
|
|
15
71
|
export const annotations = {
|
|
16
72
|
title: "Updates an element or folder in your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).\n\n**Note:**\n\nYou can only pass one element object type per call. For example, you cannot pass both \\`api\\` and \\`collection\\` in a single request.\n",
|
|
@@ -18,12 +74,15 @@ export const annotations = {
|
|
|
18
74
|
destructiveHint: false,
|
|
19
75
|
idempotentHint: true,
|
|
20
76
|
};
|
|
21
|
-
export async function handler(
|
|
77
|
+
export async function handler(args, extra) {
|
|
22
78
|
try {
|
|
23
|
-
const endpoint = `/network/private/${
|
|
79
|
+
const endpoint = `/network/private/${args.elementType}/${args.elementId}`;
|
|
24
80
|
const query = new URLSearchParams();
|
|
25
81
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
82
|
+
const bodyPayload = args.body;
|
|
26
83
|
const options = {
|
|
84
|
+
body: JSON.stringify(bodyPayload),
|
|
85
|
+
contentType: ContentType.Json,
|
|
27
86
|
headers: extra.headers,
|
|
28
87
|
};
|
|
29
88
|
const result = await extra.client.put(url, options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -31,16 +31,16 @@ export const annotations = {
|
|
|
31
31
|
destructiveHint: false,
|
|
32
32
|
idempotentHint: true,
|
|
33
33
|
};
|
|
34
|
-
export async function handler(
|
|
34
|
+
export async function handler(args, extra) {
|
|
35
35
|
try {
|
|
36
|
-
const endpoint = `/collections/${
|
|
36
|
+
const endpoint = `/collections/${args.collectionId}/requests/${args.requestId}/comments/${args.commentId}`;
|
|
37
37
|
const query = new URLSearchParams();
|
|
38
38
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
39
39
|
const bodyPayload = {};
|
|
40
|
-
if (
|
|
41
|
-
bodyPayload.body =
|
|
42
|
-
if (
|
|
43
|
-
bodyPayload.tags =
|
|
40
|
+
if (args.body !== undefined)
|
|
41
|
+
bodyPayload.body = args.body;
|
|
42
|
+
if (args.tags !== undefined)
|
|
43
|
+
bodyPayload.tags = args.tags;
|
|
44
44
|
const options = {
|
|
45
45
|
body: JSON.stringify(bodyPayload),
|
|
46
46
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -31,16 +31,16 @@ export const annotations = {
|
|
|
31
31
|
destructiveHint: false,
|
|
32
32
|
idempotentHint: true,
|
|
33
33
|
};
|
|
34
|
-
export async function handler(
|
|
34
|
+
export async function handler(args, extra) {
|
|
35
35
|
try {
|
|
36
|
-
const endpoint = `/collections/${
|
|
36
|
+
const endpoint = `/collections/${args.collectionId}/responses/${args.responseId}/comments/${args.commentId}`;
|
|
37
37
|
const query = new URLSearchParams();
|
|
38
38
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
39
39
|
const bodyPayload = {};
|
|
40
|
-
if (
|
|
41
|
-
bodyPayload.body =
|
|
42
|
-
if (
|
|
43
|
-
bodyPayload.tags =
|
|
40
|
+
if (args.body !== undefined)
|
|
41
|
+
bodyPayload.body = args.body;
|
|
42
|
+
if (args.tags !== undefined)
|
|
43
|
+
bodyPayload.tags = args.tags;
|
|
44
44
|
const options = {
|
|
45
45
|
body: JSON.stringify(bodyPayload),
|
|
46
46
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -23,18 +23,18 @@ export const annotations = {
|
|
|
23
23
|
destructiveHint: false,
|
|
24
24
|
idempotentHint: true,
|
|
25
25
|
};
|
|
26
|
-
export async function handler(
|
|
26
|
+
export async function handler(args, extra) {
|
|
27
27
|
try {
|
|
28
|
-
const endpoint = `/specs/${
|
|
28
|
+
const endpoint = `/specs/${args.specId}/files/${args.filePath}`;
|
|
29
29
|
const query = new URLSearchParams();
|
|
30
30
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
31
31
|
const bodyPayload = {};
|
|
32
|
-
if (
|
|
33
|
-
bodyPayload.name =
|
|
34
|
-
if (
|
|
35
|
-
bodyPayload.type =
|
|
36
|
-
if (
|
|
37
|
-
bodyPayload.content =
|
|
32
|
+
if (args.name !== undefined)
|
|
33
|
+
bodyPayload.name = args.name;
|
|
34
|
+
if (args.type !== undefined)
|
|
35
|
+
bodyPayload.type = args.type;
|
|
36
|
+
if (args.content !== undefined)
|
|
37
|
+
bodyPayload.content = args.content;
|
|
38
38
|
const options = {
|
|
39
39
|
body: JSON.stringify(bodyPayload),
|
|
40
40
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -17,14 +17,14 @@ export const annotations = {
|
|
|
17
17
|
destructiveHint: false,
|
|
18
18
|
idempotentHint: true,
|
|
19
19
|
};
|
|
20
|
-
export async function handler(
|
|
20
|
+
export async function handler(args, extra) {
|
|
21
21
|
try {
|
|
22
|
-
const endpoint = `/specs/${
|
|
22
|
+
const endpoint = `/specs/${args.specId}`;
|
|
23
23
|
const query = new URLSearchParams();
|
|
24
24
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
25
25
|
const bodyPayload = {};
|
|
26
|
-
if (
|
|
27
|
-
bodyPayload.name =
|
|
26
|
+
if (args.name !== undefined)
|
|
27
|
+
bodyPayload.name = args.name;
|
|
28
28
|
const options = {
|
|
29
29
|
body: JSON.stringify(bodyPayload),
|
|
30
30
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -27,14 +27,14 @@ export const annotations = {
|
|
|
27
27
|
destructiveHint: false,
|
|
28
28
|
idempotentHint: true,
|
|
29
29
|
};
|
|
30
|
-
export async function handler(
|
|
30
|
+
export async function handler(args, extra) {
|
|
31
31
|
try {
|
|
32
|
-
const endpoint = `/workspaces/${
|
|
32
|
+
const endpoint = `/workspaces/${args.workspaceId}`;
|
|
33
33
|
const query = new URLSearchParams();
|
|
34
34
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
35
35
|
const bodyPayload = {};
|
|
36
|
-
if (
|
|
37
|
-
bodyPayload.workspace =
|
|
36
|
+
if (args.workspace !== undefined)
|
|
37
|
+
bodyPayload.workspace = args.workspace;
|
|
38
38
|
const options = {
|
|
39
39
|
body: JSON.stringify(bodyPayload),
|
|
40
40
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -31,14 +31,14 @@ export const annotations = {
|
|
|
31
31
|
destructiveHint: false,
|
|
32
32
|
idempotentHint: true,
|
|
33
33
|
};
|
|
34
|
-
export async function handler(
|
|
34
|
+
export async function handler(args, extra) {
|
|
35
35
|
try {
|
|
36
|
-
const endpoint = `/workspaces/${
|
|
36
|
+
const endpoint = `/workspaces/${args.workspaceId}/global-variables`;
|
|
37
37
|
const query = new URLSearchParams();
|
|
38
38
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
39
39
|
const bodyPayload = {};
|
|
40
|
-
if (
|
|
41
|
-
bodyPayload.values =
|
|
40
|
+
if (args.values !== undefined)
|
|
41
|
+
bodyPayload.values = args.values;
|
|
42
42
|
const options = {
|
|
43
43
|
body: JSON.stringify(bodyPayload),
|
|
44
44
|
contentType: ContentType.Json,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ContentType } from '../clients/postman.js';
|
|
3
|
-
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { McpError, ErrorCode, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
function asMcpError(error) {
|
|
5
5
|
const cause = error?.cause ?? String(error);
|
|
6
6
|
return new McpError(ErrorCode.InternalError, cause);
|
|
@@ -30,14 +30,14 @@ export const annotations = {
|
|
|
30
30
|
destructiveHint: false,
|
|
31
31
|
idempotentHint: true,
|
|
32
32
|
};
|
|
33
|
-
export async function handler(
|
|
33
|
+
export async function handler(args, extra) {
|
|
34
34
|
try {
|
|
35
|
-
const endpoint = `/workspaces/${
|
|
35
|
+
const endpoint = `/workspaces/${args.workspaceId}/tags`;
|
|
36
36
|
const query = new URLSearchParams();
|
|
37
37
|
const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
|
|
38
38
|
const bodyPayload = {};
|
|
39
|
-
if (
|
|
40
|
-
bodyPayload.tags =
|
|
39
|
+
if (args.tags !== undefined)
|
|
40
|
+
bodyPayload.tags = args.tags;
|
|
41
41
|
const options = {
|
|
42
42
|
body: JSON.stringify(bodyPayload),
|
|
43
43
|
contentType: ContentType.Json,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postman/postman-mcp-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A simple MCP server to operate on the Postman API",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -22,28 +22,28 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@apidevtools/swagger-parser": "^
|
|
26
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
27
|
-
"dotenv": "^
|
|
28
|
-
"es-toolkit": "^1.
|
|
25
|
+
"@apidevtools/swagger-parser": "^12.0.0",
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.18.1",
|
|
27
|
+
"dotenv": "^17.2.2",
|
|
28
|
+
"es-toolkit": "^1.39.10",
|
|
29
29
|
"express": "^5.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@eslint/js": "^9.
|
|
33
|
-
"@types/express": "^5.0.
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"eslint": "^9.
|
|
36
|
-
"eslint-config-prettier": "^10.1.
|
|
37
|
-
"eslint-plugin-prettier": "^5.4
|
|
38
|
-
"eslint-plugin-unused-imports": "^4.
|
|
39
|
-
"fs-extra": "^11.3.
|
|
40
|
-
"jest": "^
|
|
32
|
+
"@eslint/js": "^9.35.0",
|
|
33
|
+
"@types/express": "^5.0.3",
|
|
34
|
+
"@types/node": "^24",
|
|
35
|
+
"eslint": "^9.35.0",
|
|
36
|
+
"eslint-config-prettier": "^10.1.8",
|
|
37
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
38
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
39
|
+
"fs-extra": "^11.3.2",
|
|
40
|
+
"jest": "^30.1.3",
|
|
41
41
|
"json-schema-to-zod": "^2.6.1",
|
|
42
42
|
"openapi-types": "^12.1.3",
|
|
43
|
-
"prettier": "^3.
|
|
44
|
-
"tsx": "^4.
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"typescript-eslint": "^8.
|
|
43
|
+
"prettier": "^3.6.2",
|
|
44
|
+
"tsx": "^4.20.5",
|
|
45
|
+
"typescript": "^5.9.2",
|
|
46
|
+
"typescript-eslint": "^8.44.0",
|
|
47
47
|
"vitest": "^3.2.4"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|