-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add root-cms mcp server command #770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| const transport = new StdioServerTransport(); | ||
| await server.connect(transport); | ||
| console.log('Root CMS MCP server listening on stdio. Press Ctrl+C to exit.'); | ||
|
|
||
| await new Promise<void>((resolve, reject) => { | ||
| const shutdown = () => { | ||
| try { | ||
| if (typeof transport.close === 'function') { | ||
| transport.close(); | ||
| } | ||
| } catch (err) { | ||
| reject(err); | ||
| return; | ||
| } | ||
| resolve(); | ||
| }; | ||
| process.once('SIGINT', shutdown); | ||
| process.once('SIGTERM', shutdown); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Resolve MCP server when stdio closes
The CLI keeps the process alive by awaiting a promise that only resolves on SIGINT or SIGTERM. When the MCP client simply closes the stdio transport (the common shutdown path for child processes), no signal is delivered, so the handler in startMcpServer never resolves and the server continues running as an orphaned process. That means every disconnect leaks a hanging root-cms mcp process until it is manually killed. Consider also resolving the promise when the stdio transport closes or when server.connect completes, so the command exits automatically when its pipes are torn down.
Useful? React with 👍 / 👎.
Summary
root-cms mcpCLI command that starts the serverTesting
https://chatgpt.com/codex/tasks/task_e_68d5ac24c97c8323b7d3936d7966b6aa