Connecting an agent
Switch on agent access in Studio, add Studio to an MCP client, and give the agent the skill.
Connecting takes three things: agent access switched on in Studio, the endpoint added to the agent's settings, and the skill installed where the agent looks for it.
Switch on agent access
Open the settings
Open Settings → Agent access. In a project window, the menu bar's Agent menu leads to the same place through Agent access settings….
Allow agents to connect
Switch on Allow agents to connect. Endpoint address shows the endpoint, http://127.0.0.1:47219/mcp unless the port was changed, and reads Listening. once it is served.
Endpoint port takes effect at once and accepts 1024 to 65535. Studio serves on that port or not at all. When another program holds it, or the system has reserved it, the endpoint does not start: Endpoint address reads, for example, Could not start: Port 47219 is in use by another program., and the project window's Agent menu shows the same line. Enter another port, then copy the configuration again for agents set up before.
The default port changed from 54080 to 47219 in Studio 1.6.2. A profile that came from an earlier release and never had its port changed by hand is moved to the new port once, and Endpoint address then reads The endpoint moved to port 47219. Copy the connection configuration again for clients set up before. The line goes once a configuration has been copied.
Allow changes
Switch on Allow agents to change projects when the agent should edit. It is off by default. While it is off, the agent can read the project and every change it tries is refused.
Turning it on from the menu bar, Agent → Allow agents to modify the project, asks for confirmation first, in a Studio window.
Allow agents full access, below it, is off by default and is not needed to make a game. It lets agents change projects and read any folder without asking; see Full access before turning it on.
Add the folders that hold your files
Under Folders agents may import from, Add folder… adds the folder that holds the art and audio the agent should import. Files inside the project can always be imported.
This step is optional. When an agent needs a file from any other folder, Studio asks you in a window, Allow the agent to read a folder?, and a folder you allow is added to this list. See Folders outside the project.
Pick the application and copy the configuration
Pick the application you use under Agent application: Claude Code, Claude Desktop, Codex, opencode, Cursor, Gemini CLI or Other. The Connection configuration and the Agent Skill below are for that one.
Connection configuration gives that application a ready-to-paste configuration with the endpoint address and the access token filled in, and says where it goes: for Claude Code it is a command to Run in a terminal, for the others it is Merge into … a file, and Other reads Streamable HTTP. Enter this address and header in the client's MCP settings. While Allow agents to connect is off, it reads Available once "Allow agents to connect" is on.
Agent Skill installs the skill where that application reads skills; see Install the skill.
A project window's Agent → Copy connection configuration offers six forms: Claude Code, Claude Desktop, Codex, opencode, Gemini CLI and JSON.
Endpoint address and Access token each have a copy button, Copy address and Copy token. The token itself is never shown in full, only its last four characters. After Regenerate access token → Regenerate, clients set up with the old token stop being let in.
The Agent menu
A project window's menu bar has an Agent menu:
| Item | Does |
|---|---|
| Status line | The connected client and its state, for example Agent: Claude Code · Working. Not clickable |
| Pause agent / Resume agent | Refuses every change from agents in this project until resumed |
| Follow agent edits | Opens the editor where each change lands |
| Agent log | Opens the log of every call in this project |
| Enable agent access | The same switch as Allow agents to connect |
| Allow agents to change projects | The same switch as the one in Settings, with a confirmation when turned on. While full access is on, it shows as on and cannot be switched |
| Allow agents full access | The same switch as the one in Settings, with a confirmation when turned on |
| Copy connection configuration | Six forms: Claude Code, Claude Desktop, Codex, opencode, Gemini CLI and JSON |
| Export Agent Skill… | Writes the skill folder to a folder you pick |
| Agent access settings… | Opens Settings → Agent access |
Pausing, following and the log are described in Making a game with an agent.
Add Studio to your agent
Each client below registers the server under the name narraleaf. Where a snippet shows <PORT> and <TOKEN>, take them from Endpoint address and Access token.
Claude Code
Copy configuration → Claude Code gives the command. Run it once in a terminal:
claude mcp add --scope user --transport http narraleaf http://127.0.0.1:<PORT>/mcp --header "Authorization: Bearer <TOKEN>"--scope user registers the server for every folder, so a game can be asked for from whichever folder the terminal is in. Without it, the server exists only in the folder the command ran in. Check with claude mcp list, or /mcp inside Claude Code.
Making a game takes a hundred or more tool calls, and Claude Code asks before each one by default. Answer the first prompt with Yes, and don't ask again for the narraleaf tools, or allow them in advance in ~/.claude/settings.json:
{ "permissions": { "allow": ["mcp__narraleaf"] } }Studio's own switches still decide whether the agent may change anything, and pausing still stops it.
Claude Desktop
Claude Desktop starts local programs from its configuration file, and Studio can be that program. Started with --mcp-stdio, Studio opens no window and forwards the connection to the Studio that is running.
Copy configuration → stdio gives the entry with the path to Studio filled in:
{
"mcpServers": {
"narraleaf": {
"command": "/Applications/NarraLeaf Studio.app/Contents/MacOS/NarraLeaf Studio",
"args": ["--mcp-stdio"]
}
}
}The path is Studio's own executable:
- macOS:
/Applications/NarraLeaf Studio.app/Contents/MacOS/NarraLeaf Studiofor a copy in Applications. - Windows:
NarraLeaf Studio.exein the installation folder. In JSON every backslash is doubled; the copied entry already does this. - Linux: the AppImage file itself.
Merge the entry into claude_desktop_config.json (Settings → Developer → Edit Config in Claude Desktop) and restart Claude Desktop.
The entry holds no token. The bridge reads the address and the token from Studio's settings each time, so it keeps working after the token is replaced or the port changes. Claude Desktop connects to every server it is configured with whenever it starts, and connecting does not start Studio: initialize, ping and the lists of tools, resources and prompts are answered by the bridge itself while Studio is not running. The first real tool call starts Studio and waits up to a minute for the endpoint (Studio 1.6.3 and newer). When agent access is off, it answers every request with a message saying where to switch it on.
If the bridge does not suit you, mcp-remote, a third-party npm package that needs Node.js, does the same:
{
"mcpServers": {
"narraleaf": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://127.0.0.1:<PORT>/mcp", "--header", "Authorization:${NARRALEAF_AUTH}"],
"env": { "NARRALEAF_AUTH": "Bearer <TOKEN>" }
}
}
}A Claude Desktop that can add a custom connector by URL can use the address and token there instead.
opencode
Copy configuration → opencode gives the block. Merge it into opencode.json in the working folder, or into ~/.config/opencode/opencode.json for every folder:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"narraleaf": {
"type": "remote",
"url": "http://127.0.0.1:<PORT>/mcp",
"enabled": true,
"headers": { "Authorization": "Bearer <TOKEN>" }
}
}
}Check with opencode mcp list.
Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.narraleaf]
url = "http://127.0.0.1:<PORT>/mcp"
http_headers = { "Authorization" = "Bearer <TOKEN>" }To keep the token out of the file, export it in the shell as NARRALEAF_TOKEN and write bearer_token_env_var = "NARRALEAF_TOKEN" in place of http_headers. Check with codex mcp list, or /mcp inside Codex.
Cursor
Save as .cursor/mcp.json in the working folder, or ~/.cursor/mcp.json for every folder, then enable the server under Cursor Settings → MCP:
{
"mcpServers": {
"narraleaf": {
"url": "http://127.0.0.1:<PORT>/mcp",
"headers": { "Authorization": "Bearer <TOKEN>" }
}
}
}Gemini CLI
Merge into ~/.gemini/settings.json, or .gemini/settings.json in the working folder:
{
"mcpServers": {
"narraleaf": {
"httpUrl": "http://127.0.0.1:<PORT>/mcp",
"headers": { "Authorization": "Bearer <TOKEN>" }
}
},
"context": { "fileName": ["AGENTS.md", "GEMINI.md"] }
}The context.fileName entry makes Gemini CLI read AGENTS.md, which points it to the skill. Check with /mcp inside Gemini CLI.
Any other client
| Setting | Value |
|---|---|
| Transport | Streamable HTTP |
| URL | http://127.0.0.1:<PORT>/mcp |
| Header | Authorization: Bearer <TOKEN> |
A client that can only start local programs runs Studio with --mcp-stdio, as in the Claude Desktop entry, or a bridge such as mcp-remote.
Install the skill
The simplest way is to let Studio do it. Pick your application under Settings → Agent access → Agent application, and the Agent Skill row offers Install Agent Skill, saying Installs into …. Other skills there are kept. Once it is installed the button reads Reinstall, beside Installed in …. Studio installs into the folder each application reads skills from:
| Application | Installed into |
|---|---|
| Claude Code | ~/.claude/skills/ |
| Codex, opencode, Cursor, Gemini CLI | ~/.agents/skills/, the one folder all four read |
| Claude Desktop | Save zip file… writes a zip to upload in Claude under Settings → Capabilities → Skills |
| Other | Nothing to install: those applications read the same guide from Studio's MCP server; see Without a skill |
After updating Studio, press Reinstall once and the skill matches that Studio. When the SKILL.md already there is not the one this Studio ships, an older version or your own edits, Studio asks in its own window before replacing it. First-run setup offers the same step on its agent access screen.
An agent session that is already running keeps the text it has read, so start a new one after reinstalling.
By hand
Agent → Export Agent Skill… writes a folder named NarraLeaf-Skills into the folder you pick. Files of the same name are replaced; nothing else in the folder is removed.
The skill is narraleaf-make-game. Copy the whole folder, not only SKILL.md, to one of the places above. ~/.agents/skills/ is the one folder Codex, opencode, Cursor and Gemini CLI all read; several of them also have a folder of their own (~/.config/opencode/skills/, ~/.cursor/skills/, ~/.gemini/skills/), and Cursor and opencode read ~/.claude/skills/ as well, so a copy in both places may be listed twice. For one project only, put the folder in that project's .claude/skills/ or .agents/skills/.
Agents that read AGENTS.md, such as opencode, Codex, Cursor and Gemini CLI with the setting above, find the skill by themselves when started inside NarraLeaf-Skills.
With Node.js, the third-party skills command installs them straight from the repository: npx skills add NarraLeaf/Skills -g, where -g installs for your user. npx skills update fetches a newer version later.
Porting a Ren'Py game also needs narraleaf-port-renpy. The folder Studio exports holds a copy, but the skill is published in MewBaka/Ren2Leaf together with the Ren2Leaf wizard, where it can be newer. Install it the way you installed narraleaf-make-game, and install both. The server does not serve it as a guide; an agent reads it from the folder. See Porting a Ren'Py game.
Without a skill
The server serves the guide itself, so an agent gets it with no skill installed:
- The
make_gameprompt starts the whole workflow in clients that show MCP prompts, often as a slash command such as/make_game, or/mcp__narraleaf__make_gamein Claude Code. - The
agent_guidetool returns any chapter:workflow,story-format,ui-format,blueprint-format,ui-design,script-adaptation,layered-sprites,verify-and-ship,localization-and-voice,troubleshooting. - The same chapters are MCP resources at
narraleaf://guide/<chapter>.
With any MCP client, this first message works:
Use the NarraLeaf Studio tools. Call agent_guide with chapter "workflow" and follow it to make my game.