Skip to main content
OpenAI Codex is OpenAI’s CLI agent for software development. You can connect it to TryPost’s MCP server to manage your social media scheduling with natural language.

Prerequisites

  • Codex CLI installed (npm install -g @openai/codex)
  • A TryPost API key

Setup

1

Set your API key as an environment variable

Add your TryPost API key to your shell profile (~/.zshrc, ~/.bashrc, etc.):
export TRYPOST_API_KEY="tp_your_api_key_here"
Replace tp_your_api_key_here with your actual API key from the TryPost dashboard.
2

Open the configuration file

Edit ~/.codex/config.toml and add the TryPost server:
[mcp_servers.trypost]
url = "https://app.trypost.it/mcp/trypost"
bearer_token_env_var = "TRYPOST_API_KEY"
3

Restart Codex

Close and reopen Codex to load the new configuration.
4

Verify the connection

Ask Codex to interact with your TryPost account:
List all my TryPost posts
Codex uses TOML for configuration (not JSON). It provides bearer_token_env_var to securely reference API keys from environment variables instead of hardcoding them in the config file.

Example prompts

Create a new draft post for all my social accounts
Show me all my hashtag groups
Create a label called "Campaign" with color #f59e0b