Update mcp service and index exports

- Add cleanup function to mcp server creation
- Export new Redis transport functions from index

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jerome 2025-07-09 13:03:05 +01:00
commit 93bc76fb04
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View file

@ -36,11 +36,14 @@ const baseSecurityHeaders = (req: express.Request, res: express.Response, next:
// simple logging middleware
const logger = (req: express.Request, res: express.Response, next: express.NextFunction) => {
// if GET and /mcp, log the body returned
console.log(`${new Date().toISOString()} ${req.method} ${req.url}`);
if (req.url.includes('/mcp')) {
console.log(' Headers:', JSON.stringify(req.headers, null, 2));
if (req.method === 'GET' && req.url.includes('/mcp')) {
console.log(' Body:', JSON.stringify(req.body, null, 2));
}
res.on('finish', () => {
console.log(' Response:', res.statusCode);
});
next();
};

View file

@ -674,6 +674,7 @@ export const createMcpServer = (): McpServerWrapper => {
});
const cleanup = async () => {
console.log("Cleaning up MCP server");
if (subsUpdateInterval) clearInterval(subsUpdateInterval);
if (logsUpdateInterval) clearInterval(logsUpdateInterval);
if (stdErrUpdateInterval) clearInterval(stdErrUpdateInterval);