How to Use AI Smith in Craftland Studio with OpenAI Codex Agent (MCP Guide)
Introduction
If you work with Craftland Studio, you probably know that creating maps, editing objects, working with scripts, and managing game logic can take a lot of time.
In this guide, I'll show you how to connect AI Smith with OpenAI Codex using an MCP (Model Context Protocol) Server. Once everything is configured, you can use Codex to assist with your Craftland Studio workflow through AI-powered tools.
There are two ways to work with Codex:- Codex CLI: Use Codex directly from your terminal.
- Codex IDE: Use Codex inside Visual Studio Code or another supported IDE.
💡 Don't worry if you're new to AI agents or MCP servers. I'll explain everything step by step, including installation and configuration.
What Is AI Smith? 🤖
AI Smith is the AI integration we're using in this Craftland Studio workflow. It allows you to work with an external AI agent through an MCP connection.
Instead of handling every development task manually, you can use a connected AI agent to assist with supported operations in your project.
For example, depending on the tools exposed by your AI Smith MCP server, you can use an AI agent to help with:
- Understanding your Craftland Studio project.
- Working with supported objects and project resources.
- Assisting with scripts and game logic.
- Finding information about available project tools.
- Performing supported operations through AI tool calls.
What Is OpenAI Codex Agent?
OpenAI Codex is an AI coding agent that can understand your code, inspect project files, make changes, and run commands with the permissions you allow.
You can use Codex in two different ways:
🖥️ Codex CLI
Codex CLI runs directly in your terminal. You can open your project directory, start Codex, and give it instructions using simple text prompts.
💻 Codex IDE Extension
The Codex IDE extension lets you work with the agent directly inside your code editor. You can review files, ask questions, and inspect code changes without constantly switching between applications.
Both options can connect to MCP servers and use their available tools.
Understanding the MCP Server
Before connecting AI Smith with Codex, let's understand what MCP actually does.
MCP stands for Model Context Protocol. It is a standard that allows AI applications to connect with external tools and data sources.
Think of it as a bridge between your AI agent and Craftland Studio.
Codex is your AI agent, AI Smith provides the Craftland Studio integration, and MCP is the communication layer that connects them.
Set Up Codex CLI
Let's start with Codex CLI. This method is useful if you prefer working with terminals and want to run Codex directly from your project directory.
-
Step 1: Install Codex
Open your terminal or PowerShell and use the installation command for your operating system.
Open PowerShell and run:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
Open your terminal and run:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
You can also install Codex using npm:
npm install -g @openai/codex
For macOS users with Homebrew:
brew install --cask codex
-
Step 2: Verify the installation
After installation, check whether Codex is available:
codex --version
-
Step 3: Open Codex and sign in
Navigate to your project directory and start Codex:
cd path/to/your/project codex
When you launch Codex for the first time, follow the authentication instructions and choose Sign in with ChatGPT or another available authentication method.
-
Step 4: Initialize your project
Once Codex starts, you can initialize project instructions using:
/init
This creates an
AGENTS.mdfile that you can use to provide project-specific instructions to Codex.For example, you can explain your project structure, development rules, and which files Codex should avoid modifying.
💡 You can now ask Codex to inspect your project before making any changes.
Set Up Codex IDE Extension
Don't like working in a terminal? No problem! You can also use Codex directly inside your IDE.
For this tutorial, we'll use Visual Studio Code.
-
Install Visual Studio Code
Download and install Visual Studio Code if you haven't already.
Download Visual Studio Code -
Install the Codex Extension
Open VS Code, navigate to Extensions, and search for Codex by OpenAI.
Install the official extension and wait for it to finish.
Open Official Codex IDE Guide -
Open your project
Open your Craftland Studio project folder in VS Code.
Make sure you have opened the correct folder so Codex can access the relevant project files.
-
Open Codex and sign in
Click the Codex icon in the sidebar. If you don't see it, open the Command Palette and run:
Codex: Open Codex Sidebar
Sign in using your available authentication method.
-
Start a new conversation
You're ready! Ask Codex to explain your project, inspect a script, or help with your next development task.
💡 The IDE extension is especially useful when you want to review code and changes directly inside your editor.
7. Connect the AI Smith MCP Server to Codex
Now comes the important part: connecting AI Smith with Codex.
Codex supports MCP servers using two main connection types:
- Streamable HTTP: Connect to an MCP server using its URL.
- STDIO: Start a local MCP server using a command on your computer.
Use the connection type provided by your AI Smith setup. Don't guess the server URL or local command.
Method A: Connect using Codex CLI
If AI Smith provides a Streamable HTTP MCP endpoint, open your terminal and run:
codex mcp add ai-smith --url YOUR_AI_SMITH_MCP_SERVER_URL
Replace YOUR_AI_SMITH_MCP_SERVER_URL with the actual MCP server URL provided by AI Smith.
If AI Smith instead provides a local STDIO command, use the following format:
codex mcp add ai-smith -- YOUR_MCP_SERVER_COMMAND
For example, the command and arguments must match the actual server installation instructions.
Verify the MCP connection
After adding the server, check your configuration:
codex mcp list
You can also open the Codex terminal interface and type:
/mcp
This lets you inspect the configured MCP servers and their connection status.
Method B: Configure MCP using config.toml
You can also configure your MCP server manually by editing the Codex configuration file.
The default configuration file is located here:
%USERPROFILE%\.codex\config.toml
~/.codex/config.toml
For an HTTP-based AI Smith MCP server, add the following configuration:
[mcp_servers.ai-smith] url = "YOUR_AI_SMITH_MCP_SERVER_URL" enabled = true
Save the file and restart Codex if needed.
If the server requires authentication, follow its authentication instructions. Never put private access tokens directly into a public project or shared configuration file.
⚠️ The configuration above is a template, not a confirmed AI Smith endpoint. Use the actual URL, authentication method, and transport details supplied by your AI Smith MCP server.
Does the IDE require a separate MCP setup?
No! Codex CLI and the Codex IDE extension share the same MCP configuration.
This means that after configuring AI Smith through Codex CLI, you can also use the same connection from the supported IDE extension.
8. Configure AI Smith in Craftland Studio
AI Smith Windows
...
verification configuration select agent to codex agent select ai model and prefrence etc. enable ai tool permission.Now let's move to Craftland Studio and configure the AI Smith side of the connection.
Open Craftland Studio and load the project you want to work with.
-
Open AI Smith
Locate and open the AI Smith panel or integration inside Craftland Studio.
-
Select the Codex Agent
In the agent selection area, choose Codex Agent.
This tells AI Smith which connected AI agent you want to use.
-
Verify the connection
Check that the Codex agent is available and that the MCP connection is configured correctly.
-
Choose your AI model and preferences
Select the available model and configure the preferences according to your workflow.
The available models and settings depend on your Codex configuration and AI Smith version.
-
Save your configuration
Apply the settings and make sure the agent is ready before starting a task.
9. Configure AI Tools and Permissions 🔐
Before using the AI agent, take a moment to review its permissions.
MCP tools may be able to perform actions beyond simply reading information. Depending on the server, some tools might modify project data or execute operations.
Make sure you understand which tools are enabled and what each one can do.
- Enable only the MCP tools you actually need.
- Review permissions for tools that modify project data.
- Keep approval prompts enabled for important operations.
- Back up your project before making significant changes.
- Never share private credentials or authentication tokens.
Codex also provides a permissions interface. You can review the current permission settings using:
/permissions
⚠️ Avoid giving an AI agent unrestricted access unless you fully understand the security implications. Always review changes before accepting them.
10. How to Use Codex with AI Smith
Once everything is connected, you're ready to start using AI Smith with Codex!
Open the AI Smith interface, make sure Codex Agent is selected, and describe what you want to accomplish.
For example, you can start with a simple request:
First, inspect the connected Craftland Studio tools. Explain which tools are available and what they can do. Do not modify my project yet.
This is a good way to understand the available MCP tools before asking the agent to perform any operations.
11. Example Prompts for Craftland Studio
Here are some prompts you can try after connecting Codex with AI Smith. Remember that the actual result depends on which tools your MCP server supports.
🔍 Understand your project
Inspect my current Craftland Studio project. Explain its structure and identify the available objects, resources, and supported operations. Do not make any changes.
🏗️ Create a scene
Help me plan a futuristic city scene in Craftland Studio. Suggest suitable objects, lighting, and environment settings. Check which required tools are available before making changes.
🎮 Improve gameplay
Help me design a simple team-based arena. Suggest spawn positions, player routes, and gameplay improvements. Explain the plan before applying any supported changes.
🛠️ Debug a problem
Inspect the available project information and help me identify the cause of this issue. Explain the problem and suggest a fix before changing anything.
📋 Review project changes
Review the recent changes in my project. Summarize what changed and identify possible issues. Do not overwrite or remove existing resources.
💡 Tip: Be specific when writing prompts. Explain what you want, what should remain unchanged, and whether the agent is allowed to make changes.
12. Common Issues and Fixes
Having trouble connecting Codex with AI Smith? Here are a few things worth checking.
Codex command not found
This usually means Codex is not installed correctly or its installation directory is not available in your PATH.
- Check whether the installation completed successfully.
- Restart your terminal.
- Verify the installation using
codex --version.
MCP server is not connecting
Check the MCP server URL or local command provided by AI Smith.
- Verify the server is running.
- Check your internet or local network connection.
- Review the authentication settings.
- Run
codex mcp listto inspect the configuration.
Codex cannot see MCP tools
Make sure the MCP server is enabled and successfully connected.
- Check the server status using
/mcp. - Restart the Codex session or IDE extension.
- Check whether the server has exposed any tools.
- Review enabled and disabled tool settings.
Permission or authentication errors
Some MCP servers require additional authentication or approval before their tools can be used.
- Follow the server's authentication instructions.
- Check the required permissions.
- Re-authenticate if your session has expired.
Changes are not appearing in Craftland Studio
Check whether the AI agent actually performed a supported operation and whether the project needs to be refreshed or reloaded.
- Review the agent's operation results.
- Check the relevant project resources.
- Verify that the changes were saved.
- Consult the Craftland Studio documentation for the affected feature.
Conclusion 🎉
That's it! You now have an overview of how to connect AI Smith with OpenAI Codex Agent using MCP.
Whether you prefer using Codex CLI from your terminal or the Codex IDE extension inside Visual Studio Code, both approaches can provide access to the same configured MCP server.
The best part is that you can use natural-language instructions to work with the tools available in your Craftland Studio environment.
If you're just getting started, I recommend first exploring the available MCP tools and asking Codex to explain your project. Once you're comfortable, start experimenting with more advanced tasks. 🚀