AINPCEngine + Aider

Add AI-powered NPCs with persistent memory to your game. Two integration paths.

AiderCursorClineWindsurfAiderCodex (Copilot)
Two paths: MCP (native tool integration, recommended) or CLI (command line). Both work with Aider. Choose one.

1 Install the CLI

npm install -g ainpc-cli

2 Login

Get an API key at ainpcengine.com/auth/register

ainpc login --local --key YOUR_API_KEY --game my-rpg

3a MCP integration (recommended)

Add to your project's .mcp.json file. Aider auto-discovers 12 NPC tools.

{
  "mcpServers": {
    "ainpcengine": {
      "type": "stdio",
      "command": "ainpc",
      "args": ["mcp-serve"]
    }
  }
}

That's it. Aider now has native access to: create NPCs, talk to them, generate personas, synthesize voice, and more.

- OR -

3b CLI integration (alternative)

Add to your .aider.conf.yml:

# AINPCEngine
Use the ainpc CLI for NPC management.
Config auto-loaded from .ainpc/config.json.
Run ainpc --help for full reference.

Key commands:
  ainpc create "Name" --role merchant      Create NPC
  ainpc say NPC_ID "message"               Talk to NPC
  ainpc generate --role guard              AI-generate NPC
  ainpc list                               List all NPCs
  ainpc speak NPC_ID "text"                NPC voice (TTS)

4 Try it

Ask your agent:

"Create a gruff blacksmith NPC named Grok who remembers players"
"Talk to Grok and ask about swords"
"Generate 5 guard NPCs with unique personalities"
"List all NPCs and their current moods"
"Make Grok say 'Welcome to my forge' with voice"

5 MCP tools reference

ToolDescription
ainpc_list_npcsList all NPCs with name, role, mood
ainpc_show_npcFull NPC detail (personality, backstory)
ainpc_create_npcCreate NPC with traits, speech style
ainpc_sayTalk to an NPC, get AI dialogue response
ainpc_send_eventAny event: combat, trade, quest, ambient
ainpc_generateAI-generate full NPC (OCEAN, schedule, psychology)
ainpc_generate_batchBatch generate with social relationships
ainpc_speakNPC voice synthesis (28 AI voices)
ainpc_update_npcUpdate NPC properties
ainpc_delete_npcDelete NPC permanently
ainpc_healthAPI health and version
ainpc_statsExpert registry and features

6 Game engine demos

# Unity (2022.3+)
git clone https://github.com/jyswee/ainpc-unity-demo.git

# Unreal (UE 5.3+)
git clone https://github.com/jyswee/ainpc-unreal-demo.git

# Godot (4.2+)
git clone https://github.com/jyswee/ainpc-godot-demo.git