Add AI-powered NPCs with persistent memory to your game. Two integration paths.
npm install -g ainpc-cli
Get an API key at ainpcengine.com/auth/register
ainpc login --local --key YOUR_API_KEY --game my-rpg
Add to your project's .mcp.json file. Codex (Copilot) auto-discovers 12 NPC tools.
{
"mcpServers": {
"ainpcengine": {
"type": "stdio",
"command": "ainpc",
"args": ["mcp-serve"]
}
}
}
That's it. Codex (Copilot) now has native access to: create NPCs, talk to them, generate personas, synthesize voice, and more.
- OR -
Add to your codex.md:
# 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)
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"
| Tool | Description |
|---|---|
ainpc_list_npcs | List all NPCs with name, role, mood |
ainpc_show_npc | Full NPC detail (personality, backstory) |
ainpc_create_npc | Create NPC with traits, speech style |
ainpc_say | Talk to an NPC, get AI dialogue response |
ainpc_send_event | Any event: combat, trade, quest, ambient |
ainpc_generate | AI-generate full NPC (OCEAN, schedule, psychology) |
ainpc_generate_batch | Batch generate with social relationships |
ainpc_speak | NPC voice synthesis (28 AI voices) |
ainpc_update_npc | Update NPC properties |
ainpc_delete_npc | Delete NPC permanently |
ainpc_health | API health and version |
ainpc_stats | Expert registry and features |
# 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