@@ -48,16 +48,16 @@ openapi-mcp-generator --input path/to/openapi.json --output path/to/output/dir -
4848
4949### CLI Options
5050
51- | Option | Alias | Description | Default |
52- | -------------------- | ------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------|
53- | ` --input ` | ` -i ` | Path or URL to OpenAPI specification (YAML or JSON) | ** Required** |
54- | ` --output ` | ` -o ` | Directory to output the generated MCP project | ** Required** |
55- | ` --server-name ` | ` -n ` | Name of the MCP server (` package.json:name ` ) | OpenAPI title or ` mcp-api-server ` |
56- | ` --server-version ` | ` -v ` | Version of the MCP server (` package.json:version ` ) | OpenAPI version or ` 1.0.0 ` |
57- | ` --base-url ` | ` -b ` | Base URL for API requests. Required if OpenAPI ` servers ` missing or ambiguous. | Auto-detected if possible |
58- | ` --transport ` | ` -t ` | Transport mode: ` "stdio" ` (default), ` "web" ` , or ` "streamable-http" ` | ` "stdio" ` |
59- | ` --port ` | ` -p ` | Port for web-based transports | ` 3000 ` |
60- | ` --force ` | | Overwrite existing files in the output directory without confirmation | ` false ` |
51+ | Option | Alias | Description | Default |
52+ | ------------------ | ----- | ------------------------------------------------------------------------------ | --------------------------------- |
53+ | ` --input ` | ` -i ` | Path or URL to OpenAPI specification (YAML or JSON) | ** Required** |
54+ | ` --output ` | ` -o ` | Directory to output the generated MCP project | ** Required** |
55+ | ` --server-name ` | ` -n ` | Name of the MCP server (` package.json:name ` ) | OpenAPI title or ` mcp-api-server ` |
56+ | ` --server-version ` | ` -v ` | Version of the MCP server (` package.json:version ` ) | OpenAPI version or ` 1.0.0 ` |
57+ | ` --base-url ` | ` -b ` | Base URL for API requests. Required if OpenAPI ` servers ` missing or ambiguous. | Auto-detected if possible |
58+ | ` --transport ` | ` -t ` | Transport mode: ` "stdio" ` (default), ` "web" ` , or ` "streamable-http" ` | ` "stdio" ` |
59+ | ` --port ` | ` -p ` | Port for web-based transports | ` 3000 ` |
60+ | ` --force ` | | Overwrite existing files in the output directory without confirmation | ` false ` |
6161
6262## 📦 Programmatic API
6363
@@ -74,7 +74,7 @@ const filteredTools = await getToolsFromOpenApi('https://example.com/api-spec.js
7474 baseUrl: ' https://api.example.com' ,
7575 dereference: true ,
7676 excludeOperationIds: [' deletePet' ],
77- filterFn : (tool ) => tool .method .toLowerCase () === ' get'
77+ filterFn : (tool ) => tool .method .toLowerCase () === ' get' ,
7878});
7979```
8080
@@ -100,6 +100,7 @@ The generated project includes:
100100```
101101
102102Core dependencies:
103+
103104- ` @modelcontextprotocol/sdk ` - MCP protocol implementation
104105- ` axios ` - HTTP client for API requests
105106- ` zod ` - Runtime validation
@@ -138,31 +139,31 @@ Implements the MCP StreamableHTTP transport which offers:
138139
139140### Transport Comparison
140141
141- | Feature | stdio | web (SSE) | streamable-http |
142- | ---------| -------| -----------| ----------------|
143- | Protocol | JSON-RPC over stdio | JSON-RPC over SSE | JSON-RPC over HTTP |
144- | Connection | Persistent | Persistent | Request/response |
145- | Bidirectional | Yes | Yes | Yes (stateful) |
146- | Multiple clients | No | Yes | Yes |
147- | Browser compatible | No | Yes | Yes |
148- | Firewall friendly | No | Yes | Yes |
149- | Load balancing | No | Limited | Yes |
150- | Status codes | No | Limited | Full HTTP codes |
151- | Headers | No | Limited | Full HTTP headers |
152- | Test client | No | Yes | Yes |
142+ | Feature | stdio | web (SSE) | streamable-http |
143+ | ------------------ | ------------------- | ----------------- | ------------------ |
144+ | Protocol | JSON-RPC over stdio | JSON-RPC over SSE | JSON-RPC over HTTP |
145+ | Connection | Persistent | Persistent | Request/response |
146+ | Bidirectional | Yes | Yes | Yes (stateful) |
147+ | Multiple clients | No | Yes | Yes |
148+ | Browser compatible | No | Yes | Yes |
149+ | Firewall friendly | No | Yes | Yes |
150+ | Load balancing | No | Limited | Yes |
151+ | Status codes | No | Limited | Full HTTP codes |
152+ | Headers | No | Limited | Full HTTP headers |
153+ | Test client | No | Yes | Yes |
153154
154155---
155156
156157## 🔐 Environment Variables for Authentication
157158
158159Configure auth credentials in your environment:
159160
160- | Auth Type | Variable Format |
161- | -------------| ----------------------------------------------------------|
162- | API Key | ` API_KEY_<SCHEME_NAME> ` |
163- | Bearer | ` BEARER_TOKEN_<SCHEME_NAME> ` |
164- | Basic Auth | ` BASIC_USERNAME_<SCHEME_NAME> ` , ` BASIC_PASSWORD_<SCHEME_NAME> ` |
165- | OAuth2 | ` OAUTH_CLIENT_ID_<SCHEME_NAME> ` , ` OAUTH_CLIENT_SECRET_<SCHEME_NAME> ` , ` OAUTH_SCOPES_<SCHEME_NAME> ` |
161+ | Auth Type | Variable Format |
162+ | ---------- | -------------------------------------------------------------------------------------------------- |
163+ | API Key | ` API_KEY_<SCHEME_NAME> ` |
164+ | Bearer | ` BEARER_TOKEN_<SCHEME_NAME> ` |
165+ | Basic Auth | ` BASIC_USERNAME_<SCHEME_NAME> ` , ` BASIC_PASSWORD_<SCHEME_NAME> ` |
166+ | OAuth2 | ` OAUTH_CLIENT_ID_<SCHEME_NAME> ` , ` OAUTH_CLIENT_SECRET_<SCHEME_NAME> ` , ` OAUTH_SCOPES_<SCHEME_NAME> ` |
166167
167168---
168169
@@ -214,8 +215,9 @@ Contributions are welcome!
214215
2152161 . Fork the repo
2162172 . Create a feature branch: ` git checkout -b feature/amazing-feature `
217- 3 . Commit your changes: ` git commit -m "Add amazing feature" `
218- 4 . Push and open a PR
218+ 3 . Run ` npm run format.write ` to format your code
219+ 4 . Commit your changes: ` git commit -m "Add amazing feature" `
220+ 5 . Push and open a PR
219221
220222📌 Repository: [ github.com/harsha-iiiv/openapi-mcp-generator] ( https://github.com/harsha-iiiv/openapi-mcp-generator )
221223
0 commit comments