openwire 0.0.0-stage → 1.2.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/LICENSE +21 -0
  3. package/README.md +277 -2
  4. package/ROADMAP.md +15 -0
  5. package/assets/brand/icon.svg +10 -0
  6. package/assets/brand/logo-dark.svg +10 -0
  7. package/assets/brand/logo.svg +10 -0
  8. package/assets/diagrams/architecture.svg +39 -0
  9. package/dist/config.d.ts +31 -0
  10. package/dist/config.js +97 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/errors.d.ts +17 -0
  13. package/dist/errors.js +22 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/http/executor.d.ts +2 -0
  16. package/dist/http/executor.js +53 -0
  17. package/dist/http/executor.js.map +1 -0
  18. package/dist/http/index.d.ts +2 -0
  19. package/dist/http/index.js +3 -0
  20. package/dist/http/index.js.map +1 -0
  21. package/dist/http/request.d.ts +2 -0
  22. package/dist/http/request.js +75 -0
  23. package/dist/http/request.js.map +1 -0
  24. package/dist/index.d.ts +9 -0
  25. package/dist/index.js +111 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/loader/index.d.ts +2 -0
  28. package/dist/loader/index.js +2 -0
  29. package/dist/loader/index.js.map +1 -0
  30. package/dist/loader/specLoader.d.ts +17 -0
  31. package/dist/loader/specLoader.js +78 -0
  32. package/dist/loader/specLoader.js.map +1 -0
  33. package/dist/logger.d.ts +16 -0
  34. package/dist/logger.js +65 -0
  35. package/dist/logger.js.map +1 -0
  36. package/dist/metadata.d.ts +4 -0
  37. package/dist/metadata.js +4 -0
  38. package/dist/metadata.js.map +1 -0
  39. package/dist/parser/index.d.ts +1 -0
  40. package/dist/parser/index.js +2 -0
  41. package/dist/parser/index.js.map +1 -0
  42. package/dist/parser/parser.d.ts +12 -0
  43. package/dist/parser/parser.js +423 -0
  44. package/dist/parser/parser.js.map +1 -0
  45. package/dist/pipeline.d.ts +4 -0
  46. package/dist/pipeline.js +29 -0
  47. package/dist/pipeline.js.map +1 -0
  48. package/dist/sanitizer/index.d.ts +2 -0
  49. package/dist/sanitizer/index.js +2 -0
  50. package/dist/sanitizer/index.js.map +1 -0
  51. package/dist/sanitizer/sanitizer.d.ts +12 -0
  52. package/dist/sanitizer/sanitizer.js +88 -0
  53. package/dist/sanitizer/sanitizer.js.map +1 -0
  54. package/dist/schema/builder.d.ts +10 -0
  55. package/dist/schema/builder.js +36 -0
  56. package/dist/schema/builder.js.map +1 -0
  57. package/dist/schema/index.d.ts +2 -0
  58. package/dist/schema/index.js +3 -0
  59. package/dist/schema/index.js.map +1 -0
  60. package/dist/schema/normalize.d.ts +14 -0
  61. package/dist/schema/normalize.js +79 -0
  62. package/dist/schema/normalize.js.map +1 -0
  63. package/dist/server/handler.d.ts +11 -0
  64. package/dist/server/handler.js +56 -0
  65. package/dist/server/handler.js.map +1 -0
  66. package/dist/server/index.d.ts +4 -0
  67. package/dist/server/index.js +3 -0
  68. package/dist/server/index.js.map +1 -0
  69. package/dist/server/server.d.ts +7 -0
  70. package/dist/server/server.js +50 -0
  71. package/dist/server/server.js.map +1 -0
  72. package/dist/types.d.ts +87 -0
  73. package/dist/types.js +2 -0
  74. package/dist/types.js.map +1 -0
  75. package/dist/validator/index.d.ts +2 -0
  76. package/dist/validator/index.js +2 -0
  77. package/dist/validator/index.js.map +1 -0
  78. package/dist/validator/validator.d.ts +9 -0
  79. package/dist/validator/validator.js +46 -0
  80. package/dist/validator/validator.js.map +1 -0
  81. package/package.json +77 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ ## 1.2.1 — Documentation and branding
4
+
5
+ - Reorganize the README around quick start, client setup, architecture, configuration, and compatibility.
6
+ - Add the Openwire logo, a dark-theme wordmark, status badges, and an architecture diagram.
7
+ - Organize supplied SVGs under `assets/brand` and package brand assets, diagrams, changelog, and roadmap for npm.
8
+ - Verify required visual assets in the package smoke check.
9
+
10
+ ## 1.2.0 — Openwire
11
+
12
+ ### Migration
13
+
14
+ - Rename the npm package, primary CLI, default MCP identity, and repository to `openwire`.
15
+ - Keep the `api-mcp-bridge` command as an alias and retain existing environment variables and CLI arguments.
16
+ - Derive the reported MCP version from package metadata.
17
+
18
+ ### Fixes
19
+
20
+ - Forward configured headers when downloading protected specifications.
21
+ - Return MCP tool errors for upstream HTTP 4xx/5xx responses.
22
+ - Enforce serialized response character budgets, including JSON punctuation and escaping.
23
+ - Preserve nullable object schemas and avoid mutating input schemas during normalization.
24
+ - Reserve the built-in `health` name when generating operation tools.
25
+ - Resolve local request-body references and select operation/path server overrides.
26
+ - Prefer JSON request media types; reject unsupported encodings when a body is supplied.
27
+ - Refresh affected dependencies within existing major versions to resolve reported advisories.
28
+
29
+ ### Maintenance
30
+
31
+ - Remove the empty npm ignore file and duplicate CLI header configuration handling.
32
+ - Add MCP integration tests and installed-package verification to CI.
33
+ - Document actual authentication, response-limit, and OpenAPI compatibility boundaries.
34
+
35
+ ## 1.1.0
36
+
37
+ - Resolve CLI entry paths through npm binary symlinks.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Moad Tellami
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,278 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mtellami/openwire/master/assets/brand/logo-dark.svg">
4
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/mtellami/openwire/master/assets/brand/logo.svg">
5
+ <img src="https://raw.githubusercontent.com/mtellami/openwire/master/assets/brand/logo.svg" alt="Openwire" width="460" height="140">
6
+ </picture>
7
+ </p>
2
8
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
9
+ <h1 align="center">Your API. Ready for AI.</h1>
10
+
11
+ <p align="center">
12
+ Turn an OpenAPI specification into validated MCP tools.<br>
13
+ One command. No endpoint wrappers.
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://www.npmjs.com/package/openwire"><img src="https://img.shields.io/npm/v/openwire?style=flat&amp;color=1D9E75" alt="npm version"></a>
18
+ <a href="https://github.com/mtellami/openwire/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/mtellami/openwire/ci.yml?branch=master&amp;style=flat&amp;label=CI" alt="CI status"></a>
19
+ <a href="https://www.npmjs.com/package/openwire"><img src="https://img.shields.io/node/v/openwire?style=flat&amp;color=1D9E75" alt="Node.js requirement"></a>
20
+ <a href="https://github.com/mtellami/openwire/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mtellami/openwire?style=flat&amp;color=1D9E75" alt="MIT license"></a>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <a href="#quick-start">Quick start</a> ·
25
+ <a href="#connect-your-mcp-client">Client setup</a> ·
26
+ <a href="#how-it-works">Architecture</a> ·
27
+ <a href="#configuration">Configuration</a> ·
28
+ <a href="#compatibility">Compatibility</a> ·
29
+ <a href="https://github.com/mtellami/openwire/blob/master/ROADMAP.md">Roadmap</a>
30
+ </p>
31
+
32
+ ---
33
+
34
+ Openwire is a [Model Context Protocol](https://modelcontextprotocol.io) server for REST APIs. Give it a local OpenAPI file or a remote specification URL, and it exposes API operations as tools that an MCP client can discover and call over **stdio**.
35
+
36
+ Use it to connect an existing API to an AI assistant, point the same tools at staging or a local mock, or explore an API without maintaining a separate integration for every endpoint.
37
+
38
+ ## Why Openwire
39
+
40
+ | Capability | What you get |
41
+ | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
42
+ | **Tools from your spec** | Operation names, descriptions, parameters, and JSON request bodies become tool definitions at startup. |
43
+ | **Validation before execution** | Arguments are checked against generated schemas with AJV, including supported string formats, before an API request is made. |
44
+ | **Configured authentication** | Inject static authorization or proxy headers into spec downloads and API requests. |
45
+ | **Control over responses** | Opt into depth, array, string, and serialized character limits to manage model context usage. |
46
+ | **Predictable failures** | Validation failures, network errors, and HTTP 4xx/5xx responses are returned as MCP tool errors. |
47
+ | **A small runtime** | Node.js, built-in `fetch`, and a stdio connection. No separate HTTP service to deploy. |
48
+
49
+ ## Quick start
50
+
51
+ **Requirements:** Node.js **20.19 or newer** and an OpenAPI **3.0.x or 3.1.x** specification. See [compatibility](#compatibility) for supported features.
52
+
53
+ Run directly with npx:
54
+
55
+ ```bash
56
+ npx --yes openwire --spec ./openapi.yaml
57
+ ```
58
+
59
+ Or install the CLI:
60
+
61
+ ```bash
62
+ npm install -g openwire
63
+ openwire --spec ./openapi.yaml
64
+ ```
65
+
66
+ Remote JSON and YAML specifications work too:
67
+
68
+ ```bash
69
+ npx --yes openwire --spec https://api.example.com/openapi.json
70
+ ```
71
+
72
+ > Openwire is a stdio subprocess for an MCP client. A terminal waiting for input is expected; connect it to your client to discover and call tools.
73
+
74
+ ## Connect your MCP client
75
+
76
+ Add Openwire to a client that supports local stdio MCP servers. The following uses the common `mcpServers` configuration format; the file location and settings interface depend on your client.
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "openwire": {
82
+ "command": "npx",
83
+ "args": ["--yes", "openwire", "--spec", "/absolute/path/to/openapi.yaml"],
84
+ "env": {
85
+ "API_BASE_URL": "https://api.example.com"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ For a global installation, set `"command": "openwire"` and use `"args": ["--spec", "/absolute/path/to/openapi.yaml"]`. For a source checkout, use `"command": "node"` with the absolute path to `dist/index.js` followed by `--spec` and your spec path.
93
+
94
+ Use an absolute local spec path: the client's working directory may differ from your terminal. Restart the connection after changing the specification or configuration; the tool list is built once at startup.
95
+
96
+ ## How it works
97
+
98
+ <p align="center">
99
+ <img src="https://raw.githubusercontent.com/mtellami/openwire/master/assets/diagrams/architecture.svg" alt="At startup, Openwire loads an OpenAPI specification and builds MCP tools. At runtime, a client calls a tool, Openwire validates arguments, calls the REST API, and returns a compacted response." width="960" height="360">
100
+ </p>
101
+
102
+ At startup, Openwire loads the spec, resolves supported local references, normalizes schemas, and registers a tool for each operation plus a built-in `health` tool. At runtime, it validates arguments, builds and executes the HTTP request, then compacts the response under any configured limits.
103
+
104
+ ### From endpoint to tool
105
+
106
+ Given this operation:
107
+
108
+ ```yaml
109
+ openapi: 3.0.3
110
+ info:
111
+ title: Pet API
112
+ version: 1.0.0
113
+ servers:
114
+ - url: https://api.example.com
115
+ paths:
116
+ /pets/{petId}:
117
+ get:
118
+ operationId: getPetById
119
+ summary: Find a pet by ID
120
+ parameters:
121
+ - name: petId
122
+ in: path
123
+ required: true
124
+ schema:
125
+ type: string
126
+ responses:
127
+ "200":
128
+ description: A pet record
129
+ ```
130
+
131
+ Openwire exposes a `getPetById` tool. Calling it with:
132
+
133
+ ```json
134
+ { "petId": "pet-123" }
135
+ ```
136
+
137
+ makes a `GET https://api.example.com/pets/pet-123` request. A successful response is returned as text with its HTTP status, for example:
138
+
139
+ ```text
140
+ HTTP 200 OK
141
+ {"id":"pet-123","name":"Rex"}
142
+ ```
143
+
144
+ | Mapping | Behavior |
145
+ | -------------- | ---------------------------------------------------------------------------------------------------------------- |
146
+ | Tool name | Normalize `operationId` to camelCase; fall back to the method and path. Collisions receive numeric suffixes. |
147
+ | Tool arguments | Path, query, header, and cookie parameters become top-level properties. Unknown arguments are rejected. |
148
+ | Request body | Expose JSON payloads under `body`; require it when the spec does. |
149
+ | Base URL | Use operation, path, then document servers, unless `API_BASE_URL` is set. |
150
+ | Health check | The reserved `health` tool accepts an optional `echo` string. An API operation named `health` becomes `health2`. |
151
+
152
+ ## Configuration
153
+
154
+ ```text
155
+ openwire [options] [source]
156
+ ```
157
+
158
+ | Argument | Description |
159
+ | ---------------------- | --------------------------------------------------------------- |
160
+ | `-s, --spec <source>` | Local spec path or HTTP(S) URL. Overrides `OPENAPI_SOURCE`. |
161
+ | `<source>` | Positional alternative to `--spec`. |
162
+ | `-H, --headers <json>` | JSON object of headers. Overrides header environment variables. |
163
+ | `-h, --help` | Print CLI usage and available environment settings. |
164
+
165
+ ### Environment variables
166
+
167
+ | Variable | Default | Purpose |
168
+ | ---------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------- |
169
+ | `OPENAPI_SOURCE` | Required without a CLI source | Local spec path or HTTP(S) URL. |
170
+ | `API_BASE_URL` | Selected server from the spec | Override the base URL for every API call. |
171
+ | `API_TIMEOUT_MS` | `30000` | Timeout in milliseconds for spec downloads and API requests. |
172
+ | `OPENAPI_MAX_TOOLS` | `100` | Maximum number of spec operations. Specs above this limit are rejected; `health` is additional. |
173
+ | `API_HEADERS` | Unset | JSON header map sent on spec downloads and API requests. |
174
+ | `API_AUTH_HEADERS` | Unset | Header map fallback; `API_HEADERS` takes precedence. |
175
+ | `API_MAX_RESPONSE_CHARS` | Unlimited | Serialized response-body character budget. |
176
+ | `SANITIZE_MAX_DEPTH` | Unlimited | Maximum JSON nesting depth retained; root depth is zero. |
177
+ | `SANITIZE_MAX_ARRAY_LENGTH` | Unlimited | Maximum number of elements retained per array. |
178
+ | `SANITIZE_MAX_STRING_LENGTH` | Unlimited | String content retained before an optional truncation marker. |
179
+ | `ALLOW_INSECURE_HTTP` | `false` | Permit plain HTTP for spec downloads and API requests. |
180
+ | `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, or `error`. Logs go to stderr. |
181
+ | `SERVER_NAME` | `openwire` | MCP server identity reported to the client. |
182
+ | `SERVER_VERSION` | Package version | MCP server version reported to the client. |
183
+
184
+ ### Authenticate requests
185
+
186
+ Configure precomputed Bearer tokens, Basic authorization values, API-key headers, or custom proxy headers:
187
+
188
+ ```bash
189
+ export API_HEADERS='{"Authorization":"Bearer YOUR_TOKEN","X-API-Key":"YOUR_KEY"}'
190
+ openwire --spec https://api.example.com/openapi.json
191
+ ```
192
+
193
+ For client-managed subprocesses, put `API_HEADERS` in the client's `env` configuration. Keep real credentials out of committed configuration files.
194
+
195
+ Header precedence is **`--headers` → `API_HEADERS` → `API_AUTH_HEADERS`**: the highest-priority value replaces the entire header map. Configured headers override same-name header parameters supplied in a tool call.
196
+
197
+ The same headers are sent to the spec URL and the selected API server, so use trusted endpoints. Security schemes are metadata: Openwire does not perform OAuth/OpenID flows, refresh tokens, or automatically inject query/cookie API keys. Use a suitable proxy or restart with updated static credentials when tokens rotate.
198
+
199
+ ### Manage response size
200
+
201
+ Limits are opt-in. For example:
202
+
203
+ ```bash
204
+ export API_MAX_RESPONSE_CHARS=20000
205
+ export SANITIZE_MAX_DEPTH=8
206
+ export SANITIZE_MAX_ARRAY_LENGTH=50
207
+ export SANITIZE_MAX_STRING_LENGTH=2000
208
+ openwire --spec ./openapi.yaml
209
+ ```
210
+
211
+ The character budget includes JSON escaping, punctuation, and embedded markers. HTTP status lines and the separate `[response truncated]` notice sit outside that budget. JSON remains valid when a value fits; otherwise the response body is empty.
212
+
213
+ Responses are buffered before sanitization. These options limit output to the client, rather than download size or peak memory usage.
214
+
215
+ ### Use a local API
216
+
217
+ ```bash
218
+ export API_BASE_URL=http://localhost:8080
219
+ export ALLOW_INSECURE_HTTP=true
220
+ openwire --spec ./openapi.yaml
221
+ ```
222
+
223
+ ## Compatibility
224
+
225
+ | Area | Current support |
226
+ | ----------------- | ----------------------------------------------------------------------------------------------------- |
227
+ | Transport | Local stdio MCP server. |
228
+ | Specifications | OpenAPI 3.0.x and 3.1.x, JSON or YAML, local file or HTTP(S) source. |
229
+ | Schema validation | AJV draft-07 with OpenAPI 3.0 normalization; full JSON Schema 2020-12 semantics are not implemented. |
230
+ | References | Supported local references; external references and recursive schema cycles are rejected. |
231
+ | Request bodies | `application/json` and `application/*+json`; other encodings return an error when a body is supplied. |
232
+ | Parameters | Scalar/JSON serialization; OpenAPI `style` and `explode` are not fully implemented. |
233
+ | Servers | Operation/path/document precedence and a global override; server variables are not expanded. |
234
+ | Authentication | Static HTTP headers; no token acquisition or refresh. |
235
+
236
+ Parameter names share one argument namespace. Duplicate names across locations, or a parameter named `body`, can collide with the request-body argument.
237
+
238
+ Plain HTTP is refused by default. Configured credentials are not added to tool schemas, and logs omit request headers; upstream response bodies can still echo sensitive information. Invalid specifications prevent initialization; invalid arguments, network failures, and HTTP 4xx/5xx responses produce tool errors.
239
+
240
+ ## Development
241
+
242
+ ```bash
243
+ git clone https://github.com/mtellami/openwire.git
244
+ cd openwire
245
+ npm ci
246
+ npm run build
247
+ npm start -- --spec ./openapi.yaml
248
+ ```
249
+
250
+ | Command | Purpose |
251
+ | -------------------------------------- | ----------------------------------------------------------------- |
252
+ | `npm run dev -- --spec ./openapi.yaml` | Run the CLI with source watching. |
253
+ | `npm run typecheck` | Check TypeScript types. |
254
+ | `npm run lint` | Lint source files. |
255
+ | `npm run format:check` | Check repository formatting. |
256
+ | `npm test` | Run unit and MCP integration tests. |
257
+ | `npm run test:package` | Build, pack, install, and verify both CLI names and MCP behavior. |
258
+
259
+ CI runs checks on Node.js **20, 22, and 24**. Brand assets live in [`assets/brand`](https://github.com/mtellami/openwire/tree/master/assets/brand), and README diagrams live in [`assets/diagrams`](https://github.com/mtellami/openwire/tree/master/assets/diagrams). The README uses absolute image URLs so the same branding renders on GitHub and npm.
260
+
261
+ For bug reports, include your Node.js version, a minimal specification with secrets removed, the command or client configuration, and the observed error. Use [GitHub Issues](https://github.com/mtellami/openwire/issues) for reports and feature requests, or open a pull request with a focused change and relevant validation.
262
+
263
+ ## Migrating from api-mcp-bridge
264
+
265
+ ```bash
266
+ npm uninstall -g api-mcp-bridge
267
+ npm install -g openwire
268
+ ```
269
+
270
+ Update the MCP command to `openwire`, or use `npx --yes openwire`. Existing environment variable names and CLI arguments remain compatible. The old command is retained as an alias in Openwire 1.2.x; the default server identity is now `openwire`.
271
+
272
+ ## Project
273
+
274
+ - [Changelog](https://github.com/mtellami/openwire/blob/master/CHANGELOG.md) — release history and migration notes.
275
+ - [Roadmap](https://github.com/mtellami/openwire/blob/master/ROADMAP.md) — operation filtering, bounded downloads, OpenAPI compatibility, and authentication improvements.
276
+ - [MIT license](https://github.com/mtellami/openwire/blob/master/LICENSE) — maintained by [Moad Tellami](https://github.com/mtellami).
277
+
278
+ Openwire is an OpenAPI-to-MCP server, unrelated to the Apache ActiveMQ OpenWire protocol.
package/ROADMAP.md ADDED
@@ -0,0 +1,15 @@
1
+ # Openwire optimization roadmap
2
+
3
+ Priorities follow the current implementation review. These features are deferred beyond 1.2.0.
4
+
5
+ | Priority | Improvement | Benefit | Acceptance evidence |
6
+ | -------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
7
+ | 1 | Filter operations by tag, path, method, or operation ID before applying the tool limit | Let large APIs expose a useful subset without overwhelming client context | Deterministic filtered tool lists; excluded operations never register; measure tool-schema size reduction |
8
+ | 2 | Stream and cap spec downloads and API responses before buffering | Bound memory use even when upstream payloads are huge | Byte-accurate limits for UTF-8, streamed responses, and missing Content-Length; benchmark peak memory |
9
+ | 3 | Support parameter style/explode, server variables, recursive schemas, and dialect-aware OpenAPI 3.1 validation | Increase compatibility with real API specifications | Conformance fixtures for each supported feature and explicit errors for unsupported constructs |
10
+ | 4 | Separate spec and API credentials; support explicit query/cookie API-key injection | Avoid sharing credentials between services and support additional authentication layouts | Credential isolation across hosts, redirect tests, and no secret tool-schema exposure |
11
+ | 5 | Benchmark startup and optimize repeated reference resolution/schema compilation | Reduce startup time for larger specifications | Compare cold/warm startup, compile counts, memory, and identical generated schemas before adding caches |
12
+
13
+ Additional correctness work: avoid argument-name collisions between parameter locations and request bodies; validate configuration numbers strictly; expand redirect policy checks and sensitive-URL redaction. Do not add automatic retries for mutating API requests without an explicit idempotency policy.
14
+
15
+ Keep stdio as the default transport. Consider new transports or OAuth token acquisition as separate features with their own compatibility and lifecycle designs.
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" xmlns:c2pa="http://c2pa.org/manifest">
2
+ <title>openwire icon</title>
3
+ <rect width="512" height="512" rx="112" fill="#111916"/>
4
+ <g transform="translate(334 256) scale(4)" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="3">
5
+ <path d="M-45 -18 Q-55 -18 -55 -8 V-4 Q-55 0 -61 0 Q-55 0 -55 4 V8 Q-55 18 -45 18" stroke="#F1EFE8"/>
6
+ <path d="M-42 0 H-22" stroke="#1D9E75"/>
7
+ <polygon points="22,0 11,19.1 -11,19.1 -22,0 -11,-19.1 11,-19.1" stroke="#1D9E75"/>
8
+ <circle cx="0" cy="0" r="4" fill="#1D9E75" stroke="none"/>
9
+ </g>
10
+ <metadata><c2pa:manifest>AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTphYmFlMmZmOC0wYmU4LTQ4MjctYTg4Mi1mMGY3NDk1YWM5NDUAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAq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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQNssFvxnIH8IPMQK7dDKiTfh16wlZpIXOUh/tRELIcipYBEOLXRgRF5IxUMAa1HteytIs6NCEWgwIiTIc5o7QJ4=</c2pa:manifest></metadata></svg>
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="460" height="140" viewBox="0 0 460 140">
2
+ <title>openwire</title>
3
+ <g transform="translate(130 70) scale(1.9)" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="3">
4
+ <path d="M-45 -18 Q-55 -18 -55 -8 V-4 Q-55 0 -61 0 Q-55 0 -55 4 V8 Q-55 18 -45 18" stroke="#F1EFE8"/>
5
+ <path d="M-42 0 H-22" stroke="#1D9E75"/>
6
+ <polygon points="22,0 11,19.1 -11,19.1 -22,0 -11,-19.1 11,-19.1" stroke="#1D9E75"/>
7
+ <circle cx="0" cy="0" r="4" fill="#1D9E75" stroke="none"/>
8
+ </g>
9
+ <text x="190" y="88" font-family="Inter, Helvetica, Arial, sans-serif" font-size="56" font-weight="500" fill="#F1EFE8">open<tspan fill="#1D9E75">wire</tspan></text>
10
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="460" height="140" viewBox="0 0 460 140" xmlns:c2pa="http://c2pa.org/manifest">
2
+ <title>openwire</title>
3
+ <g transform="translate(130 70) scale(1.9)" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="3">
4
+ <path d="M-45 -18 Q-55 -18 -55 -8 V-4 Q-55 0 -61 0 Q-55 0 -55 4 V8 Q-55 18 -45 18" stroke="#2C2C2A"/>
5
+ <path d="M-42 0 H-22" stroke="#1D9E75"/>
6
+ <polygon points="22,0 11,19.1 -11,19.1 -22,0 -11,-19.1 11,-19.1" stroke="#1D9E75"/>
7
+ <circle cx="0" cy="0" r="4" fill="#1D9E75" stroke="none"/>
8
+ </g>
9
+ <text x="190" y="88" font-family="Inter, Helvetica, Arial, sans-serif" font-size="56" font-weight="500" fill="#2C2C2A">open<tspan fill="#1D9E75">wire</tspan></text>
10
+ <metadata><c2pa:manifest>AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYToyOTMxN2NkZi01Mjc5LTQwYTktODM5My0wMGFmYmU0MjUzYzQAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaN3ZYQXQClPTBocAMokXfhgAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDo0NTlmODM4MS1mZWU1LTQ2NjQtOWRkYy1lMWQwYWI3ZTEyM2RscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNos79OVmWlsOygRQmHb1NPvwAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQudjNkaGFzaFgg1MwYOJtjZb9cUWqHMDhElPULYBDuZC1uAcxT+6vkv/mkZmFjdGlvbngdY29tLmFudGhyb3BpYy5jbGF1ZGUucHJvdmlkZWRqcGFyYW1ldGVyc6F4H2NvbS5hbnRocm9waWMub3JpZ2luLWNvbmZpZGVuY2VndW5rbm93bmtkZXNjcmlwdGlvbnhmQ2xhd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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQDMqnM3ulviHK0qUGy/Nhv2dIv3nl3t02pwVEszMNTj2q47Eq06A4bjkq0XqmiBXJDykeVRcBMa66NCR79kfm84=</c2pa:manifest></metadata></svg>
@@ -0,0 +1,39 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="960" height="360" viewBox="0 0 960 360" role="img" aria-labelledby="title desc">
2
+ <title id="title">Openwire architecture</title>
3
+ <desc id="desc">At startup, an OpenAPI specification is parsed into validated MCP tools. During a tool call, Openwire validates arguments, calls the REST API, and returns the compacted response to the MCP client.</desc>
4
+ <defs>
5
+ <marker id="arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto-start-reverse"><path d="M0 0L8 4L0 8" fill="none" stroke="#60766c" stroke-width="1.5"/></marker>
6
+ </defs>
7
+ <rect x="1" y="1" width="958" height="358" rx="20" fill="#f8faf9" stroke="#dce7e1"/>
8
+ <g font-family="Inter, Helvetica, Arial, sans-serif">
9
+ <text x="36" y="35" font-size="11" font-weight="700" letter-spacing="2" fill="#52655c">STARTUP</text>
10
+ <rect x="36" y="53" width="230" height="64" rx="12" fill="#fff" stroke="#d0ded6"/>
11
+ <text x="56" y="79" font-size="16" font-weight="600" fill="#182d22">OpenAPI specification</text>
12
+ <text x="56" y="101" font-size="12" fill="#52655c">File or URL · JSON / YAML</text>
13
+ <path d="M268 85H321" stroke="#60766c" stroke-width="1.5" marker-end="url(#arrow)"/>
14
+ <rect x="333" y="53" width="267" height="64" rx="12" fill="#eaf6f0" stroke="#82bfa5"/>
15
+ <text x="353" y="79" font-size="16" font-weight="600" fill="#182d22">Parse and build schemas</text>
16
+ <text x="353" y="101" font-size="12" fill="#52655c">Resolve local references · map operations</text>
17
+ <path d="M602 85H656" stroke="#60766c" stroke-width="1.5" marker-end="url(#arrow)"/>
18
+ <rect x="668" y="53" width="256" height="64" rx="12" fill="#fff" stroke="#d0ded6"/>
19
+ <text x="688" y="79" font-size="16" font-weight="600" fill="#182d22">Register MCP tools</text>
20
+ <text x="688" y="101" font-size="12" fill="#52655c">One per operation + health</text>
21
+ <path d="M36 143H924" stroke="#dce7e1"/>
22
+ <text x="36" y="175" font-size="11" font-weight="700" letter-spacing="2" fill="#52655c">TOOL CALL</text>
23
+ <rect x="36" y="195" width="190" height="74" rx="12" fill="#fff" stroke="#d0ded6"/>
24
+ <text x="56" y="225" font-size="16" font-weight="600" fill="#182d22">MCP client</text>
25
+ <text x="56" y="248" font-size="12" fill="#52655c">Call a tool over stdio</text>
26
+ <path d="M228 231H283" stroke="#60766c" stroke-width="1.5" marker-end="url(#arrow)"/>
27
+ <rect x="295" y="195" width="320" height="74" rx="12" fill="#111916"/>
28
+ <text x="315" y="225" font-size="16" font-weight="600" fill="#f1efe8">Openwire</text>
29
+ <text x="315" y="248" font-size="12" fill="#b6d4c5">Validate arguments → build HTTP request</text>
30
+ <path d="M617 231H720" stroke="#60766c" stroke-width="1.5" marker-end="url(#arrow)"/>
31
+ <text x="646" y="216" font-size="11" fill="#52655c">HTTP(S)</text>
32
+ <rect x="732" y="195" width="192" height="74" rx="12" fill="#fff" stroke="#d0ded6"/>
33
+ <text x="752" y="225" font-size="16" font-weight="600" fill="#182d22">Your REST API</text>
34
+ <text x="752" y="248" font-size="12" fill="#52655c">Execute the operation</text>
35
+ <path d="M828 271V318H133V281" stroke="#1d9e75" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/>
36
+ <rect x="273" y="302" width="420" height="28" rx="14" fill="#eaf6f0"/>
37
+ <text x="483" y="321" text-anchor="middle" font-size="12" font-weight="500" fill="#176c50">HTTP status + compacted body · optional response limits</text>
38
+ </g>
39
+ </svg>
@@ -0,0 +1,31 @@
1
+ import { type LogLevel } from "./logger.js";
2
+ export interface BridgeConfig {
3
+ /** Raw spec source: a filesystem path or an http(s) URL. */
4
+ source: string;
5
+ baseUrlOverride?: string;
6
+ timeoutMs: number;
7
+ maxTools: number;
8
+ /** Response character budget. Unlimited when not set. */
9
+ maxResponseChars?: number;
10
+ /** Max JSON depth kept. Unlimited when not set. */
11
+ maxDepth?: number;
12
+ /** Max array elements kept per array. Unlimited when not set. */
13
+ maxArrayLength?: number;
14
+ /** Max length of an individual string value. Unlimited when not set. */
15
+ maxStringLength?: number;
16
+ logLevel: LogLevel;
17
+ serverName: string;
18
+ serverVersion: string;
19
+ allowInsecureHttp: boolean;
20
+ /** Raw headers injected into every request. */
21
+ headers?: Record<string, string>;
22
+ }
23
+ export declare const DEFAULT_CONFIG: {
24
+ readonly timeoutMs: 30000;
25
+ readonly maxTools: 100;
26
+ readonly serverName: string;
27
+ readonly serverVersion: string;
28
+ };
29
+ type RawEnv = Record<string, string | undefined>;
30
+ export declare function loadConfig(env: RawEnv, cliSource?: string, cliHeaders?: string): BridgeConfig;
31
+ export {};
package/dist/config.js ADDED
@@ -0,0 +1,97 @@
1
+ import { packageMetadata } from "./metadata.js";
2
+ import { z } from "zod";
3
+ import { ConfigError } from "./errors.js";
4
+ import { parseLogLevel } from "./logger.js";
5
+ export const DEFAULT_CONFIG = {
6
+ timeoutMs: 30_000,
7
+ maxTools: 100,
8
+ serverName: packageMetadata.name,
9
+ serverVersion: packageMetadata.version,
10
+ };
11
+ const numberOrEmpty = (def) => z.preprocess((value) => {
12
+ if (value === undefined || value === null || value === "") {
13
+ return def;
14
+ }
15
+ if (typeof value === "number") {
16
+ return value;
17
+ }
18
+ const n = Number(value);
19
+ return Number.isFinite(n) ? n : def;
20
+ }, z.number().min(0));
21
+ const optionalNumber = z.preprocess((value) => {
22
+ if (value === undefined || value === null || value === "") {
23
+ return undefined;
24
+ }
25
+ if (typeof value === "number") {
26
+ return value;
27
+ }
28
+ const n = Number(value);
29
+ return Number.isFinite(n) ? n : undefined;
30
+ }, z.number().min(0).optional());
31
+ const EnvSchema = z.object({
32
+ OPENAPI_SOURCE: z.string().min(1).optional(),
33
+ API_BASE_URL: z.string().min(1).optional(),
34
+ API_TIMEOUT_MS: numberOrEmpty(DEFAULT_CONFIG.timeoutMs),
35
+ OPENAPI_MAX_TOOLS: numberOrEmpty(DEFAULT_CONFIG.maxTools),
36
+ API_MAX_RESPONSE_CHARS: optionalNumber,
37
+ SANITIZE_MAX_DEPTH: optionalNumber,
38
+ SANITIZE_MAX_ARRAY_LENGTH: optionalNumber,
39
+ SANITIZE_MAX_STRING_LENGTH: optionalNumber,
40
+ LOG_LEVEL: z.string().optional(),
41
+ SERVER_NAME: z.string().min(1).default(DEFAULT_CONFIG.serverName),
42
+ SERVER_VERSION: z.string().min(1).default(DEFAULT_CONFIG.serverVersion),
43
+ ALLOW_INSECURE_HTTP: z
44
+ .enum(["true", "false", "1", "0"])
45
+ .default("false")
46
+ .transform((value) => value === "true" || value === "1"),
47
+ API_AUTH_HEADERS: z.string().optional(),
48
+ API_HEADERS: z.string().optional(),
49
+ });
50
+ export function loadConfig(env, cliSource, cliHeaders) {
51
+ const result = EnvSchema.safeParse(env);
52
+ if (!result.success) {
53
+ const first = result.error.issues[0];
54
+ throw new ConfigError(first
55
+ ? `Invalid configuration: ${first.message} (${first.path.join(".")})`
56
+ : "Invalid configuration");
57
+ }
58
+ const parsed = result.data;
59
+ const source = cliSource ?? parsed.OPENAPI_SOURCE;
60
+ if (!source) {
61
+ throw new ConfigError("No spec source provided: use the --spec flag or set OPENAPI_SOURCE");
62
+ }
63
+ const headersRaw = cliHeaders ?? parsed.API_HEADERS ?? parsed.API_AUTH_HEADERS;
64
+ return {
65
+ source,
66
+ baseUrlOverride: parsed.API_BASE_URL,
67
+ timeoutMs: parsed.API_TIMEOUT_MS,
68
+ maxTools: parsed.OPENAPI_MAX_TOOLS,
69
+ maxResponseChars: parsed.API_MAX_RESPONSE_CHARS,
70
+ maxDepth: parsed.SANITIZE_MAX_DEPTH,
71
+ maxArrayLength: parsed.SANITIZE_MAX_ARRAY_LENGTH,
72
+ maxStringLength: parsed.SANITIZE_MAX_STRING_LENGTH,
73
+ logLevel: parseLogLevel(parsed.LOG_LEVEL),
74
+ serverName: parsed.SERVER_NAME,
75
+ serverVersion: parsed.SERVER_VERSION,
76
+ allowInsecureHttp: parsed.ALLOW_INSECURE_HTTP,
77
+ headers: headersRaw !== undefined ? parseHeaders(headersRaw) : undefined,
78
+ };
79
+ }
80
+ function parseHeaders(raw) {
81
+ let parsed;
82
+ try {
83
+ parsed = JSON.parse(raw);
84
+ }
85
+ catch {
86
+ throw new ConfigError("Invalid API_HEADERS: expected a JSON object of header name/value pairs");
87
+ }
88
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
89
+ throw new ConfigError("Invalid API_HEADERS: expected a JSON object of header name/value pairs");
90
+ }
91
+ const headers = {};
92
+ for (const [key, value] of Object.entries(parsed)) {
93
+ headers[key] = String(value);
94
+ }
95
+ return headers;
96
+ }
97
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE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UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;KACzE,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,WAAW,CAAC,wEAAwE,CAAC,CAAC;IAClG,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,WAAW,CAAC,wEAAwE,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare class BridgeError extends Error {
2
+ constructor(message: string, options?: {
3
+ cause?: unknown;
4
+ });
5
+ }
6
+ export declare class ConfigError extends BridgeError {
7
+ }
8
+ export declare class SpecLoadError extends BridgeError {
9
+ }
10
+ export declare class SpecParseError extends BridgeError {
11
+ }
12
+ export declare class ValidationError extends BridgeError {
13
+ readonly details?: unknown[];
14
+ constructor(message: string, details?: unknown[]);
15
+ }
16
+ export declare class HttpExecutionError extends BridgeError {
17
+ }