Skip to content

Commit cd65bb5

Browse files
committed
Add error handling for CLI
1 parent 8e0aac8 commit cd65bb5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/mcp/src/cli.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
44
import { createServer } from './server';
55

6-
// Start receiving messages on stdin and sending messages on stdout
7-
const transport = new StdioServerTransport();
8-
(async () => {
6+
async function main() {
7+
const transport = new StdioServerTransport();
98
const server = createServer();
109
await server.connect(transport);
11-
})();
10+
console.log("OpenZeppelin Contracts MCP Server is running...");
11+
}
12+
13+
main().catch((error) => {
14+
console.error("Failed to start OpenZeppelin Contracts MCP Server:", error);
15+
process.exit(1);
16+
});

0 commit comments

Comments
 (0)