File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import {
3030
3131// Import types
3232import { CliOptions , TransportType } from './types/index.js' ;
33+ import pkg from '../package.json' with { type : 'json' } ;
3334
3435// Export programmatic API
3536export { getToolsFromOpenApi , McpToolDefinition , GetToolsOptions } from './api.js' ;
@@ -72,13 +73,12 @@ program
7273 ( val ) => parseInt ( val , 10 )
7374 )
7475 . option ( '--force' , 'Overwrite existing files without prompting' )
75- . version ( '3.1.2' ) // Match package.json version
76- . action ( options => {
77- runGenerator ( options )
78- . catch ( ( error ) => {
79- console . error ( 'Unhandled error:' , error ) ;
80- process . exit ( 1 ) ;
81- } ) ;
76+ . version ( pkg . version ) // Match package.json version
77+ . action ( ( options ) => {
78+ runGenerator ( options ) . catch ( ( error ) => {
79+ console . error ( 'Unhandled error:' , error ) ;
80+ process . exit ( 1 ) ;
81+ } ) ;
8282 } ) ;
8383
8484// Export the program object for use in bin stub
@@ -283,4 +283,4 @@ async function runGenerator(options: CliOptions & { force?: boolean }) {
283283}
284284
285285// Export the run function for programmatic usage
286- export { runGenerator as generateMcpServer } ;
286+ export { runGenerator as generateMcpServer } ;
You can’t perform that action at this time.
0 commit comments