@postman/postman-mcp-server 2.1.4 → 2.2.0-alpha.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.
Files changed (112) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/clients/postman.js +68 -29
  3. package/dist/src/enabledResources.js +3 -2
  4. package/dist/src/index.js +38 -17
  5. package/dist/src/tools/createCollection.js +4 -5
  6. package/dist/src/tools/createCollectionComment.js +5 -6
  7. package/dist/src/tools/createCollectionFolder.js +4 -5
  8. package/dist/src/tools/createCollectionFork.js +4 -5
  9. package/dist/src/tools/createCollectionRequest.js +4 -5
  10. package/dist/src/tools/createCollectionResponse.js +4 -5
  11. package/dist/src/tools/createEnvironment.js +13 -8
  12. package/dist/src/tools/createFolderComment.js +5 -6
  13. package/dist/src/tools/createMock.js +4 -5
  14. package/dist/src/tools/createMonitor.js +5 -5
  15. package/dist/src/tools/createRequestComment.js +5 -6
  16. package/dist/src/tools/createResponseComment.js +5 -6
  17. package/dist/src/tools/createSpec.js +17 -29
  18. package/dist/src/tools/createSpecFile.js +4 -5
  19. package/dist/src/tools/createWorkspace.js +4 -5
  20. package/dist/src/tools/deleteApiCollectionComment.js +3 -5
  21. package/dist/src/tools/deleteCollection.js +3 -5
  22. package/dist/src/tools/deleteCollectionComment.js +3 -5
  23. package/dist/src/tools/deleteCollectionFolder.js +3 -5
  24. package/dist/src/tools/deleteCollectionRequest.js +3 -5
  25. package/dist/src/tools/deleteCollectionResponse.js +3 -5
  26. package/dist/src/tools/deleteEnvironment.js +3 -5
  27. package/dist/src/tools/deleteFolderComment.js +3 -5
  28. package/dist/src/tools/deleteMock.js +3 -5
  29. package/dist/src/tools/deleteMonitor.js +3 -5
  30. package/dist/src/tools/deletePanElementOrFolder.js +3 -5
  31. package/dist/src/tools/deleteRequestComment.js +3 -5
  32. package/dist/src/tools/deleteResponseComment.js +3 -5
  33. package/dist/src/tools/deleteSpec.js +3 -5
  34. package/dist/src/tools/deleteSpecFile.js +3 -5
  35. package/dist/src/tools/deleteWorkspace.js +3 -5
  36. package/dist/src/tools/duplicateCollection.js +4 -5
  37. package/dist/src/tools/generateCollection.js +8 -5
  38. package/dist/src/tools/generateSpecFromCollection.js +4 -5
  39. package/dist/src/tools/getAllElementsAndFolders.js +3 -5
  40. package/dist/src/tools/getAllPanAddElementRequests.js +3 -5
  41. package/dist/src/tools/getAllSpecs.js +3 -5
  42. package/dist/src/tools/getAsyncSpecTaskStatus.js +3 -5
  43. package/dist/src/tools/getAuthenticatedUser.js +3 -5
  44. package/dist/src/tools/getCollection.js +3 -5
  45. package/dist/src/tools/getCollectionComments.js +3 -5
  46. package/dist/src/tools/getCollectionFolder.js +3 -5
  47. package/dist/src/tools/getCollectionForks.js +3 -5
  48. package/dist/src/tools/getCollectionRequest.js +3 -5
  49. package/dist/src/tools/getCollectionResponse.js +3 -5
  50. package/dist/src/tools/getCollectionTags.js +3 -5
  51. package/dist/src/tools/getCollectionUpdatesTasks.js +3 -5
  52. package/dist/src/tools/getCollections.js +3 -5
  53. package/dist/src/tools/getCollectionsForkedByUser.js +3 -5
  54. package/dist/src/tools/getDuplicateCollectionTaskStatus.js +3 -5
  55. package/dist/src/tools/getEnvironment.js +3 -5
  56. package/dist/src/tools/getEnvironments.js +3 -5
  57. package/dist/src/tools/getFolderComments.js +3 -5
  58. package/dist/src/tools/getGeneratedCollectionSpecs.js +3 -5
  59. package/dist/src/tools/getMock.js +3 -5
  60. package/dist/src/tools/getMocks.js +3 -5
  61. package/dist/src/tools/getMonitor.js +3 -5
  62. package/dist/src/tools/getMonitors.js +3 -5
  63. package/dist/src/tools/getRequestComments.js +3 -5
  64. package/dist/src/tools/getResponseComments.js +3 -5
  65. package/dist/src/tools/getSourceCollectionStatus.js +3 -5
  66. package/dist/src/tools/getSpec.js +3 -5
  67. package/dist/src/tools/getSpecCollections.js +3 -5
  68. package/dist/src/tools/getSpecDefinition.js +3 -5
  69. package/dist/src/tools/getSpecFile.js +3 -5
  70. package/dist/src/tools/getSpecFiles.js +3 -5
  71. package/dist/src/tools/{getStatusOfAnAsyncTask.js → getStatusOfAnAsyncApiTask.js} +4 -6
  72. package/dist/src/tools/getTaggedEntities.js +3 -5
  73. package/dist/src/tools/getWorkspace.js +3 -5
  74. package/dist/src/tools/getWorkspaceGlobalVariables.js +3 -5
  75. package/dist/src/tools/getWorkspaceTags.js +3 -5
  76. package/dist/src/tools/getWorkspaces.js +3 -5
  77. package/dist/src/tools/mergeCollectionFork.js +57 -0
  78. package/dist/src/tools/patchCollection.js +12 -16
  79. package/dist/src/tools/patchEnvironment.js +5 -7
  80. package/dist/src/tools/postPanElementOrFolder.js +3 -5
  81. package/dist/src/tools/publishDocumentation.js +4 -5
  82. package/dist/src/tools/publishMock.js +3 -5
  83. package/dist/src/tools/pullCollectionChanges.js +3 -5
  84. package/dist/src/tools/putCollection.js +4 -5
  85. package/dist/src/tools/putEnvironment.js +13 -8
  86. package/dist/src/tools/resolveCommentThread.js +3 -5
  87. package/dist/src/tools/runMonitor.js +5 -7
  88. package/dist/src/tools/syncCollectionWithSpec.js +3 -5
  89. package/dist/src/tools/syncSpecWithCollection.js +3 -5
  90. package/dist/src/tools/transferCollectionFolders.js +4 -5
  91. package/dist/src/tools/transferCollectionRequests.js +4 -5
  92. package/dist/src/tools/transferCollectionResponses.js +4 -5
  93. package/dist/src/tools/unpublishDocumentation.js +3 -5
  94. package/dist/src/tools/unpublishMock.js +3 -5
  95. package/dist/src/tools/updateApiCollectionComment.js +4 -5
  96. package/dist/src/tools/updateCollectionComment.js +4 -5
  97. package/dist/src/tools/updateCollectionFolder.js +4 -5
  98. package/dist/src/tools/updateCollectionRequest.js +4 -5
  99. package/dist/src/tools/updateCollectionResponse.js +4 -5
  100. package/dist/src/tools/updateCollectionTags.js +4 -5
  101. package/dist/src/tools/updateFolderComment.js +4 -5
  102. package/dist/src/tools/updateMock.js +4 -5
  103. package/dist/src/tools/updateMonitor.js +5 -5
  104. package/dist/src/tools/updatePanElementOrFolder.js +3 -5
  105. package/dist/src/tools/updateRequestComment.js +4 -5
  106. package/dist/src/tools/updateResponseComment.js +4 -5
  107. package/dist/src/tools/updateSpecFile.js +4 -5
  108. package/dist/src/tools/updateSpecProperties.js +4 -5
  109. package/dist/src/tools/updateWorkspace.js +4 -5
  110. package/dist/src/tools/updateWorkspaceGlobalVariables.js +5 -5
  111. package/dist/src/tools/updateWorkspaceTags.js +4 -5
  112. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -35,13 +35,12 @@ export async function handler(params, extra) {
35
35
  bodyPayload.name = params.name;
36
36
  if (params.responseCode !== undefined)
37
37
  bodyPayload.responseCode = params.responseCode;
38
- const result = await fetchPostmanAPI(url, {
39
- method: 'PUT',
38
+ const options = {
40
39
  body: JSON.stringify(bodyPayload),
41
40
  contentType: ContentType.Json,
42
- apiKey: extra.apiKey,
43
41
  headers: extra.headers,
44
- });
42
+ };
43
+ const result = await extra.client.put(url, options);
45
44
  return {
46
45
  content: [
47
46
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -38,13 +38,12 @@ export async function handler(params, extra) {
38
38
  const bodyPayload = {};
39
39
  if (params.tags !== undefined)
40
40
  bodyPayload.tags = params.tags;
41
- const result = await fetchPostmanAPI(url, {
42
- method: 'PUT',
41
+ const options = {
43
42
  body: JSON.stringify(bodyPayload),
44
43
  contentType: ContentType.Json,
45
- apiKey: extra.apiKey,
46
44
  headers: extra.headers,
47
- });
45
+ };
46
+ const result = await extra.client.put(url, options);
48
47
  return {
49
48
  content: [
50
49
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -41,13 +41,12 @@ export async function handler(params, extra) {
41
41
  bodyPayload.body = params.body;
42
42
  if (params.tags !== undefined)
43
43
  bodyPayload.tags = params.tags;
44
- const result = await fetchPostmanAPI(url, {
45
- method: 'PUT',
44
+ const options = {
46
45
  body: JSON.stringify(bodyPayload),
47
46
  contentType: ContentType.Json,
48
- apiKey: extra.apiKey,
49
47
  headers: extra.headers,
50
- });
48
+ };
49
+ const result = await extra.client.put(url, options);
51
50
  return {
52
51
  content: [
53
52
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -46,13 +46,12 @@ export async function handler(params, extra) {
46
46
  const bodyPayload = {};
47
47
  if (params.mock !== undefined)
48
48
  bodyPayload.mock = params.mock;
49
- const result = await fetchPostmanAPI(url, {
50
- method: 'PUT',
49
+ const options = {
51
50
  body: JSON.stringify(bodyPayload),
52
51
  contentType: ContentType.Json,
53
- apiKey: extra.apiKey,
54
52
  headers: extra.headers,
55
- });
53
+ };
54
+ const result = await extra.client.put(url, options);
56
55
  return {
57
56
  content: [
58
57
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -31,6 +31,7 @@ export const parameters = z.object({
31
31
  .describe('The number of times to reattempt a monitor run if it fails or errors. This may impact your [monitor usage](https://learning.postman.com/docs/monitoring-your-api/monitor-usage/#view-monitor-usage).')
32
32
  .optional(),
33
33
  })
34
+ .describe("Information about the monitor's retry settings.")
34
35
  .optional(),
35
36
  options: z
36
37
  .object({
@@ -124,13 +125,12 @@ export async function handler(params, extra) {
124
125
  const bodyPayload = {};
125
126
  if (params.monitor !== undefined)
126
127
  bodyPayload.monitor = params.monitor;
127
- const result = await fetchPostmanAPI(url, {
128
- method: 'PUT',
128
+ const options = {
129
129
  body: JSON.stringify(bodyPayload),
130
130
  contentType: ContentType.Json,
131
- apiKey: extra.apiKey,
132
131
  headers: extra.headers,
133
- });
132
+ };
133
+ const result = await extra.client.put(url, options);
134
134
  return {
135
135
  content: [
136
136
  {
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI } from '../clients/postman.js';
3
2
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
3
  function asMcpError(error) {
5
4
  const cause = error?.cause ?? String(error);
@@ -24,11 +23,10 @@ export async function handler(params, extra) {
24
23
  const endpoint = `/network/private/${params.elementType}/${params.elementId}`;
25
24
  const query = new URLSearchParams();
26
25
  const url = query.toString() ? `${endpoint}?${query.toString()}` : endpoint;
27
- const result = await fetchPostmanAPI(url, {
28
- method: 'PUT',
29
- apiKey: extra.apiKey,
26
+ const options = {
30
27
  headers: extra.headers,
31
- });
28
+ };
29
+ const result = await extra.client.put(url, options);
32
30
  return {
33
31
  content: [
34
32
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -41,13 +41,12 @@ export async function handler(params, extra) {
41
41
  bodyPayload.body = params.body;
42
42
  if (params.tags !== undefined)
43
43
  bodyPayload.tags = params.tags;
44
- const result = await fetchPostmanAPI(url, {
45
- method: 'PUT',
44
+ const options = {
46
45
  body: JSON.stringify(bodyPayload),
47
46
  contentType: ContentType.Json,
48
- apiKey: extra.apiKey,
49
47
  headers: extra.headers,
50
- });
48
+ };
49
+ const result = await extra.client.put(url, options);
51
50
  return {
52
51
  content: [
53
52
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -41,13 +41,12 @@ export async function handler(params, extra) {
41
41
  bodyPayload.body = params.body;
42
42
  if (params.tags !== undefined)
43
43
  bodyPayload.tags = params.tags;
44
- const result = await fetchPostmanAPI(url, {
45
- method: 'PUT',
44
+ const options = {
46
45
  body: JSON.stringify(bodyPayload),
47
46
  contentType: ContentType.Json,
48
- apiKey: extra.apiKey,
49
47
  headers: extra.headers,
50
- });
48
+ };
49
+ const result = await extra.client.put(url, options);
51
50
  return {
52
51
  content: [
53
52
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -35,13 +35,12 @@ export async function handler(params, extra) {
35
35
  bodyPayload.type = params.type;
36
36
  if (params.content !== undefined)
37
37
  bodyPayload.content = params.content;
38
- const result = await fetchPostmanAPI(url, {
39
- method: 'PATCH',
38
+ const options = {
40
39
  body: JSON.stringify(bodyPayload),
41
40
  contentType: ContentType.Json,
42
- apiKey: extra.apiKey,
43
41
  headers: extra.headers,
44
- });
42
+ };
43
+ const result = await extra.client.patch(url, options);
45
44
  return {
46
45
  content: [
47
46
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -25,13 +25,12 @@ export async function handler(params, extra) {
25
25
  const bodyPayload = {};
26
26
  if (params.name !== undefined)
27
27
  bodyPayload.name = params.name;
28
- const result = await fetchPostmanAPI(url, {
29
- method: 'PATCH',
28
+ const options = {
30
29
  body: JSON.stringify(bodyPayload),
31
30
  contentType: ContentType.Json,
32
- apiKey: extra.apiKey,
33
31
  headers: extra.headers,
34
- });
32
+ };
33
+ const result = await extra.client.patch(url, options);
35
34
  return {
36
35
  content: [
37
36
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -35,13 +35,12 @@ export async function handler(params, extra) {
35
35
  const bodyPayload = {};
36
36
  if (params.workspace !== undefined)
37
37
  bodyPayload.workspace = params.workspace;
38
- const result = await fetchPostmanAPI(url, {
39
- method: 'PUT',
38
+ const options = {
40
39
  body: JSON.stringify(bodyPayload),
41
40
  contentType: ContentType.Json,
42
- apiKey: extra.apiKey,
43
41
  headers: extra.headers,
44
- });
42
+ };
43
+ const result = await extra.client.put(url, options);
45
44
  return {
46
45
  content: [
47
46
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -19,6 +19,7 @@ export const parameters = z.object({
19
19
  .optional(),
20
20
  value: z.string().describe("The variable's value.").optional(),
21
21
  enabled: z.boolean().describe('If true, the variable is enabled.').optional(),
22
+ description: z.string().max(512).describe("The variable's description.").optional(),
22
23
  })
23
24
  .describe('Information about the global variable.'))
24
25
  .describe("A list of the workspace's global variables.")
@@ -38,13 +39,12 @@ export async function handler(params, extra) {
38
39
  const bodyPayload = {};
39
40
  if (params.values !== undefined)
40
41
  bodyPayload.values = params.values;
41
- const result = await fetchPostmanAPI(url, {
42
- method: 'PUT',
42
+ const options = {
43
43
  body: JSON.stringify(bodyPayload),
44
44
  contentType: ContentType.Json,
45
- apiKey: extra.apiKey,
46
45
  headers: extra.headers,
47
- });
46
+ };
47
+ const result = await extra.client.put(url, options);
48
48
  return {
49
49
  content: [
50
50
  {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { fetchPostmanAPI, ContentType } from '../clients/postman.js';
2
+ import { ContentType } from '../clients/postman.js';
3
3
  import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
4
4
  function asMcpError(error) {
5
5
  const cause = error?.cause ?? String(error);
@@ -38,13 +38,12 @@ export async function handler(params, extra) {
38
38
  const bodyPayload = {};
39
39
  if (params.tags !== undefined)
40
40
  bodyPayload.tags = params.tags;
41
- const result = await fetchPostmanAPI(url, {
42
- method: 'PUT',
41
+ const options = {
43
42
  body: JSON.stringify(bodyPayload),
44
43
  contentType: ContentType.Json,
45
- apiKey: extra.apiKey,
46
44
  headers: extra.headers,
47
- });
45
+ };
46
+ const result = await extra.client.put(url, options);
48
47
  return {
49
48
  content: [
50
49
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman/postman-mcp-server",
3
- "version": "2.1.4",
3
+ "version": "2.2.0-alpha.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",