11import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js" ;
2- import { createCodexSecurityArtifactWriterServer } from "./artifact-writer-main.js" ;
32import { createCodexSecurityServer } from "./server.js" ;
43
54async function main ( ) : Promise < void > {
6- const artifactWriter = process . argv . includes ( "--artifact-writer" ) ;
7- const server = artifactWriter
8- ? await createCodexSecurityArtifactWriterServer ( )
9- : createCodexSecurityServer ( ) ;
5+ const server = createCodexSecurityServer ( ) ;
106 await server . connect ( new StdioServerTransport ( ) ) ;
117 let closing = false ;
128 const close = async ( exitCode ?: number ) : Promise < void > => {
139 if ( closing ) return ;
1410 closing = true ;
1511 if ( exitCode !== undefined ) process . exitCode = exitCode ;
1612 await server . close ( ) . catch ( ( error : unknown ) => {
17- console . error (
18- artifactWriter
19- ? "Codex Security artifact writer failed to close:"
20- : "Codex Security MCP server failed to close:" ,
21- error ,
22- ) ;
13+ console . error ( "Codex Security MCP server failed to close:" , error ) ;
2314 } ) ;
2415 } ;
2516 process . stdin . once ( "end" , ( ) => void close ( ) ) ;
@@ -28,11 +19,6 @@ async function main(): Promise<void> {
2819}
2920
3021main ( ) . catch ( ( error ) => {
31- console . error (
32- process . argv . includes ( "--artifact-writer" )
33- ? "Codex Security artifact writer failed to start:"
34- : "Codex Security MCP server failed to start:" ,
35- error ,
36- ) ;
22+ console . error ( "Codex Security MCP server failed to start:" , error ) ;
3723 process . exitCode = 1 ;
3824} ) ;
0 commit comments