Spaces:
Sleeping
Sleeping
Update server.js
Browse files
server.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
const express = require('express');
|
| 2 |
-
const {
|
| 3 |
|
| 4 |
const app = express();
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
}
|
|
|
|
|
|
|
| 12 |
});
|
| 13 |
|
| 14 |
app.get('/health', (req, res) => {
|
|
|
|
| 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 |
+
exec(mcpCommand, (error, stdout, stderr) => {
|
| 9 |
+
if (error) {
|
| 10 |
+
console.error(`Error running MCP server: ${error.message}`);
|
| 11 |
+
console.error(`stderr: ${stderr}`);
|
| 12 |
+
return;
|
| 13 |
}
|
| 14 |
+
console.log(`MCP server stdout: ${stdout}`);
|
| 15 |
+
console.error(`MCP server stderr: ${stderr}`);
|
| 16 |
});
|
| 17 |
|
| 18 |
app.get('/health', (req, res) => {
|