- DEFCON MCP Server
DEFCON MCP Server
Content
DEFCON MCP Server
This is a Model Context Protocol (MCP) server for Introversion Software's 2007 game DEFCON, which allows your favourite AI tool to play GLOBAL THERMONUCLEAR WAR.

Setting up
- Install DEFCON. Make sure to start it once to load your CD key.
- Download the DEFCON AI API and extract v1.57 to your DEFCON installation folder. You may want to rename the AI API .exe to
DEFCON_ai.exe. - Download LUABOT and extract it to
<defcon installation folder>/AI; rename the folder so that you have<defcon installation folder>/AI/luabot/luabot.dll. - Git clone this repository into the
luabotfolder. - The MCP server writes to an input text file, which the Lua bot reads. The lua bot then writes to an output text file which is read by the MCP server. You will have to set the file paths yourself; they're hardcoded to write to
R:\input.txtandR:\output.txtby default, but you can supplyinputfileand/oroutputfileCLI arguments to Defcon to override tis. A RAMDisk is recommended if you can set one up. - Install dependencies with
npm ciin this repository folder. - Start the game via
.\Defcon_ai.exe host nowan nolan nowlan luabot="AI\luabot\main.lua" numplayers=2 territory=0 debug inputfile="D://input.txt" outputfile="D://output.txt". SelectAI/luabot/luabot.dllas the "external bot", and then add an internal AI player as well. The game should start automatically; if it doesn't just ready up to start! - Configure your MCP-enabled LLM interface to start the MCP server via
node mcp-server.mjs(for stdio transport) ornode mcp-server.mjs --http(for HTTP transport). You can pass--inputfile="D://input.txt"and--outputfile="D://output.txt"or similar to set the location of input/output text files. - Watch the carnage unfold!
Architecture
The DEFCON MCP Server uses a multi-layered architecture to enable AI-powered gameplay:
- Game Layer: DEFCON game running with the AI API extension
- Lua Bridge: A Lua bot (
main.lua) that interfaces with the game through the DEFCON AI API - File I/O Layer: Communication between the Lua bot and MCP server via text files
input.txt: Commands from MCP server to the gameoutput.txt: Game state information from the game to the MCP server
- MCP Server Layer: Node.js server (
mcp-server.mjs) implementing the Model Context Protocol- Provides standardized tools, resources, and prompts for LLM interaction
- Supports both stdio and HTTP transport methods
- LLM Integration Layer: Your AI tool connects to the MCP server to analyze game state and issue commands
Data Flow
- The Lua bot reads the game state and writes it to
output.txt - The MCP server reads
output.txtto get the current game state - The LLM analyzes the game state and decides on actions
- The MCP server writes commands to
input.txt - The Lua bot reads
input.txtand executes commands in the game
Command Correlation
The system uses correlation IDs to track command execution:
- Each command sent to the game includes a unique ID
- Command results are tagged with the same ID
- This allows the MCP server to verify if commands were executed successfully
Available MCP Tools
The MCP server provides the following tools:
debug-log: Send a debug message to the game logsend-chat: Send a chat message to opponentsplace-structure: Place a structure (RadarStation, Silo, or AirBase) at specified coordinatesplace-fleet: Place a fleet of ships at specified coordinatesmove-fleet: Move a fleet to specified coordinateswhiteboard-draw: Draw a line on the whiteboardwhiteboard-clear: Clear all lines from the whiteboardlaunch-nuke: Launch a nuclear missile from a silo to target coordinatesset-silo-defensive: Set a silo to defensive modeget-command-results: Retrieve results of previously executed commandsget-game-state: Get the latest game state informationgenerate-ai-response: Generate an AI response based on the current game state
Available MCP Resources
The MCP server provides the following resources:
defcon://game-state: Get the current game statedefcon://level: Get the current DEFCON level
Available MCP Prompts
The MCP server provides the following prompts:
analyze-game-state: Analyze the current game state and suggest optimal movessuggest-structure-placement: Suggest optimal locations for structure placementsuggest-nuke-targets: Suggest optimal targets for nuclear strikes
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
Tavily Mcp
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。