Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ Global Options:
`
);

// Helper to convert project-name to ProjectName for valid class names
function toPascalCase(str: string): string {
return str
.split(/[-_\s]+/)
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
.join('');
}

program
.command('create <projectName>')
.description('Create a new LeanMCP project with Streamable HTTP transport')
Expand Down Expand Up @@ -206,7 +214,8 @@ program
await fs.writeFile(path.join(targetDir, 'main.ts'), mainTs);

// Create an example service file
const exampleServiceTs = getExampleServiceTemplate(projectName);
const className = toPascalCase(projectName);
const exampleServiceTs = getExampleServiceTemplate(className);
await fs.writeFile(path.join(targetDir, 'mcp', 'example', 'index.ts'), exampleServiceTs);

const gitignore = gitignoreTemplate;
Expand Down
Loading