
Codex is one of the best coding agents out there, and the MCP experience can be 10x. However, you have to be careful about MCPs, as they may have serious limitations.
Context pollution: When you overwhelm the models with too many MCP servers with unnecessary tools.
Programmatic tool chaining: While not a flaw of MCP itself, it is where LLMs can write their own glue code to connect to API endpoints. This actually improves execution reliability and reduces the number of trips to and from multiple tool calls, which, again, overwhelms the context window.
Handling large responses: LLMs can write code to parse and retrieve information from the file system. Instead of dumping information right into its context, efficient response handling can improve LLM performance and token consumption.
How are we solving this?
So, Composio MCP is a developer-focused product that essentially handles all the above by default.
On-demand tool loading so LLMs use only the tools they need at runtime, reducing context bloat.
a remote workbench so GPT models can write Composio code to chain multiple tools to complete tasks.
Large response handling. Large tool outputs are handled outside the LLM's context for an efficient
Rube is the consumer/prosumer MCP that scaffolds the core developer product, and in this guide, we will use Rube. The process for adding MCPs to Codex for other HTTP MCPs is more or less the same, and we will also see how to set up Stdio servers.
Codex is one of the best coding agents out there, and the MCP experience can be 10x. However, you have to be careful about MCPs, as they may have serious limitations.
Context pollution: When you overwhelm the models with too many MCP servers with unnecessary tools.
Programmatic tool chaining: While not a flaw of MCP itself, it is where LLMs can write their own glue code to connect to API endpoints. This actually improves execution reliability and reduces the number of trips to and from multiple tool calls, which, again, overwhelms the context window.
Handling large responses: LLMs can write code to parse and retrieve information from the file system. Instead of dumping information right into its context, efficient response handling can improve LLM performance and token consumption.
How are we solving this?
So, Composio MCP is a developer-focused product that essentially handles all the above by default.
On-demand tool loading so LLMs use only the tools they need at runtime, reducing context bloat.
a remote workbench so GPT models can write Composio code to chain multiple tools to complete tasks.
Large response handling. Large tool outputs are handled outside the LLM's context for an efficient
Rube is the consumer/prosumer MCP that scaffolds the core developer product, and in this guide, we will use Rube. The process for adding MCPs to Codex for other HTTP MCPs is more or less the same, and we will also see how to set up Stdio servers.
Try it to belive it.
We offer 850+ managed MCP servers with built-in auth and enterprise grade security.


Try it to belive it.
We offer 850+ managed MCP servers with built-in auth and enterprise grade security.


Try it to belive it.
We offer 850+ managed MCP servers with built-in auth and enterprise grade security.


Try it to belive it.
We offer 850+ managed MCP servers with built-in auth and enterprise grade security.

How to set up MCP for Codex
The benefit of Codex is that it can run in all 3 modes:
GUI Mode: You can uninstall the Codex extension in VS Code, Cursor, or Windsurf. It reads your workspace, edits code, and runs tasks right in your favourite IDE.
CLI Mode: Terminal fans can install Codex CLI via
npm install -g @openai/codex, then runcodexIn their project for local agentic coding.Cloud Mode: Power users can delegate heavy tasks to Codex Cloud from the IDE or GitHub (@codex tags), freeing them to focus while it handles builds remotely. This is a unique edge over rivals.
Codex App: The new Codex app. A very beautiful UI that's very intuitive to work with.
But to use rube, all that is required is a bit of setup. Here is how to do it for all modes!
1. Set up MCP in Codex GUI Mode
I thought connecting remote MCP servers to the Codex extension was easy, but it's a major issue, an open one right now on GitHub.
So, here's the clean workaround I found to use MCP with extension:
Go to Rube, sign up/log in, or use whatever MCP servers you want.
Head to Rube Chat → Use Rube → MCP URL → Generate Token. (You can use any other MCP URL)

Copy the token
Install the Codex extension for VS Code and log in.
Then: ⚙️ → MCP Settings → + Add servers → Streamable HTTP:
Put in the following details:
Name: rube
URL: https://rube.app/mcp
Headers:
Key: Authorisation
Value: Bearer
Save → Refresh → Authenticate → Done!

To verify if mcp server is enabled or not, paste the following in the prompt box:
Do you have access to [mcp-server]? Tell me all the task it can perform
Do you have access to [mcp-server]? Tell me all the task it can perform
Do you have access to [mcp-server]? Tell me all the task it can perform
If it fetches the result with all tasks it can do or mcp details, you are all set.
You can check out the config.toml file for same, by going to ⚙️ → MCP Settings → Open config.toml file.
Now let’s set up the same for CLI.
2. Set up MCP in Codex CLI Mode
Terminal lovers, in the codex, we have 2 ways to setup mcp in the codex CLI:
Config file -
config.toml(manual, explicit)CLI commands (faster, recommended)
However, I find the config file offers full control in a single file and feels native.
Here is how to use the config file approach:
Install the codex CLI using:
npm i -g @openai/codex(Make sure you havenpminstall)Initialise a project root directory. I used
codex-testCreate a folder named
codexusingmkdir.Inside, it creates a new file called
config.tomland paste the following text from below and save it!
[projects."/home/devloper_hs/codex-tests"] trust_level = "untrusted" [mcp_servers.rube] enabled = true url = "https://rube.app/mcp" [mcp_servers.rube.http_headers] Authorization = "Bearer <auth-token>"
[projects."/home/devloper_hs/codex-tests"] trust_level = "untrusted" [mcp_servers.rube] enabled = true url = "https://rube.app/mcp" [mcp_servers.rube.http_headers] Authorization = "Bearer <auth-token>"
[projects."/home/devloper_hs/codex-tests"] trust_level = "untrusted" [mcp_servers.rube] enabled = true url = "https://rube.app/mcp" [mcp_servers.rube.http_headers] Authorization = "Bearer <auth-token>"
Notes
Replace the project path with your actual absolute path
Replace
<auth-token>with the token you already generated earliertrust_level = "untrusted"is the safe default
But those tied to terminal commands you can use:
codex mcp login <server-name
codex mcp login <server-name
codex mcp login <server-name
for streamable-http based mcp servers*. *Make sure to authenticate!
or stdio based mcp servers
codex mcp add <server-name> --env VAR1=VALUE1 --env VAR2=VALUE2 -- <stdio server-command
codex mcp add <server-name> --env VAR1=VALUE1 --env VAR2=VALUE2 -- <stdio server-command
codex mcp add <server-name> --env VAR1=VALUE1 --env VAR2=VALUE2 -- <stdio server-command
Example:
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp add context7 -- npx -y @upstash/context7-mcp
Next, let’s verify the connection.
Verify Installation
Head to the root of the file and run codex, login and run /mcp

To ensure it uses the MCP server, you can use the following prompt validation flow:

I liked the fact that instead of giving me rouge output, its actually gave me steps to validate. Btw I already validated the gmail earlier.
Now is the time to set up MCP for the codex using cloud mode.
3. Set up MCP in Codex Cloud Mode
Codex allows delegating tasks to a cloud instance, letting developers focus on other tasks.
Sadly, this has been long planned but not shipped. The blockers being: secure tool proxying, credential forwarding, deterministic replays and more.
A smart approach is to use the MCP process locally, then delegate responses and the rest of the work to the cloud.
4. Set up MCP in the Codex App
Click on the Settings gear icon on the bottom left.
Go to MCP Servers. You’ll see some servers that you can authenticate and use.

Or, add server
Choose STDIO or Streamable HTTP
Add your MCP server

And you’re done.
So, with this, we are all set to look at a few use cases of Codex!
Use Cases of Codex + MCP
Codex is mainly meant for coding, but with Rube MCP it can handle a variety of tasks. Here are 3 use cases I like to use as a developer.
1. Organising Old Project Commits into an Existing Sheet for Refresher
Integrations: Google Sheet + GitLab
Create a new googsheet and add last 10 code activity summary (PRs, commits, stale branches)
from my [project]
Create a new googsheet and add last 10 code activity summary (PRs, commits, stale branches)
from my [project]
Create a new googsheet and add last 10 code activity summary (PRs, commits, stale branches)
from my [project]
& here is the output:



This gives me a rough idea of where I left off and start from there. No more mundane checks.
But the use cases don’t stop here.
2. Creating Changelogs / Project Report on the fly
Integrations used: GitHub, Google Docs
Create a new Google Doc and generate a clean changelog report for my [project]
Create a new Google Doc and generate a clean changelog report for my [project]
Create a new Google Doc and generate a clean changelog report for my [project]
& here is the output



This allows me to turn my project changelogs into a well-formatted Google Doc and send them the pdf / Doc. They can use it to verify the progress, ask for further clarification or suggest some changes
By far, I have shared productivity stuff; it's time for an actual development use case!
3. Extracting Design Tokens from Figma File
Integrations used: Figma
This one has been game changer for me.
To be frank, I am not good with frontend, so I take inspiration form figma designs. However, manually converting the design to code was a headache.
But now I fire up Codex and ask it to extract design tokens I can use to replicate the frontend in a similar style.
Here’s the output



Ofc, I make a few changes here and there before implementing, but this now codex + rube combo makes life so easier.
And here is a bonus one for content creators!
Turning Codex into your Content Creator Devlogs in Medium Blogs Draft
Integrations used: Google Docs, Notion
Many developers love writing devlogs (summaries of what they did) while building a product. But with Codex + mcp, you can analyse each dev log on a day-by-day basis and create a blog that you can then share with the world. Similar to how big companies.
Here is the prompt I used:
You are tasked with creating an SEO-optimized blog post from development logs for Medium publication. **Requirements:** 1. Read the @devlog file content based on chronological order (earliest to latest based on days) 2. Transform technical devlogs into a narrative-driven blog post with personal storytelling 3. Use Rube MCP's googledocs tool to create and format the document 4. Follow this structure: - Engaging title with primary keyword - Compelling hook/introduction - Main body with 3-5 naturally flowing sections - Personal insights and lessons learned - Conclusion with takeaways - Call-to-action **Writing Style:** - First-person perspective ("I discovered...", "My journey with...") - Story-driven narrative that connects technical milestones - Natural transitions between sections (avoid forced segmentation) - Balance technical detail with accessibility - Include challenges, breakthroughs, and reflections **SEO Optimization:** - Include relevant keywords naturally in headers and content - Use H2/H3 headings for structure - Add meta description (150-160 characters) - Include 3-5 tags for Medium - Optimize readability (short paragraphs, varied sentence length) **Formatting in Google Docs:**
You are tasked with creating an SEO-optimized blog post from development logs for Medium publication. **Requirements:** 1. Read the @devlog file content based on chronological order (earliest to latest based on days) 2. Transform technical devlogs into a narrative-driven blog post with personal storytelling 3. Use Rube MCP's googledocs tool to create and format the document 4. Follow this structure: - Engaging title with primary keyword - Compelling hook/introduction - Main body with 3-5 naturally flowing sections - Personal insights and lessons learned - Conclusion with takeaways - Call-to-action **Writing Style:** - First-person perspective ("I discovered...", "My journey with...") - Story-driven narrative that connects technical milestones - Natural transitions between sections (avoid forced segmentation) - Balance technical detail with accessibility - Include challenges, breakthroughs, and reflections **SEO Optimization:** - Include relevant keywords naturally in headers and content - Use H2/H3 headings for structure - Add meta description (150-160 characters) - Include 3-5 tags for Medium - Optimize readability (short paragraphs, varied sentence length) **Formatting in Google Docs:**
You are tasked with creating an SEO-optimized blog post from development logs for Medium publication. **Requirements:** 1. Read the @devlog file content based on chronological order (earliest to latest based on days) 2. Transform technical devlogs into a narrative-driven blog post with personal storytelling 3. Use Rube MCP's googledocs tool to create and format the document 4. Follow this structure: - Engaging title with primary keyword - Compelling hook/introduction - Main body with 3-5 naturally flowing sections - Personal insights and lessons learned - Conclusion with takeaways - Call-to-action **Writing Style:** - First-person perspective ("I discovered...", "My journey with...") - Story-driven narrative that connects technical milestones - Natural transitions between sections (avoid forced segmentation) - Balance technical detail with accessibility - Include challenges, breakthroughs, and reflections **SEO Optimization:** - Include relevant keywords naturally in headers and content - Use H2/H3 headings for structure - Add meta description (150-160 characters) - Include 3-5 tags for Medium - Optimize readability (short paragraphs, varied sentence length) **Formatting in Google Docs:**
And here is the output it created:



By default, Codex doesn’t have access to Google Docs, but MCP can help with that. So, we let Codex handle the generation process, and rube handled the Google Docs.
In short, this process allows anyone to turn their weekly builds into a full-fledged blogpost or content worth sharing.
I hope you got an idea of what’s all possible.
Now let’s look at the final lesson!
Final Thoughts
Even with vibe coding pushing software development forward, most people still treat Codex/MCP like a magic box. That’s the actual problem.
These tools don’t work magically. They need clear, structured prompts to give good output. Most people don’t have that skill yet, so results fall apart.
That’s where tools like Rube help - by enforcing structure and combining prompts with real tool support, instead of guesswork.
Going forward, this becomes the new normal. Using these tools well won’t be optional.
So, don’t waste time. Go to rube.app, connect it with Codex, and start building or automating your work.
Frequently Asked Questions
What is an MCP, and why would I use it with Codex?
MCP is a way for Codex to talk to external tools like Confluence, HubSpot, Bitbucket, Asana, and Shopify via “servers” that expose actions Codex can call. The upside is obvious: Codex can do real work, not just generate code. The catch is that the more tools you attach, the easier it is to overwhelm the model or get unreliable behaviour, which is why setup and tool hygiene matter.
What’s “context pollution,” and how do I avoid it?
Context pollution occurs when you connect too many MCP servers or expose too many tools, so the model spends tokens scanning irrelevant tool lists and instructions rather than solving the task. To avoid it, keep your MCP list lean, prefer on-demand tool loading, and only enable servers that match the job you are doing right now. If you notice Codex getting vague, slow, or “forgetful,” tool overload is often the reason.
Why does “programmatic tool chaining” matter if MCP already connects tools?
MCP gives the model access to tools, but tool chaining is about reliability and efficiency. When Codex can generate small glue code that composes multiple API calls, it can reduce back-and-forth tool invocations and handle branching logic cleanly. Done right, it lowers context churn and makes results more deterministic, especially for multi-step workflows like “pull commits, summarise, write report, publish to Docs.”
How does Composio MCP (and Rube) handle large tool outputs without blowing up tokens?
Large responses are a silent killer: dumping big payloads straight into the model context wastes tokens and can degrade output quality. Composio MCP’s approach is to keep heavy outputs outside the model context and let the model retrieve only what it needs, when it needs it. In practice, that means faster runs, fewer “lost in the scroll” failures, and better performance on workflows that touch repositories, documents, or design files.
How to set up MCP for Codex
The benefit of Codex is that it can run in all 3 modes:
GUI Mode: You can uninstall the Codex extension in VS Code, Cursor, or Windsurf. It reads your workspace, edits code, and runs tasks right in your favourite IDE.
CLI Mode: Terminal fans can install Codex CLI via
npm install -g @openai/codex, then runcodexIn their project for local agentic coding.Cloud Mode: Power users can delegate heavy tasks to Codex Cloud from the IDE or GitHub (@codex tags), freeing them to focus while it handles builds remotely. This is a unique edge over rivals.
Codex App: The new Codex app. A very beautiful UI that's very intuitive to work with.
But to use rube, all that is required is a bit of setup. Here is how to do it for all modes!
1. Set up MCP in Codex GUI Mode
I thought connecting remote MCP servers to the Codex extension was easy, but it's a major issue, an open one right now on GitHub.
So, here's the clean workaround I found to use MCP with extension:
Go to Rube, sign up/log in, or use whatever MCP servers you want.
Head to Rube Chat → Use Rube → MCP URL → Generate Token. (You can use any other MCP URL)

Copy the token
Install the Codex extension for VS Code and log in.
Then: ⚙️ → MCP Settings → + Add servers → Streamable HTTP:
Put in the following details:
Name: rube
URL: https://rube.app/mcp
Headers:
Key: Authorisation
Value: Bearer
Save → Refresh → Authenticate → Done!

To verify if mcp server is enabled or not, paste the following in the prompt box:
Do you have access to [mcp-server]? Tell me all the task it can perform
If it fetches the result with all tasks it can do or mcp details, you are all set.
You can check out the config.toml file for same, by going to ⚙️ → MCP Settings → Open config.toml file.
Now let’s set up the same for CLI.
2. Set up MCP in Codex CLI Mode
Terminal lovers, in the codex, we have 2 ways to setup mcp in the codex CLI:
Config file -
config.toml(manual, explicit)CLI commands (faster, recommended)
However, I find the config file offers full control in a single file and feels native.
Here is how to use the config file approach:
Install the codex CLI using:
npm i -g @openai/codex(Make sure you havenpminstall)Initialise a project root directory. I used
codex-testCreate a folder named
codexusingmkdir.Inside, it creates a new file called
config.tomland paste the following text from below and save it!
[projects."/home/devloper_hs/codex-tests"] trust_level = "untrusted" [mcp_servers.rube] enabled = true url = "https://rube.app/mcp" [mcp_servers.rube.http_headers] Authorization = "Bearer <auth-token>"
Notes
Replace the project path with your actual absolute path
Replace
<auth-token>with the token you already generated earliertrust_level = "untrusted"is the safe default
But those tied to terminal commands you can use:
codex mcp login <server-name
for streamable-http based mcp servers*. *Make sure to authenticate!
or stdio based mcp servers
codex mcp add <server-name> --env VAR1=VALUE1 --env VAR2=VALUE2 -- <stdio server-command
Example:
codex mcp add context7 -- npx -y @upstash/context7-mcp
Next, let’s verify the connection.
Verify Installation
Head to the root of the file and run codex, login and run /mcp

To ensure it uses the MCP server, you can use the following prompt validation flow:

I liked the fact that instead of giving me rouge output, its actually gave me steps to validate. Btw I already validated the gmail earlier.
Now is the time to set up MCP for the codex using cloud mode.
3. Set up MCP in Codex Cloud Mode
Codex allows delegating tasks to a cloud instance, letting developers focus on other tasks.
Sadly, this has been long planned but not shipped. The blockers being: secure tool proxying, credential forwarding, deterministic replays and more.
A smart approach is to use the MCP process locally, then delegate responses and the rest of the work to the cloud.
4. Set up MCP in the Codex App
Click on the Settings gear icon on the bottom left.
Go to MCP Servers. You’ll see some servers that you can authenticate and use.

Or, add server
Choose STDIO or Streamable HTTP
Add your MCP server

And you’re done.
So, with this, we are all set to look at a few use cases of Codex!
Use Cases of Codex + MCP
Codex is mainly meant for coding, but with Rube MCP it can handle a variety of tasks. Here are 3 use cases I like to use as a developer.
1. Organising Old Project Commits into an Existing Sheet for Refresher
Integrations: Google Sheet + GitLab
Create a new googsheet and add last 10 code activity summary (PRs, commits, stale branches)
from my [project]
& here is the output:

This gives me a rough idea of where I left off and start from there. No more mundane checks.
But the use cases don’t stop here.
2. Creating Changelogs / Project Report on the fly
Integrations used: GitHub, Google Docs
Create a new Google Doc and generate a clean changelog report for my [project]
& here is the output

This allows me to turn my project changelogs into a well-formatted Google Doc and send them the pdf / Doc. They can use it to verify the progress, ask for further clarification or suggest some changes
By far, I have shared productivity stuff; it's time for an actual development use case!
3. Extracting Design Tokens from Figma File
Integrations used: Figma
This one has been game changer for me.
To be frank, I am not good with frontend, so I take inspiration form figma designs. However, manually converting the design to code was a headache.
But now I fire up Codex and ask it to extract design tokens I can use to replicate the frontend in a similar style.
Here’s the output

Ofc, I make a few changes here and there before implementing, but this now codex + rube combo makes life so easier.
And here is a bonus one for content creators!
Turning Codex into your Content Creator Devlogs in Medium Blogs Draft
Integrations used: Google Docs, Notion
Many developers love writing devlogs (summaries of what they did) while building a product. But with Codex + mcp, you can analyse each dev log on a day-by-day basis and create a blog that you can then share with the world. Similar to how big companies.
Here is the prompt I used:
You are tasked with creating an SEO-optimized blog post from development logs for Medium publication. **Requirements:** 1. Read the @devlog file content based on chronological order (earliest to latest based on days) 2. Transform technical devlogs into a narrative-driven blog post with personal storytelling 3. Use Rube MCP's googledocs tool to create and format the document 4. Follow this structure: - Engaging title with primary keyword - Compelling hook/introduction - Main body with 3-5 naturally flowing sections - Personal insights and lessons learned - Conclusion with takeaways - Call-to-action **Writing Style:** - First-person perspective ("I discovered...", "My journey with...") - Story-driven narrative that connects technical milestones - Natural transitions between sections (avoid forced segmentation) - Balance technical detail with accessibility - Include challenges, breakthroughs, and reflections **SEO Optimization:** - Include relevant keywords naturally in headers and content - Use H2/H3 headings for structure - Add meta description (150-160 characters) - Include 3-5 tags for Medium - Optimize readability (short paragraphs, varied sentence length) **Formatting in Google Docs:**
And here is the output it created:

By default, Codex doesn’t have access to Google Docs, but MCP can help with that. So, we let Codex handle the generation process, and rube handled the Google Docs.
In short, this process allows anyone to turn their weekly builds into a full-fledged blogpost or content worth sharing.
I hope you got an idea of what’s all possible.
Now let’s look at the final lesson!
Final Thoughts
Even with vibe coding pushing software development forward, most people still treat Codex/MCP like a magic box. That’s the actual problem.
These tools don’t work magically. They need clear, structured prompts to give good output. Most people don’t have that skill yet, so results fall apart.
That’s where tools like Rube help - by enforcing structure and combining prompts with real tool support, instead of guesswork.
Going forward, this becomes the new normal. Using these tools well won’t be optional.
So, don’t waste time. Go to rube.app, connect it with Codex, and start building or automating your work.
Frequently Asked Questions
What is an MCP, and why would I use it with Codex?
MCP is a way for Codex to talk to external tools like Confluence, HubSpot, Bitbucket, Asana, and Shopify via “servers” that expose actions Codex can call. The upside is obvious: Codex can do real work, not just generate code. The catch is that the more tools you attach, the easier it is to overwhelm the model or get unreliable behaviour, which is why setup and tool hygiene matter.
What’s “context pollution,” and how do I avoid it?
Context pollution occurs when you connect too many MCP servers or expose too many tools, so the model spends tokens scanning irrelevant tool lists and instructions rather than solving the task. To avoid it, keep your MCP list lean, prefer on-demand tool loading, and only enable servers that match the job you are doing right now. If you notice Codex getting vague, slow, or “forgetful,” tool overload is often the reason.
Why does “programmatic tool chaining” matter if MCP already connects tools?
MCP gives the model access to tools, but tool chaining is about reliability and efficiency. When Codex can generate small glue code that composes multiple API calls, it can reduce back-and-forth tool invocations and handle branching logic cleanly. Done right, it lowers context churn and makes results more deterministic, especially for multi-step workflows like “pull commits, summarise, write report, publish to Docs.”
How does Composio MCP (and Rube) handle large tool outputs without blowing up tokens?
Large responses are a silent killer: dumping big payloads straight into the model context wastes tokens and can degrade output quality. Composio MCP’s approach is to keep heavy outputs outside the model context and let the model retrieve only what it needs, when it needs it. In practice, that means faster runs, fewer “lost in the scroll” failures, and better performance on workflows that touch repositories, documents, or design files.
Recommended Blogs
Recommended Blogs

Connect AI agents to SaaS apps in Minutes
Connect AI agents to SaaS apps in Minutes
We handle auth, tools, triggers, and logs, so you build what matters.
Stay updated.

Stay updated.



