Spaces:
Sleeping
Sleeping
Delete server.js
Browse files
server.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
const express = require('express');
|
| 2 |
-
const { exec } = require('child_process');
|
| 3 |
-
|
| 4 |
-
const app = express();
|
| 5 |
-
|
| 6 |
-
// Run the MCP server as a CLI command
|
| 7 |
-
const mcpCommand = `npx @rashidazarang/airtable-mcp --token ${process.env.AIRTABLE_API_TOKEN} --base ${process.env.AIRTABLE_BASE_ID}`;
|
| 8 |
-
console.log(`Starting MCP server with command: ${mcpCommand}`);
|
| 9 |
-
exec(mcpCommand, (error, stdout, stderr) => {
|
| 10 |
-
if (error) {
|
| 11 |
-
console.error(`Error running MCP server: ${error.message}`);
|
| 12 |
-
console.error(`stderr: ${stderr}`);
|
| 13 |
-
return;
|
| 14 |
-
}
|
| 15 |
-
console.log(`MCP server started successfully`);
|
| 16 |
-
console.log(`MCP server stdout: ${stdout}`);
|
| 17 |
-
console.error(`MCP server stderr: ${stderr}`);
|
| 18 |
-
});
|
| 19 |
-
|
| 20 |
-
app.get('/health', (req, res) => {
|
| 21 |
-
res.json({ status: 'healthy' });
|
| 22 |
-
});
|
| 23 |
-
|
| 24 |
-
// Add a root endpoint for debugging
|
| 25 |
-
app.get('/', (req, res) => {
|
| 26 |
-
res.send('Airtable Node MCP Server is running. Use /airtable/mcp for the MCP endpoint.');
|
| 27 |
-
});
|
| 28 |
-
|
| 29 |
-
const port = process.env.PORT || 7860;
|
| 30 |
-
app.listen(port, () => {
|
| 31 |
-
console.log(`Server running on port ${port}`);
|
| 32 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|