All Tutorials
AI Agents
Beginner
10 min

Getting Started with Codex

Create your Open Source Cloud account, connect Codex via MCP, and deploy your first MySQL database β€” all using natural language.

What You'll Learn

Create an OSC account and team
Find your Personal Access Token
Install and configure Codex CLI
Deploy cloud services using natural language

Prerequisites

  • Node.js 18+ installed
  • A terminal or command prompt
  • An OpenAI API key (for Codex)

Step-by-Step Guide

1

Create an OSC Account

First, create your Open Source Cloud account. Navigate to the OSC console:

Enter your email address and click continue. Check your inbox for a verification code, then enter the code to verify your account.

Tip: The verification code will arrive within a few seconds. Check your spam folder if you don't see it.

2

Create a Team

After verifying your email, you'll be prompted to create a team. Teams are how OSC organizes your services and resources.

Enter a team name (e.g., your company name or project name) and click the Create Team button.

Tip: Your free account includes 300 usage tokens to get started. You can invite team members later.

3

Get Your Personal Access Token

Navigate to Settings β†’ API in the OSC console to find your Personal Access Token (PAT). This token allows Codex to authenticate with OSC on your behalf.

Copy your Personal Access Token from this page.

Important: Keep your token secure and never share it publicly.

4

Install Codex

Codex is OpenAI's CLI tool for AI-assisted development. Install it using npm:

npm install -g @openai/codex

After installation, verify it works by running codex --version

5

Configure OSC as MCP Server

Create or edit your Codex configuration file to add OSC as an MCP server. The configuration file is located at ~/.codex/config.toml

Add the following configuration, replacing <YOUR_PERSONAL_ACCESS_TOKEN> with the token you generated:

[mcp_servers.osc]
type = "http"
url = "https://ai.svc.prod.osaas.io/mcp"

[mcp_servers.osc.headers]
Authorization = "Bearer <YOUR_PERSONAL_ACCESS_TOKEN>"

Tip: If you already have other MCP servers configured, just add the [mcp_servers.osc] section to your existing config file.

6

Start Codex

Launch Codex in your terminal. It will automatically load the MCP configuration:

codex

Codex will now have access to all OSC tools and can help you manage open source services.

7

Create a MySQL Database

Now you're ready to create your first service! Ask Codex in natural language:

> Create a MySQL database for me

Codex will use the OSC MCP tools to provision a MySQL instance. Once complete, ask for the connection details:

> What is the IP and port to the database?

Codex will provide you with the host, port, username, and password needed to connect.

Note: Save your database credentials securely. You'll need them to connect from your applications.

Congratulations!

You've successfully connected Codex to Open Source Cloud and created your first database. You can now use natural language to deploy any of the 200+ services available on OSC.

What's Next?

Explore Services

Ask Codex to list available services or deploy Redis, PostgreSQL, MinIO, and more.

> What services can I deploy?

Check Your Resources

View and manage your running services through the OSC console or via Codex.

Open Console

Need More Help?

Check out our documentation or explore more tutorials to get the most out of Open Source Cloud.