mcp-from-openapi 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/errors.d.ts +7 -0
- package/esm/index.mjs +864 -60
- package/esm/package.json +3 -3
- package/generator.d.ts +8 -0
- package/index.d.ts +8 -2
- package/index.js +869 -60
- package/lint.d.ts +33 -0
- package/overlay.d.ts +43 -0
- package/package.json +3 -3
- package/schema-builder.d.ts +17 -0
- package/token-report.d.ts +65 -0
- package/types.d.ts +63 -0
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
[](https://opensource.org/license/apache-2-0)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
|
+
[](https://github.com/agentfront/mcp-from-openapi/actions/workflows/codeql.yml)
|
|
9
10
|
|
|
10
11
|
## What This Solves
|
|
11
12
|
|
|
@@ -52,6 +53,8 @@ Now you know exactly how to build the HTTP request.
|
|
|
52
53
|
|
|
53
54
|
- **Built-in Request Builder** -- `buildHttpRequest()` applies the full OpenAPI serialization table (form/deepObject/pipeDelimited queries, label/matrix paths, multipart, binary, `wholeBody`) so you never hand-write request assembly
|
|
54
55
|
- **Client Compatibility Targets** -- `target: 'claude' | 'openai' | 'gemini' | 'strict'` emits schemas each client actually accepts (inlined refs, closed objects, collapsed unions, demoted formats)
|
|
56
|
+
- **Context-Budget Reports** -- `analyzeToolSet()` estimates the token bill per tool and warns at the thresholds where agent accuracy degrades
|
|
57
|
+
- **Overlays & Lint** -- apply [OpenAPI Overlay](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/curation.md) curation files at load time; `lint()` flags the spec gaps that hurt tool-calling accuracy
|
|
55
58
|
- **Curation-Grade Filtering** -- Filter by tag, method, path glob (`/admin/**`), operationId, a `readOnlyOnly` safety switch, and `x-mcp` extension flags with root < path < operation precedence
|
|
56
59
|
- **Smart Parameter Handling** -- Automatic conflict detection and resolution across path, query, header, cookie, and body; `allOf` bodies flatten, union and binary bodies map cleanly (`wholeBody`, `binary` markers)
|
|
57
60
|
- **Complete Schemas** -- Input schema combines all parameters; output schema from responses (with oneOf unions); clean JSON Schema 2020-12 output (`nullable` unions, normalized `examples`)
|
|
@@ -146,6 +149,7 @@ for (const tool of await generator.generateTools({ target: "claude" })) {
|
|
|
146
149
|
| [Parameter Conflicts](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/parameter-conflicts.md) | How conflict detection and resolution works |
|
|
147
150
|
| [Request Builder](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/request-builder.md) | `buildHttpRequest` — full OpenAPI parameter serialization |
|
|
148
151
|
| [Client Targets](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/client-targets.md) | Per-client schema dialects (Claude, OpenAI, Gemini) |
|
|
152
|
+
| [Curation](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/curation.md) | Token budgets, overlays, lint, trimming, response hints |
|
|
149
153
|
| [Response Schemas](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/response-schemas.md) | Output schemas, status codes, oneOf unions |
|
|
150
154
|
| [Annotations & Extensions](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/annotations.md) | Tool title, annotation inference, `x-mcp` extension family |
|
|
151
155
|
| [Security](https://github.com/agentfront/mcp-from-openapi/blob/main/docs/security.md) | SecurityResolver, all auth types, custom resolvers |
|
|
@@ -167,7 +171,18 @@ for (const tool of await generator.generateTools({ target: "claude" })) {
|
|
|
167
171
|
|
|
168
172
|
## Contributing
|
|
169
173
|
|
|
170
|
-
Contributions are welcome!
|
|
174
|
+
Contributions are welcome! Start with the
|
|
175
|
+
[contributing guide](https://github.com/agentfront/mcp-from-openapi/blob/main/CONTRIBUTING.md);
|
|
176
|
+
this project follows the
|
|
177
|
+
[Contributor Covenant](https://github.com/agentfront/mcp-from-openapi/blob/main/CODE_OF_CONDUCT.md).
|
|
178
|
+
Bug reports and feature requests go through the
|
|
179
|
+
[issue templates](https://github.com/agentfront/mcp-from-openapi/issues/new/choose).
|
|
180
|
+
|
|
181
|
+
## Security
|
|
182
|
+
|
|
183
|
+
Report vulnerabilities privately — see the
|
|
184
|
+
[security policy](https://github.com/agentfront/mcp-from-openapi/blob/main/SECURITY.md).
|
|
185
|
+
When loading untrusted specs, use `secureDefaults: true`.
|
|
171
186
|
|
|
172
187
|
## Related Projects
|
|
173
188
|
|
package/errors.d.ts
CHANGED
|
@@ -43,6 +43,13 @@ export declare class ValidationError extends OpenAPIToolError {
|
|
|
43
43
|
export declare class GenerationError extends OpenAPIToolError {
|
|
44
44
|
constructor(message: string, context?: Record<string, any>);
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Error thrown when an OpenAPI Overlay document is malformed or its JSONPath
|
|
48
|
+
* target uses unsupported syntax
|
|
49
|
+
*/
|
|
50
|
+
export declare class OverlayError extends OpenAPIToolError {
|
|
51
|
+
constructor(message: string, context?: Record<string, any>);
|
|
52
|
+
}
|
|
46
53
|
/**
|
|
47
54
|
* Error thrown when an HTTP request cannot be built from a tool's mapper
|
|
48
55
|
* (missing required parameters, unserializable values, injection attempts)
|