Metadata-Version: 2.4
Name: openapi2mcp-py
Version: 0.3.0
Summary: Generate MCP servers from OpenAPI specs, in multiple target languages (Python, TypeScript, ...)
Project-URL: Homepage, https://github.com/OrgBloch/openapi2mcp-py
Project-URL: Issues, https://github.com/OrgBloch/openapi2mcp-py/issues
Author-email: Johannes Bloch <johannes@bloch.dk>
License-Expression: MIT
License-File: LICENSE
Keywords: code-generation,mcp,model-context-protocol,openapi
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Requires-Dist: jinja2>=3.1
Requires-Dist: prance[osv]>=23.6
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# openapi2mcp-py

`openapi2mcp` is a Python CLI that converts an OpenAPI specification into a runnable MCP server project.

## Features

- Generates MCP server projects from OpenAPI specs.
- Supports multiple target languages.
- Produces tool definitions from OpenAPI operations.
- Carries over auth/environment configuration into generated projects.

## Supported Targets

- `python` - FastMCP-based Python server
- `typescript` - MCP TypeScript SDK server
- `csharp` - MCP C# SDK server
- `java` - official MCP Java SDK server (stdio)
- `java-spring` - Spring Boot + Spring AI MCP server

## Installation

```bash
pip install -e .
```

## Usage

Generate a server project from an OpenAPI file:

```bash
python -m openapi2mcp.cli generate tests/fixtures/petstore.yaml --lang python --output ./out-py
```

List supported languages:

```bash
python -m openapi2mcp.cli list-languages
```

## Notes

- The generated output directories are auto-generated and can be regenerated at any time.
- Use `java` when you want the official MCP Java SDK runtime.
- Use `java-spring` only when you explicitly want Spring AI integration.
