aeonshift commited on
Commit
f01af94
·
verified ·
1 Parent(s): ef6b159

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +10 -6
server.js CHANGED
@@ -1,14 +1,18 @@
1
  const express = require('express');
2
- const { runMcpServer } = require('@smithery/cli');
3
 
4
  const app = express();
5
 
6
- runMcpServer({
7
- package: '@rashidazarang/airtable-mcp',
8
- options: {
9
- token: process.env.AIRTABLE_API_TOKEN,
10
- base: process.env.AIRTABLE_BASE_ID
 
 
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) => {