mcp4openapi 0.2.4 → 0.2.6

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 (67) hide show
  1. package/README.md +14 -1
  2. package/dist/scripts/validate-profile.js +3 -1
  3. package/dist/scripts/validate-profile.js.map +1 -1
  4. package/dist/src/composite-executor.d.ts.map +1 -1
  5. package/dist/src/composite-executor.js +1 -3
  6. package/dist/src/composite-executor.js.map +1 -1
  7. package/dist/src/errors.js +0 -2
  8. package/dist/src/errors.js.map +1 -1
  9. package/dist/src/generated-schemas.d.ts +235 -30
  10. package/dist/src/generated-schemas.d.ts.map +1 -1
  11. package/dist/src/generated-schemas.js +16 -2
  12. package/dist/src/generated-schemas.js.map +1 -1
  13. package/dist/src/http-client-factory.js +3 -2
  14. package/dist/src/http-client-factory.js.map +1 -1
  15. package/dist/src/http-transport.d.ts +9 -2
  16. package/dist/src/http-transport.d.ts.map +1 -1
  17. package/dist/src/http-transport.js +133 -36
  18. package/dist/src/http-transport.js.map +1 -1
  19. package/dist/src/interceptors.d.ts +34 -0
  20. package/dist/src/interceptors.d.ts.map +1 -1
  21. package/dist/src/interceptors.js +90 -6
  22. package/dist/src/interceptors.js.map +1 -1
  23. package/dist/src/logger.js +0 -4
  24. package/dist/src/logger.js.map +1 -1
  25. package/dist/src/mcp-server.d.ts +7 -0
  26. package/dist/src/mcp-server.d.ts.map +1 -1
  27. package/dist/src/mcp-server.js +86 -20
  28. package/dist/src/mcp-server.js.map +1 -1
  29. package/dist/src/metrics.js +0 -17
  30. package/dist/src/metrics.js.map +1 -1
  31. package/dist/src/oauth-provider.d.ts +29 -0
  32. package/dist/src/oauth-provider.d.ts.map +1 -1
  33. package/dist/src/oauth-provider.js +177 -22
  34. package/dist/src/oauth-provider.js.map +1 -1
  35. package/dist/src/openapi-parser.d.ts.map +1 -1
  36. package/dist/src/openapi-parser.js +4 -3
  37. package/dist/src/openapi-parser.js.map +1 -1
  38. package/dist/src/profile-loader.d.ts.map +1 -1
  39. package/dist/src/profile-loader.js +8 -0
  40. package/dist/src/profile-loader.js.map +1 -1
  41. package/dist/src/proxy-executor.d.ts +71 -0
  42. package/dist/src/proxy-executor.d.ts.map +1 -0
  43. package/dist/src/proxy-executor.js +240 -0
  44. package/dist/src/proxy-executor.js.map +1 -0
  45. package/dist/src/testing/fixtures.d.ts +229 -2
  46. package/dist/src/testing/fixtures.d.ts.map +1 -1
  47. package/dist/src/testing/fixtures.js +175 -1
  48. package/dist/src/testing/fixtures.js.map +1 -1
  49. package/dist/src/testing/mock-gitlab-server.d.ts.map +1 -1
  50. package/dist/src/testing/mock-gitlab-server.js +356 -1
  51. package/dist/src/testing/mock-gitlab-server.js.map +1 -1
  52. package/dist/src/testing/mock-youtrack-server.d.ts +11 -0
  53. package/dist/src/testing/mock-youtrack-server.d.ts.map +1 -0
  54. package/dist/src/testing/mock-youtrack-server.js +138 -0
  55. package/dist/src/testing/mock-youtrack-server.js.map +1 -0
  56. package/dist/src/testing/test-http-utils.js +1 -3
  57. package/dist/src/testing/test-http-utils.js.map +1 -1
  58. package/dist/src/testing/test-types.d.ts +157 -2
  59. package/dist/src/testing/test-types.d.ts.map +1 -1
  60. package/dist/src/tool-generator.d.ts +23 -0
  61. package/dist/src/tool-generator.d.ts.map +1 -1
  62. package/dist/src/tool-generator.js +55 -5
  63. package/dist/src/tool-generator.js.map +1 -1
  64. package/dist/src/types/profile.d.ts +48 -3
  65. package/dist/src/types/profile.d.ts.map +1 -1
  66. package/package.json +1 -1
  67. package/profile-schema.json +90 -6
@@ -81,15 +81,28 @@
81
81
  },
82
82
  "operations": {
83
83
  "type": "object",
84
- "description": "Map action names to OpenAPI operationIds (for simple tools)",
84
+ "description": "Map action names to OpenAPI operationIds or proxy download operations",
85
85
  "additionalProperties": {
86
- "type": "string"
86
+ "oneOf": [
87
+ {
88
+ "type": "string",
89
+ "description": "OpenAPI operation ID"
90
+ },
91
+ {
92
+ "$ref": "#/definitions/ProxyDownloadOperation"
93
+ }
94
+ ]
87
95
  },
88
96
  "examples": [
89
97
  {
90
98
  "list": "getApiV4ProjectsIdBadges",
91
99
  "get": "getApiV4ProjectsIdBadgesBadgeId",
92
- "create": "postApiV4ProjectsIdBadges"
100
+ "create": "postApiV4ProjectsIdBadges",
101
+ "download_attachment": {
102
+ "type": "proxy_download",
103
+ "metadata_endpoint": "getApiV4ProjectsIdMergeRequestsMrIidNotesNoteId",
104
+ "url_field": "attachment.url"
105
+ }
93
106
  }
94
107
  ]
95
108
  },
@@ -109,9 +122,14 @@
109
122
  }
110
123
  ]
111
124
  },
125
+ "send_response_fields_as_param": {
126
+ "type": "boolean",
127
+ "description": "If true, send response_fields as 'fields' query parameter (e.g. for YouTrack)",
128
+ "default": false
129
+ },
112
130
  "steps": {
113
131
  "type": "array",
114
- "description": "Sequence of API calls to execute (for composite tools)",
132
+ "description": "Steps for composite tool execution",
115
133
  "items": {
116
134
  "$ref": "#/definitions/CompositeStep"
117
135
  }
@@ -137,7 +155,18 @@
137
155
  "required": ["operations"],
138
156
  "properties": {
139
157
  "operations": {
140
- "type": "object"
158
+ "type": "object",
159
+ "additionalProperties": {
160
+ "oneOf": [
161
+ {
162
+ "type": "string",
163
+ "description": "OpenAPI operation ID"
164
+ },
165
+ {
166
+ "$ref": "#/definitions/ProxyDownloadOperation"
167
+ }
168
+ ]
169
+ }
141
170
  }
142
171
  }
143
172
  },
@@ -198,6 +227,11 @@
198
227
  }
199
228
  }
200
229
  },
230
+ "properties": {
231
+ "type": "object",
232
+ "description": "Properties schema for object parameters (empty {} = free-form object)",
233
+ "additionalProperties": true
234
+ },
201
235
  "default": {
202
236
  "description": "Default value if not provided"
203
237
  },
@@ -525,7 +559,57 @@
525
559
  "examples": [[429, 502, 503, 504]]
526
560
  }
527
561
  }
562
+ },
563
+ "ProxyDownloadOperation": {
564
+ "type": "object",
565
+ "required": ["type", "metadata_endpoint"],
566
+ "properties": {
567
+ "type": {
568
+ "const": "proxy_download",
569
+ "description": "Must be 'proxy_download'"
570
+ },
571
+ "metadata_endpoint": {
572
+ "type": "string",
573
+ "description": "OpenAPI operation ID to fetch metadata (e.g., 'get_/issues/{id}/attachments/{attachmentId}')"
574
+ },
575
+ "download_endpoint": {
576
+ "type": "string",
577
+ "description": "OpenAPI operation ID for direct download endpoint when metadata does not expose a URL"
578
+ },
579
+ "url_field": {
580
+ "type": "string",
581
+ "description": "JSON path to URL field in metadata response",
582
+ "default": "url"
583
+ },
584
+ "max_size_bytes": {
585
+ "type": "number",
586
+ "description": "Maximum file size in bytes",
587
+ "default": 10485760,
588
+ "minimum": 1
589
+ },
590
+ "max_size_bytes_from_env": {
591
+ "type": "string",
592
+ "description": "Environment variable that overrides max_size_bytes when set"
593
+ },
594
+ "timeout_ms": {
595
+ "type": "number",
596
+ "description": "Timeout for download in milliseconds",
597
+ "default": 30000,
598
+ "minimum": 1000
599
+ },
600
+ "allowed_mime_types": {
601
+ "type": "array",
602
+ "description": "Optional MIME type whitelist (e.g., ['image/*', 'application/pdf'])",
603
+ "items": {
604
+ "type": "string"
605
+ }
606
+ },
607
+ "skip_auth": {
608
+ "type": "boolean",
609
+ "description": "Skip authentication for download URL (default: false). Set to true for pre-signed URLs.",
610
+ "default": false
611
+ }
612
+ }
528
613
  }
529
614
  }
530
615
  }
531
-