MCPcopy Create free account
hub / github.com/PSPDFKit/nutrient-document-engine-mcp-server / startStdioServer

Function startStdioServer

src/index.ts:169–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167
168 // Mount dashboard routes only if enabled
169 if (enableDashboard) {
170 app.use('/dashboard', createDashboardRouter(client));
171 }
172
173 return app;
174}
175
176async function startStdioServer() {
177 const env = getEnvironment();
178 const dashboardEnabled = !!(env.DASHBOARD_USERNAME && env.DASHBOARD_PASSWORD);
179
180 if (dashboardEnabled) {
181 // Start Express server for dashboard
182 const app = createExpressApp(true);
183
184 // Start HTTP server for dashboard
185 app.listen(env.PORT, env.MCP_HOST, () => {
186 logger.info(
187 null,
188 `Dashboard server running on HTTP at ${env.MCP_HOST}:${env.PORT}/dashboard`
189 );
190 });
191 }
192
193 // Start MCP server on stdio
194 const server = createMCPServer();
195 const transport = new StdioServerTransport();
196
197 // Error handling
198 process.on('SIGINT', async () => {
199 await server.close();
200 process.exit(0);
201 });

Callers 1

mainFunction · 0.85

Calls 4

createExpressAppFunction · 0.85
getVersionFunction · 0.85
infoMethod · 0.80
createMCPServerFunction · 0.70

Tested by

no test coverage detected