Spaces:
Sleeping
Sleeping
Delete server.js
Browse files1234567891011121314151617181920212223242526272829303132const express = require('express');const { exec } = require('child_process');
const app = express();
// Run the MCP server as a CLI commandconst mcpCommand = `npx @rashidazarang/airtable-mcp --token ${process.env.AIRTABLE_API_TOKEN} --base ${process.env.AIRTABLE_BASE_ID}`;console.log(`Starting MCP server with command: ${mcpCommand}`);exec(mcpCommand, (error, stdout, stderr) => { if (error) { console.error(`Error running MCP server: ${error.message}`); console.error(`stderr: ${stderr}`); return; } console.log(`MCP server started successfully`); console.log(`MCP server stdout: ${stdout}`); console.error(`MCP server stderr: ${stderr}`);});
app.get('/health', (req, res) => { res.json({ status: 'healthy' });});
// Add a root endpoint for debuggingapp.get('/', (req, res) => { res.send('Airtable Node MCP Server is running. Use /airtable/mcp for the MCP endpoint.');});
const port = process.env.PORT || 7860;app.listen(port, () => { console.log(`Server running on port ${port}`);});server.jsDeleted-32