Commit e76e24c
feat(swagger): add automatic MCP tool generation from Swagger/OpenAPI… (#51)
* feat(swagger): add automatic MCP tool generation from Swagger/OpenAPI specs
- Add command to generate MCP tools from Swagger 2.0 and OpenAPI 3.0 specifications
- Support both local files and remote URLs as input sources
- Parse endpoints and generate tool classes with HTTP client implementation
- Handle authentication (Bearer tokens, API keys)
- Auto-register generated tools in configuration
- Include comprehensive test fixtures for Swagger/OpenAPI formats
- Document new command with usage examples in README
This enables rapid integration of external APIs by automatically converting
their Swagger/OpenAPI documentation into functional MCP tools.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Revert "feat(swagger): add automatic MCP tool generation from Swagger/OpenAPI specs"
This reverts commit 4868901.
* feat: add automatic MCP tool generation from Swagger/OpenAPI specs (v1.4.0)
Introduces powerful automatic tool generation from any Swagger/OpenAPI specification,
dramatically reducing time needed to integrate external APIs.
Major features:
- SwaggerParser: Supports OpenAPI 3.x and Swagger 2.0 formats
- SwaggerToMcpConverter: Converts API endpoints to MCP tool parameters
- MakeSwaggerMcpToolCommand: Interactive CLI with endpoint selection
- Smart naming: Detects hash-like operationIds and uses path-based naming
- Authentication support: API Key, Bearer Token, OAuth2 generation
- API testing: Validates connectivity before tool generation
- Endpoint grouping: By tags, path prefixes, or individual selection
- Comprehensive test coverage for naming conversion and parsing logic
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* feat(swagger): add resource generation support to Swagger/OpenAPI generator
Extends the Swagger/OpenAPI generator to support creating both MCP Tools and Resources:
- Add resource generation mode with smart type selection (GET → Resource, others → Tool)
- Implement programmatic stub system for dynamic class generation
- Add comprehensive resource generation tests
- Update documentation to reflect dual generation capability
- Enhance command UI with type selection workflow
Allows users to generate read-only Resources for data endpoints alongside action-oriented Tools.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix styling
* feat: implement security and maintainability improvements
- Add URL validation to prevent SSRF attacks in SwaggerParser
- Standardize error handling to use JsonRpcErrorException
- Make HTTP timeouts configurable instead of hardcoded
- Refactor generateHttpRequest() method into smaller focused methods
Co-authored-by: Sangrak Choi <[email protected]>
* Fix styling
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: kargnas <[email protected]>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Sangrak Choi <[email protected]>1 parent 66dc467 commit e76e24c
File tree
13 files changed
+3153
-31
lines changed- src
- Console/Commands
- Services/SwaggerParser
- stubs
- tests
- Unit
- fixtures
13 files changed
+3153
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
36 | 61 | | |
37 | 62 | | |
38 | 63 | | |
| |||
310 | 335 | | |
311 | 336 | | |
312 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
313 | 436 | | |
314 | 437 | | |
315 | 438 | | |
| |||
0 commit comments