# rct.ai MCP

> rct.ai provides the engine to build, control, and simulate AI NPCs for games and metaverse worlds. This MCP gives your agent 10 tools to handle everything from creating a character profile (using `create_character`) to running complex interactions with an NPC via `send_inference`. It lets you configure persistent narrative sessions (`create_session`), define character backstories, and control the underlying randomness using the Chaos Box algorithm. Use it when your AI needs more than just simple chat—it needs a full lifecycle.

## Overview
- **Category:** developer-apis
- **Price:** Free
- **Tags:** npc-ai, metaverse, narrative-engine, virtual-beings, gaming-api, chaos-box

## Description

**rct.ai** gives you the engine to build and run autonomous NPCs for games or any metaverse world. You're not just running chat prompts; you're managing a character's entire life cycle—their history, their personality shifts, and how they react when things get unpredictable. This MCP hands your agent ten specific tools that handle everything from initial profile creation to simulating complex narrative decisions.

### Character Setup: Building the NPC Core

You start by defining who these characters are. Using `create_character`, you build a brand-new AI profile, setting up all their core traits and giving them access to specific knowledge bases. Once that's done, if you need details on an existing character, running `get_character` pulls every piece of configuration data associated with that unique ID. Want to tweak the lore or change their personality without starting over? Use `update_character`; it modifies any part of the profile—the traits, the background info, whatever—on the fly.

To keep track of everyone you've built, running `list_characters` gives you an index of every single character defined and managed in your account. Furthermore, if a character needs external context, running `list_assets` shows you all the attached knowledge bases or data assets that specific character can reference when talking to someone.

### Running the Conversation: Interaction State Management

The whole point is interaction. You handle this by simulating real conversations. To start fresh, use `create_session`, which initializes a persistent chat session between your user and an NPC. This keeps the context clear, so the character remembers what was said minutes ago. When you need to know where things stand in that ongoing dialogue, running `get_session` pulls the full status and context of the current interaction. For actual gameplay or conversation flow, you send text input to a specific NPC using `send_inference`; your agent receives a generated response that feels natural because it's tied directly to the character’s established personality and the session's history.

### Controlling the Narrative: Logic and Randomness

The trickiest part of building NPCs is making them feel alive—meaning they can surprise you. You manage that with the Chaos Box logic. If you need to know what rules are governing how random or structured the story flow should be, use `get_chaos_box_config` to retrieve those current parameters. And when the narrative needs a major shift in tone—maybe it's getting too predictable, or maybe it needs more wild unpredictability—you adjust everything using `update_chaos_box_config`. This tool lets you fine-tune the decision-making process that governs story flow and any unexpected events within your simulated world.

This system means your agent handles the entire lifecycle: from definition (`create_character`) to asset linking (`list_assets`), managing conversation state (`get_session`, `send_inference`), modifying character lore (`update_character`), and finally, controlling the underlying narrative structure itself (`get_chaos_box_config`). You've got everything you need for a full-scale simulation.

## Tools

### create_character
Creates a new AI NPC profile with defined traits and knowledge bases.

### create_session
Starts a fresh, persistent interaction session between the user and an NPC.

### get_chaos_box_config
Retrieves the current parameters that control narrative randomness and logic flow for NPCs.

### get_character
Fetches all detailed configuration data for a specific, existing AI character ID.

### get_session
Retrieves the full context and status of an ongoing user-NPC interaction session.

### send_inference
Sends user input to a specific NPC and receives a generated, context-aware response.

### list_assets
Lists all attached knowledge bases or data assets available for a character to reference.

### list_characters
Returns an index of every AI character currently defined and managed in your account.

### update_chaos_box_config
Changes the parameters governing how randomized or structured the narrative decisions should be.

### update_character
Modifies any aspect of an existing character, like personality or lore, without recreating the profile.

## Prompt Examples

**Prompt:** 
```
Send interaction message 'Who are you?' to NPC character 'char_123'.
```

**Response:** 
```
I'm communicating with the Morpheus engine... NPC 'Guardian' (ID: char_123) responded: 'I am the keeper of the ancient scrolls. What knowledge do you seek?'. Current session status is active.
```

**Prompt:** 
```
List all AI characters managed in my account.
```

**Response:** 
```
Retrieving your characters... I found 3 NPCs: 1. Merchant (ID: c1), 2. Guard (ID: c2), 3. Oracle (ID: c3). All are currently 'online' in the Morpheus Cloud.
```

**Prompt:** 
```
Get the current Chaos Box configuration.
```

**Response:** 
```
Fetching Chaos Box parameters... Current logic is set to 'Stochastic-Balanced' with a randomness factor of 0.4. Would you like to adjust these values?
```

## Capabilities

### Define Character Profiles
Creates a new, detailed AI NPC profile using `create_character`.

### Run Conversational Inference
Sends text input to an existing NPC and gets a natural response back via the `send_inference` tool.

### Manage Interaction State
Initializes or retrieves details about an ongoing user-NPC conversation session using `create_session` and `get_session`.

### Update Character Parameters
Modifies the traits, personality, or knowledge base of a character with `update_character`.

### Control Narrative Randomness
Read or adjust the parameters that govern story flow and unpredictable events using `get_chaos_box_config` and `update_chaos_box_config`.

### List Character Assets
Retrieves a list of knowledge bases or assets tied to specific characters via `list_assets`.

## Use Cases

### The Quest Giver Needs to Change
A developer wants an NPC's role to change mid-game. Instead of rewriting the character, they use `get_character` first to check the current state. Then, they run `update_character`, changing key traits and adding a new lore asset via `list_assets`. The next time the agent runs `send_inference`, the NPC speaks with its new persona.

### Debugging Strange NPC Behavior
An unexpected dialogue chain happens. Before reporting it, the team uses `get_session` to pull up the entire interaction history and context log. This proves whether the issue was a single input or if the underlying Chaos Box parameters needed adjustment using `update_chaos_box_config`.

### Building a Starter World
An architect needs 10 distinct NPCs for a new zone. They start by running `list_characters` to see what's available, then loop through the list calling `create_character` ten times with specific backstories and knowledge bases. This rapidly populates the world with ready-to-use agents.

### Testing High Stakes Story Arcs
A narrative designer needs to test how a critical dialogue scene plays out when high chaos is involved. They set up the initial context using `create_session`, then use `get_chaos_box_config` to confirm randomness parameters, and finally run multiple rounds of `send_inference` to see if the story breaks in interesting ways.

## Benefits

- Character consistency isn't a guess anymore. Use `get_character` to pull up the full profile, ensuring your agent remembers that character’s specific history before running an inference.
- Never lose context mid-conversation. The `create_session` and `get_session` tools keep track of every turn, so NPCs react logically, not just randomly, throughout a long quest arc.
- Need the story to break free? Use `update_chaos_box_config`. You can dial up or down the randomness factor—it’s direct control over plot unpredictability.
- Building complex worlds requires more than chatting. The `list_assets` tool lets you attach specific knowledge bases (like lore documents) that NPCs actually reference when they talk.
- It handles the heavy lifting of communication. Just calling `send_inference` sends the input, and the engine returns a fully contextualized reply, saving your agent from hallucinating basic dialogue.

## How It Works

The bottom line is that you need a developer account and an API key before any of the functions actually run.

1. First, you must subscribe to the rct.ai MCP Server on Vinkius.
2. Next, sign up at rct.ai and generate your API Key after gaining Morpheus Cloud access.
3. Finally, configure your AI client to use this key when calling tools like `send_inference` or `list_characters`.

## Frequently Asked Questions

**How do I make sure my NPC remembers lore details using rct.ai?**
You must first use `list_assets` to attach the specific knowledge base (the lore document) to the character profile, and then call `update_character` if you need to adjust which assets are active.

**What is the difference between create_session and list_characters?**
`list_characters` just gives you an index of every NPC defined in your account. `create_session` starts a new, live interaction instance for one specific character.

**Can I change the difficulty or randomness of story events with rct.ai?**
Yes. You use `get_chaos_box_config` to see the current settings, and then run `update_chaos_box_config` to adjust parameters like the randomness factor.

**What if I update a character's traits, do I need to recreate them?**
No. You use `update_character`. This tool modifies an existing profile in place, preserving all their current session history and assets.

**What credentials do I need before I can successfully use the `list_characters` tool?**
You must have an active Morpheus Cloud developer key. The server requires your API Key—generated in the developer console—for all operations, including listing characters and managing sessions.

**If I use `send_inference` and receive a status error, what does that mean?**
An inference failure usually means the NPC timed out or hit an internal guardrail. Check the payload for a specific `TIMEOUT` code; this requires retrying the input with clearer context to guide the narrative.

**What scope of data does the `get_character` tool provide?**
It returns all stored parameters, including personality traits, knowledge base references (assets), and the character's most recent behavioral state. This lets you audit the full profile before making any changes.

**How do I handle high-volume messages without hitting rate limits?**
To maintain reliable throughput for repeated queries, group related calls into persistent sessions using `create_session`. This keeps your agent connected to the context and reduces overhead compared to starting new interactions every time.

**What is the Chaos Box and how can I configure it?**
The Chaos Box is rct.ai's proprietary narrative engine. You can use the `update_chaos_box_config` tool to adjust decision-making parameters and balance stochastic randomness within your NPC interactions.

**Can I manage persistent player sessions with my AI agent?**
Yes! Use the `create_session` and `get_session` tools to maintain context and state for individual players interacting with your virtual beings.

**How do I list all assets attached to my characters?**
Use the `list_assets` tool. It will retrieve all knowledge bases and data sets currently associated with your Morpheus Cloud characters.