Skip to content

Conversation

@stevenle
Copy link
Member

Summary

  • add an MCP server implementation that exposes Root CMS doc data over stdio
  • register a new root-cms mcp CLI command that starts the server
  • include @modelcontextprotocol/sdk as a dependency for the CLI

Testing

  • not run (per instructions)

https://chatgpt.com/codex/tasks/task_e_68d5ac24c97c8323b7d3936d7966b6aa

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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

Comment on lines +206 to +224
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);
});

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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants