Improve CLI and organize tests

- Fix CLI to properly handle --version flag and serve command
- Made serve command the default command
- Added server.js as entry point wrapper
- Version bumped to 2.0.1 for npm release
- Organized test files into test/ directory
This commit is contained in:
2025-09-15 08:44:21 -05:00
parent c9850818a9
commit 22c08a5946
6 changed files with 31 additions and 3 deletions
+8 -1
View File
@@ -1,12 +1,19 @@
{
"name": "@hanzo/mcp",
"version": "2.0.0",
"version": "2.0.1",
"description": "Hanzo MCP Server - Unified search, TreeSitter AST, vector store, and agent orchestration",
"main": "dist/index.js",
"type": "module",
"bin": {
"hanzo-mcp": "./dist/cli.js"
},
"files": [
"dist/",
"server.js",
"package.json",
"README.md",
"LICENSE"
],
"scripts": {
"build": "npm run build:lib && npm run build:cli",
"build:lib": "esbuild src/index.ts --bundle --platform=node --target=node16 --format=esm --outfile=dist/index.js --external:@modelcontextprotocol/sdk --external:glob --external:commander --external:zod --external:zod-to-json-schema --external:mime-types --external:path --external:fs --external:url",
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env node
/**
* Hanzo MCP Server Entry Point
* This file serves as a simple entry point for running the MCP server
*/
import('./dist/cli.js').catch(err => {
console.error('Failed to start Hanzo MCP server:', err);
process.exit(1);
});
+12 -2
View File
@@ -37,10 +37,20 @@ const program = new Command();
program
.name('hanzo-mcp')
.description('Hanzo MCP Server - Model Context Protocol tools for AI development')
.version(packageJson.version);
.version(packageJson.version)
.option('--version', 'Display version number')
.action((options) => {
// Default action when no command is specified
if (options.version) {
console.log(packageJson.version);
process.exit(0);
}
// If no options, show help
program.outputHelp();
});
program
.command('serve')
.command('serve', { isDefault: true })
.description('Start the MCP server')
.option('-t, --transport <type>', 'Transport type (stdio, http)', 'stdio')
.option('-p, --port <port>', 'Port for HTTP transport', '3000')
View File