MCP-DCS-LuaRunner-vercel

sevenfifty777/MCP-DCS-LuaRunner-vercel

3.1

If you are the rightful owner of MCP-DCS-LuaRunner-vercel and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Vercel-compatible MCP server for executing Lua code on a DCS server via HTTP.

MCP-DCS-LuaRunner-vercel

Vercel-compatible MCP server for executing Lua code on a DCS server via HTTP.

Features

  • HTTP endpoint /api/execute-lua for remote Lua code execution on DCS World.
  • Designed for deployment on Vercel.
  • Reads DCS server connection info from environment variables (not from local files).

Installation & Deployment

1. Clone the repository

git clone https://github.com/sevenfifty777/MCP-DCS-LuaRunner-vercel.git
cd MCP-DCS-LuaRunner-vercel/mcp-server-vercel

2. Install dependencies (for local development)

npm install

3. Set up environment variables

On Vercel, set these in the dashboard under Project > Settings > Environment Variables:

  • DCS_SERVER_ADDRESS (e.g., 127.0.0.1)
  • DCS_SERVER_PORT (e.g., 12080)
  • DCS_SERVER_ADDRESS_GUI (optional)
  • DCS_SERVER_PORT_GUI (optional)
  • DCS_USE_HTTPS (true or false)
  • DCS_WEB_AUTH_USERNAME (if needed)
  • DCS_WEB_AUTH_PASSWORD (if needed)
  • DCS_RUN_CODE_LOCALLY (true or false)
  • DCS_RUN_IN_MISSION_ENV (true or false)
  • DCS_RETURN_DISPLAY_FORMAT (optional, e.g., lua)

Note: Do not use local file paths for configuration on Vercel.

4. Deploy to Vercel

Step-by-step Vercel deployment:

  1. Go to Vercel and sign in or create an account.
  2. Click "Add New Project" and select "Import Git Repository".
  3. Choose your GitHub account and select the MCP-DCS-LuaRunner-vercel repository.
  4. When prompted, set the Root Directory to mcp-server-vercel.
  5. In the "Environment Variables" section, add the required DCS connection variables (see above).
  6. Click "Deploy" to start the build and deployment process.
  7. After deployment, your endpoint will be available at
    https://<your-vercel-project>.vercel.app/api/execute-lua
  • Vercel will auto-detect the serverless function and deploy /api/execute-lua.

Usage

Send a POST request to your deployed endpoint:

POST /api/execute-lua
Content-Type: application/json

{
  "code": "<your Lua code here>"
}

Response:

  • On success: { "result": ... }
  • On error: { "error": ... }

Local Development

You can run the server locally using Vercel CLI:

npm install -g vercel
vercel dev

Then POST to http://localhost:3000/api/execute-lua.


License

MIT