# How to integrate Render MCP with OpenAI Agents SDK

```json
{
  "title": "How to integrate Render MCP with OpenAI Agents SDK",
  "toolkit": "Render",
  "toolkit_slug": "render",
  "framework": "OpenAI Agents SDK",
  "framework_slug": "open-ai-agents-sdk",
  "url": "https://composio.dev/toolkits/render/framework/open-ai-agents-sdk",
  "markdown_url": "https://composio.dev/toolkits/render/framework/open-ai-agents-sdk.md",
  "updated_at": "2026-05-12T10:23:45.398Z"
}
```

## Introduction

This guide walks you through connecting Render to the OpenAI Agents SDK using the Composio tool router. By the end, you'll have a working Render agent that can deploy latest code to staging service, restart production web service now, get current status of all services through natural language commands.
This guide will help you understand how to give your OpenAI Agents SDK agent real control over a Render account through Composio's Render MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Render with

- [ChatGPT](https://composio.dev/toolkits/render/framework/chatgpt)
- [Claude Agent SDK](https://composio.dev/toolkits/render/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/render/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/render/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/render/framework/codex)
- [Cursor](https://composio.dev/toolkits/render/framework/cursor)
- [VS Code](https://composio.dev/toolkits/render/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/render/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/render/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/render/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/render/framework/cli)
- [Google ADK](https://composio.dev/toolkits/render/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/render/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/render/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/render/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/render/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/render/framework/crew-ai)

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Install the necessary dependencies
- Initialize Composio and create a Tool Router session for Render
- Configure an AI agent that can use Render as a tool
- Run a live chat session where you can ask the agent to perform Render operations

## What is OpenAI Agents SDK?

The OpenAI Agents SDK is a lightweight framework for building AI agents that can use tools and maintain conversation state. It provides a simple interface for creating agents with hosted MCP tool support.
Key features include:
- Hosted MCP Tools: Connect to external services through hosted MCP endpoints
- SQLite Sessions: Persist conversation history across interactions
- Simple API: Clean interface with Agent, Runner, and tool configuration
- Streaming Support: Real-time response streaming for interactive applications

## What is the Render MCP server, and what's possible with it?

The Render MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Render account. It provides structured and secure access to your cloud infrastructure, so your agent can perform actions like deploying applications, managing services, monitoring site health, restarting instances, and scaling resources on your behalf.
- Automated application deployment: Instantly deploy new web apps or services without manual steps, letting your agent handle setup and rollouts.
- Service monitoring and status checks: Ask your agent to check the health and uptime of your apps or services, so you’re always up to speed on what’s running smoothly—and what’s not.
- Instance management and restarts: Enable your agent to restart, stop, or scale up/down your running services to quickly respond to changes or issues.
- Resource scaling and configuration: Let your agent adjust resource allocations, increasing or decreasing capacity based on current needs or traffic spikes.
- Error diagnostics and log retrieval: Have your agent fetch logs or error reports to help troubleshoot issues before they become major problems.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `RENDER_ADD_HEADERS` | Add Header Rule | Tool to add a custom HTTP header rule to a Render service. Use when you need to configure headers like Cache-Control, security headers, or CORS headers for specific request paths. |
| `RENDER_ADD_OR_UPDATE_SECRET_FILE` | Add or Update Secret File | Tool to add or update a secret file for a Render service. Use when you need to create a new secret file or update the content of an existing secret file. |
| `RENDER_ADD_RESOURCES_TO_ENVIRONMENT` | Add Resources to Environment | Tool to add resources to a Render environment. Use when you need to associate services, databases, Redis instances, or environment groups with an existing environment. |
| `RENDER_ADD_ROUTE` | Add Route | Tool to add redirect or rewrite rules to a Render service. Use when you need to configure URL routing, redirects, or rewrites for a service. Redirect rules send HTTP redirects to clients, while rewrite rules modify the request path internally. |
| `RENDER_CREATE_CUSTOM_DOMAIN` | Create Custom Domain | Tool to add a custom domain to a Render service. Use when you need to configure a custom domain for a service. |
| `RENDER_CREATE_ENV_GROUP` | Create Environment Group | Tool to create a new environment group. Use when you need to create a shared collection of environment variables and secret files that can be used across multiple services. |
| `RENDER_CREATE_ENVIRONMENT` | Create Environment | Tool to create a new environment within a Render project. Use when you need to set up a new environment for organizing services, databases, and other resources. |
| `RENDER_CREATE_POSTGRES` | Create Postgres Instance | Tool to create a new Postgres instance on Render. Use when you need to provision a new PostgreSQL database with configurable plan, version, and region. |
| `RENDER_CREATE_REGISTRY_CREDENTIAL` | Create Registry Credential | Tool to create a registry credential. Use when you need to add a new container registry credential to your Render account for authenticating with Docker Hub, GitHub, GitLab, Google Artifact Registry, or AWS ECR. |
| `RENDER_DELETE_ENV_GROUP_ENV_VAR` | Delete Environment Group Variable | Tool to remove an environment variable from an environment group. Use when you need to delete a specific environment variable by its key from a given environment group. |
| `RENDER_DELETE_ENV_GROUP_SECRET_FILE` | Delete Environment Group Secret File | Tool to remove a secret file from an environment group. Use when you need to delete a specific secret file by its name from a given environment group. |
| `RENDER_DELETE_ENVIRONMENT` | Delete Environment | Tool to delete a specified environment. Use when you need to remove an environment from Render. Returns success confirmation. |
| `RENDER_DELETE_KEY_VALUE` | Delete Key Value | Tool to delete a Key Value instance. Use when you need to remove a specific Key Value store from your Render account. |
| `RENDER_DELETE_OWNER_LOG_STREAM` | Delete Owner Log Stream | Tool to delete a log stream for an owner. Use when you need to remove log stream configuration for a specific workspace. |
| `RENDER_DELETE_OWNER_METRICS_STREAM` | Delete Owner Metrics Stream | Tool to delete a metrics stream for a workspace. Use when removing metrics integration for a specific owner. |
| `RENDER_DELETE_REGISTRY_CREDENTIAL` | Delete Registry Credential | Tool to delete a registry credential. Use when you need to remove a Docker registry credential from your Render account. |
| `RENDER_DELETE_SECRET_FILE` | Delete Secret File | Tool to delete a secret file from a Render service. Use when you need to remove a secret file that is no longer needed. |
| `RENDER_DELETE_SERVICE` | Delete Service | Tool to delete a service. Use when you need to permanently remove a service from your Render account. |
| `RENDER_DISCONNECT_BLUEPRINT` | Disconnect Blueprint | Tool to disconnect a blueprint from your Render account. Use when you need to remove a blueprint connection. |
| `RENDER_GET_ACTIVE_CONNECTIONS` | Get Active Connections | Tool to get active connection count metrics for Render resources. Use when you need to retrieve time-series data of active connections for Postgres or Redis instances over a specified time range. |
| `RENDER_GET_BANDWIDTH_SOURCES` | Get Bandwidth Sources | Tool to get bandwidth usage breakdown by traffic source. Use when you need to retrieve bandwidth usage statistics segmented by different traffic sources for a Render service. |
| `RENDER_GET_CPU` | Get CPU Usage | Tool to retrieve CPU usage metrics for Render resources. Use when you need to monitor CPU utilization for services, Postgres databases, or Redis instances. At least one filter (resource, service, or instance) must be provided. |
| `RENDER_GET_CPU_LIMIT` | Get CPU Limit | Tool to retrieve CPU limit metrics for Render resources. Use when you need to get the CPU limit time series data for services, Postgres databases, or Redis instances. Returns metrics over a specified time range with configurable resolution. |
| `RENDER_GET_DISK_CAPACITY` | Get Disk Capacity | Tool to get disk capacity metrics for Render resources. Use when you need to retrieve disk capacity time series data for services, Postgres databases, or Redis instances. At least one filter parameter (resource or service) must be specified. |
| `RENDER_GET_DISK_USAGE` | Get Disk Usage | Tool to retrieve disk usage metrics for Render resources. Use when you need to monitor persistent disk utilization for services, Postgres databases, or Redis instances. It is recommended to specify at least one resource filter. |
| `RENDER_GET_INSTANCE_COUNT` | Get Instance Count | Tool to get instance count metrics for Render resources. Use when you need to retrieve instance count time series data for services, Postgres databases, or Redis instances. The resource parameter is required. |
| `RENDER_GET_MEMORY` | Get Memory Usage | Tool to get memory usage metrics for one or more resources. Use when you need to retrieve memory usage data for services, Postgres databases, or Redis instances over a specified time range. |
| `RENDER_GET_MEMORY_LIMIT` | Get Memory Limit | Tool to get memory limit metrics for Render resources over a specified time range. Use when you need to retrieve memory limit data for services, Postgres databases, or Redis instances. At least one filter (resource, service, or instance) must be provided. |
| `RENDER_GET_MEMORY_TARGET` | Get Memory Target | Tool to get memory target metrics for Render resources. Use when you need to retrieve memory target data for services, Postgres databases, or Redis instances over a specified time range. At least one resource identifier (resource, service, or instance) is required. |
| `RENDER_GET_USER` | Get User | Tool to get the authenticated user. Use when you need to retrieve information about the currently authenticated account owner. |
| `RENDER_LINK_SERVICE_TO_ENV_GROUP` | Link Service to Environment Group | Tool to link a service to an environment group. Use when you need to associate a service with an environment group so that the service can access the environment variables and secret files defined in that group. |
| `RENDER_LIST_APPLICATION_FILTER_VALUES` | List Application Filter Values | Tool to list queryable instance values for application metrics. Use when you need to discover available filter values for metrics queries. |
| `RENDER_LIST_BLUEPRINTS` | List Blueprints | Tool to list all blueprints. Use when you need to retrieve the definitions of all blueprints in your account. |
| `RENDER_LIST_DEPLOYS` | List Deploys | Tool to list recent deploys for a Render service with pagination and filtering. Use when you need to fetch deploy history, inspect deploy statuses, or find a specific deployId to pass to other deploy operations. |
| `RENDER_LIST_DISKS` | List Disks | Tool to list all disks. Use when you need to retrieve all disks associated with your account. |
| `RENDER_LIST_ENV_GROUPS` | List Environment Groups | Tool to list environment groups. Use when you need to retrieve environment groups to view shared environment variables across services. |
| `RENDER_LIST_ENVIRONMENTS` | List Environments | Tool to list environments for a project. Use when you need to retrieve environments within a specific project. Requires at least one project ID. |
| `RENDER_LIST_ENV_VARS_FOR_SERVICE` | List Environment Variables for Service | Tool to list all environment variables configured directly on a Render service (with pagination). Use when you need to enumerate env vars without knowing individual keys. |
| `RENDER_LIST_INSTANCES` | List Instances | Tool to list instances of a service. Use when you need to retrieve all instances for a specific Render service. |
| `RENDER_LIST_KEY_VALUE` | List Key Value Instances | Tool to list all Key Value instances. Use when you need to retrieve Key Value instances associated with your account, optionally filtering by name, region, owner, environment, or timestamps. |
| `RENDER_LIST_LOGS` | List Logs | Tool to list logs for a specific workspace and resource. Use when you need to retrieve logs for services, databases, or other resources, with support for filtering by time range, log type, severity level, and text content. Wildcards and regex patterns are supported for most text filters. |
| `RENDER_LIST_LOGS_VALUES` | List Log Label Values | Tool to list log label values for a workspace. Use when you need to discover possible values for a specific log label (instance, host, statusCode, method, level, or type) within a time range. |
| `RENDER_LIST_MAINTENANCE` | List Maintenance Runs | Tool to list maintenance runs. Use when you need to retrieve scheduled or past maintenance activities for services and database instances. |
| `RENDER_LIST_NOTIFICATION_OVERRIDES` | List Notification Overrides | Tool to list notification overrides for services. Use when you need to retrieve notification settings that override default notification behavior for specific services. |
| `RENDER_LIST_OWNER_MEMBERS` | List Workspace Members | Tool to list workspace members. Use when you need to retrieve all members of a specific workspace or team. |
| `RENDER_LIST_OWNERS` | List Owners | Tool to list owners (users and teams). Use after authenticating to fetch available owner IDs for resource creation. |
| `RENDER_LIST_POSTGRES` | List Postgres Instances | Tool to list Postgres instances. Use when you need to retrieve all Postgres databases associated with your account, optionally filtering by name, region, or other criteria. |
| `RENDER_LIST_POSTGRES_EXPORT` | List Postgres Exports | Tool to list all exports for a Postgres instance. Use when you need to retrieve the history of exports for a specific Postgres database. |
| `RENDER_LIST_POSTGRES_USERS` | List PostgreSQL Users | Tool to list PostgreSQL user credentials for a Render PostgreSQL database instance. Use when you need to view all users with access to a specific PostgreSQL database. |
| `RENDER_LIST_PROJECTS` | List Projects | List Projects |
| `RENDER_LIST_REGISTRY_CREDENTIALS` | List Registry Credentials | Tool to list registry credentials. Use when you need to retrieve container registry credentials associated with your account, optionally filtering by name, username, or registry type. |
| `RENDER_LIST_RESOURCE_LOG_STREAMS` | List Resource Log Streams | Tool to list resource log stream overrides. Use when you need to retrieve log stream configurations for resources in your account. |
| `RENDER_LIST_ROUTES` | List Routes | Tool to list redirect/rewrite rules for a service. Use when you need to retrieve routing configuration for a Render service. |
| `RENDER_LIST_SECRET_FILES` | List Secret Files | Tool to list secret files for a Render service. Use when you need to retrieve all secret files associated with a specific service. |
| `RENDER_LIST_SERVICES` | List Services | Tool to list all services. Use when you need to retrieve services accessible by your account, optionally filtering by name or type. Use after authentication. |
| `RENDER_LIST_TASK_RUNS` | List Task Runs | Tool to list task runs. Use when you need to retrieve task execution history for workflows, optionally filtering by task ID, workflow, owner, or root task run. |
| `RENDER_LIST_TASKS` | List Tasks | Tool to list tasks. Use when you need to retrieve tasks from workflows, optionally filtering by owner, task ID, workflow ID, or workflow version ID. |
| `RENDER_LIST_WEBHOOKS` | List Webhooks | Tool to list all webhooks. Use when you need to retrieve configured webhooks for your account. |
| `RENDER_LIST_WORKFLOWS` | List Workflows | Tool to list workflows. Use when you need to retrieve workflows accessible by your account, optionally filtering by name, owner, environment, or workflow ID. |
| `RENDER_LIST_WORKFLOW_VERSIONS` | List Workflow Versions | Tool to list workflow versions. Use when you need to retrieve workflow versions, optionally filtering by owner, workflow, or version ID. |
| `RENDER_RESTART_SERVICE` | Restart Service | Tool to restart a service. Use when you need to restart a running service, such as after configuration changes or to resolve issues. |
| `RENDER_RESUME_SERVICE` | Resume Service | Tool to resume a suspended service. Use when you need to restart a service that was previously suspended. |
| `RENDER_RETRIEVE_CUSTOM_DOMAIN` | Retrieve Custom Domain | Tool to retrieve a specific custom domain for a service. Use when you need to get details about a custom domain associated with a Render service. |
| `RENDER_RETRIEVE_DEPLOY` | Retrieve deploy | Retrieve deploy |
| `RENDER_RETRIEVE_ENV_GROUP` | Retrieve Environment Group | Tool to retrieve a specific environment group by ID. Use when you need to fetch detailed information about a specific environment group including its environment variables, secret files, and linked services. |
| `RENDER_RETRIEVE_ENV_GROUP_ENV_VAR` | Retrieve Environment Variable | Tool to retrieve a specific environment variable from a Render environment group. Use when you need to fetch the value of a particular environment variable by its key. |
| `RENDER_RETRIEVE_ENV_GROUP_SECRET_FILE` | Retrieve Environment Group Secret File | Tool to retrieve secret file from an environment group. Use when you need to get the content of a specific secret file within an environment group. |
| `RENDER_RETRIEVE_ENV_VAR` | Retrieve Environment Variable | Tool to retrieve a specific environment variable from a Render service. Use when you need to fetch the value of a particular environment variable by its key. |
| `RENDER_RETRIEVE_OWNER` | Retrieve Owner | Tool to retrieve a specific owner (workspace) by ID. Use when you need details about a user or team workspace. |
| `RENDER_RETRIEVE_OWNER_NOTIFICATION_SETTINGS` | Retrieve Owner Notification Settings | Tool to retrieve notification settings for a specific owner (workspace). Use when you need to check current notification configuration for Slack, email, and preview notifications. |
| `RENDER_RETRIEVE_POSTGRES` | Retrieve Postgres Instance | Tool to retrieve a specific Postgres instance. Use when you need to get details about a Postgres database in your Render account. |
| `RENDER_RETRIEVE_PROJECT` | Retrieve Project | Tool to retrieve a specific project by ID. Use when you need to fetch detailed information about a Render project including its name, owner, and associated environments. |
| `RENDER_RETRIEVE_REGISTRY_CREDENTIAL` | Retrieve Registry Credential | Tool to retrieve a registry credential by ID. Use when you need to get details about a Docker registry credential in your Render account. |
| `RENDER_RETRIEVE_SECRET_FILE` | Retrieve Secret File | Tool to retrieve a secret file from a Render service. Use when you need to get the content of a specific secret file within a service. |
| `RENDER_RETRIEVE_SERVICE` | Retrieve Service | Tool to retrieve a specific service by ID. Use when you need detailed information about a service including its configuration, status, and deployment settings. |
| `RENDER_STREAM_TASK_RUNS_EVENTS` | Stream Task Runs Events | Tool to stream real-time task run events via Server-Sent Events (SSE). Use when you need to monitor task execution status and receive live updates as tasks progress. Requires maintaining an open HTTP connection to receive the event stream. |
| `RENDER_SUBSCRIBE_LOGS` | Subscribe to Logs | Tool to subscribe to real-time logs via WebSocket connection. Use when you need to stream logs as they are generated for services, databases, or other resources. Note: This endpoint requires HTTP/1.1 WebSocket upgrade (HTTP 101 Switching Protocols). For retrieving historical logs without streaming, use the List Logs action instead. |
| `RENDER_SUSPEND_SERVICE` | Suspend Service | Tool to suspend a service. Use when you need to temporarily stop a service without deleting it. |
| `RENDER_TRIGGER_DEPLOY` | Trigger Deploy | Tool to trigger a new deploy for a specified service. Requires the service to already exist on Render and be linked to a Git repo — initial setup and repo linking must be done in the Render UI. Use when you need to manually start a new build and deployment process, such as after updating service configuration or pushing code changes that Render does not auto-apply. |
| `RENDER_UPDATE_ENV_GROUP` | Update Environment Group | Tool to update an environment group's name. Use when you need to rename an existing environment group. |
| `RENDER_UPDATE_ENV_GROUP_ENV_VAR` | Update Environment Group Variable | Tool to add or update an environment variable in an environment group. Use when you need to set a new value for an environment variable or create a new one if it doesn't exist. You can either provide a specific value or request a randomly generated value. |
| `RENDER_UPDATE_ENV_GROUP_SECRET_FILE` | Update Environment Group Secret File | Tool to add or update a secret file in an environment group. Use when you need to create a new secret file or modify the content of an existing secret file within an environment group. |
| `RENDER_UPDATE_ENV_VAR` | Update Environment Variable | Tool to add or update an environment variable for a Render service. Use when you need to set a new environment variable or modify an existing one's value. You can either provide a specific value or have Render auto-generate a secure random value. |
| `RENDER_UPDATE_ENV_VARS_FOR_SERVICE` | Update Environment Variables for Service | Tool to update environment variables for a Render service. Use when you need to add, modify, or set environment variables for a service. This replaces all environment variables with the provided list. |
| `RENDER_UPDATE_HEADERS` | Update Header Rules | Tool to replace all header rules for a Render service. Use when you need to completely replace the existing set of custom HTTP headers with a new set. This operation removes all existing header rules and replaces them with the provided ones. |
| `RENDER_UPDATE_OWNER_LOG_STREAM` | Update Owner Log Stream | Tool to update log stream configuration for an owner. Use when you need to modify log stream settings for a specific workspace. |
| `RENDER_UPDATE_OWNER_NOTIFICATION_SETTINGS` | Update Owner Notification Settings | Tool to update notification settings for a specific owner (workspace). Use when you need to modify email, preview, or notification type settings. |
| `RENDER_UPDATE_POSTGRES` | Update Postgres Instance | Tool to update a Postgres instance configuration. Use when you need to modify settings like name, plan, disk size, high availability, or IP allowlist for an existing Render Postgres database. |
| `RENDER_UPDATE_PROJECT` | Update Project | Tool to update a project's name. Use when you need to rename an existing Render project. |
| `RENDER_UPDATE_REGISTRY_CREDENTIAL` | Update Registry Credential | Tool to update a registry credential. Use when you need to modify the name, username, authentication token, or registry type for an existing Docker registry credential in your Render account. |
| `RENDER_UPDATE_RESOURCE_LOG_STREAM` | Update Resource Log Stream | Tool to update log stream override for a resource. Use when you need to configure whether logs should be sent to a custom endpoint or dropped for a specific resource (server, cron job, postgres, or redis). |
| `RENDER_UPDATE_ROUTES` | Update Routes | Tool to update redirect/rewrite rules for a service. Use when you need to set or replace the routing configuration for a Render service. This operation replaces all existing routes with the provided list. |
| `RENDER_UPDATE_SECRET_FILES_FOR_SERVICE` | Update Secret Files for Service | Tool to update secret files for a Render service. Use when you need to create or update multiple secret files at once for a specific service. |
| `RENDER_UPDATE_SERVICE` | Update Service | Tool to update a service configuration. Use when you need to modify service settings such as auto-deploy, branch, build filters, Docker image, name, repository, or service-specific details. |
| `RENDER_VERIFY_CUSTOM_DOMAIN` | Verify Custom Domain | Tool to verify DNS configuration for a custom domain. Use when you need to trigger DNS verification for a custom domain associated with a Render service. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Render MCP server is an implementation of the Model Context Protocol that connects your AI agent to Render. It provides structured and secure access so your agent can perform Render operations on your behalf through a secure, permission-based interface.
With Composio's managed implementation, you don't have to create your own developer app. For production, if you're building an end product, we recommend using your own credentials. The managed server helps you prototype fast and go from 0-1 faster.

## Step-by-step Guide

### 1. Prerequisites

Before starting, make sure you have:
- Composio API Key and OpenAI API Key
- Primary know-how of OpenAI Agents SDK
- A live Render project
- Some knowledge of Python or Typescript

### 1. Getting API Keys for OpenAI and Composio

OpenAI API Key
- Go to the [OpenAI dashboard](https://platform.openai.com/settings/organization/api-keys) and create an API key. You'll need credits to use the models, or you can connect to another model provider.
- Keep the API key safe.
Composio API Key
- Log in to the [Composio dashboard](https://dashboard.composio.dev?utm_source=toolkits&utm_medium=framework_docs).
- Go to Settings and copy your API key.

### 2. Install dependencies

Install the Composio SDK and the OpenAI Agents SDK.
```python
pip install composio_openai_agents openai-agents python-dotenv
```

```typescript
npm install @composio/openai-agents @openai/agents dotenv
```

### 3. Set up environment variables

Create a .env file and add your OpenAI and Composio API keys.
```bash
OPENAI_API_KEY=sk-...your-api-key
COMPOSIO_API_KEY=your-api-key
USER_ID=composio_user@gmail.com
```

### 4. Import dependencies

What's happening:
- You're importing all necessary libraries.
- The Composio and OpenAIAgentsProvider classes are imported to connect your OpenAI agent to Composio tools like Render.
```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';
```

### 5. Set up the Composio instance

No description provided.
```python
load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())
```

```typescript
dotenv.config();

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.USER_ID;

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});
```

### 6. Create a Tool Router session

What is happening:
- You give the Tool Router the user id and the toolkits you want available. Here, it is only render.
- The router checks the user's Render connection and prepares the MCP endpoint.
- The returned session.mcp.url is the MCP URL that your agent will use to access Render.
- This approach keeps things lightweight and lets the agent request Render tools only when needed during the conversation.
```python
# Create a Render Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["render"]
)

mcp_url = session.mcp.url
```

```typescript
// Create Tool Router session for Render
const session = await composio.create(userId as string, {
  toolkits: ['render'],
});
const mcpUrl = session.mcp.url;
```

### 7. Configure the agent

No description provided.
```python
# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Render. "
        "Help users perform Render operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)
```

```typescript
// Configure agent with MCP tool
const agent = new Agent({
  name: 'Assistant',
  model: 'gpt-5',
  instructions:
    'You are a helpful assistant that can access Render. Help users perform Render operations through natural language.',
  tools: [
    hostedMcpTool({
      serverLabel: 'tool_router',
      serverUrl: mcpUrl,
      headers: { 'x-api-key': composioApiKey },
      requireApproval: 'never',
    }),
  ],
});
```

### 8. Start chat loop and handle conversation

No description provided.
```python
print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
// Keep conversation state across turns
const conversationSession = new OpenAIConversationsSession();

// Simple CLI
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: 'You: ',
});

console.log('\nComposio Tool Router session created.');
console.log('\nChat started. Type your requests below.');
console.log("Commands: 'exit', 'quit', or 'q' to end\n");

try {
  const first = await run(agent, 'What can you help me with?', { session: conversationSession });
  console.log(`Assistant: ${first.finalOutput}\n`);
} catch (e) {
  console.error('Error:', e instanceof Error ? e.message : e, '\n');
}

rl.prompt();

rl.on('line', async (userInput) => {
  const text = userInput.trim();

  if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
    console.log('Goodbye!');
    rl.close();
    process.exit(0);
  }

  if (!text) {
    rl.prompt();
    return;
  }

  try {
    const result = await run(agent, text, { session: conversationSession });
    console.log(`\nAssistant: ${result.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();
});

rl.on('close', () => {
  console.log('\n👋 Session ended.');
  process.exit(0);
});
```

## Complete Code

```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession

load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())

# Create Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["render"]
)
mcp_url = session.mcp.url

# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Render. "
        "Help users perform Render operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)

print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.USER_ID;

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});

async function main() {
  // Create Tool Router session
  const session = await composio.create(userId as string, {
    toolkits: ['render'],
  });
  const mcpUrl = session.mcp.url;

  // Configure agent with MCP tool
  const agent = new Agent({
    name: 'Assistant',
    model: 'gpt-5',
    instructions:
      'You are a helpful assistant that can access Render. Help users perform Render operations through natural language.',
    tools: [
      hostedMcpTool({
        serverLabel: 'tool_router',
        serverUrl: mcpUrl,
        headers: { 'x-api-key': composioApiKey },
        requireApproval: 'never',
      }),
    ],
  });

  // Keep conversation state across turns
  const conversationSession = new OpenAIConversationsSession();

  // Simple CLI
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: ',
  });

  console.log('\nComposio Tool Router session created.');
  console.log('\nChat started. Type your requests below.');
  console.log("Commands: 'exit', 'quit', or 'q' to end\n");

  try {
    const first = await run(agent, 'What can you help me with?', { session: conversationSession });
    console.log(`Assistant: ${first.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();

  rl.on('line', async (userInput) => {
    const text = userInput.trim();

    if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
      console.log('Goodbye!');
      rl.close();
      process.exit(0);
    }

    if (!text) {
      rl.prompt();
      return;
    }

    try {
      const result = await run(agent, text, { session: conversationSession });
      console.log(`\nAssistant: ${result.finalOutput}\n`);
    } catch (e) {
      console.error('Error:', e instanceof Error ? e.message : e, '\n');
    }

    rl.prompt();
  });

  rl.on('close', () => {
    console.log('\nSession ended.');
    process.exit(0);
  });
}

main().catch((err) => {
  console.error('Fatal error:', err);
  process.exit(1);
});
```

## Conclusion

This was a starter code for integrating Render MCP with OpenAI Agents SDK to build a functional AI agent that can interact with Render.
Key features:
- Hosted MCP tool integration through Composio's Tool Router
- SQLite session persistence for conversation history
- Simple async chat loop for interactive testing
You can extend this by adding more toolkits, implementing custom business logic, or building a web interface around the agent.

## How to build Render MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/render/framework/chatgpt)
- [Claude Agent SDK](https://composio.dev/toolkits/render/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/render/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/render/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/render/framework/codex)
- [Cursor](https://composio.dev/toolkits/render/framework/cursor)
- [VS Code](https://composio.dev/toolkits/render/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/render/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/render/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/render/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/render/framework/cli)
- [Google ADK](https://composio.dev/toolkits/render/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/render/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/render/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/render/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/render/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/render/framework/crew-ai)

## Related Toolkits

- [Supabase](https://composio.dev/toolkits/supabase) - Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.
- [Codeinterpreter](https://composio.dev/toolkits/codeinterpreter) - Codeinterpreter is a Python-based coding environment with built-in data analysis and visualization. It lets you instantly run scripts, plot results, and prototype solutions inside supported platforms.
- [GitHub](https://composio.dev/toolkits/github) - GitHub is a code hosting platform for version control and collaborative software development. It streamlines project management, code review, and team workflows in one place.
- [Ably](https://composio.dev/toolkits/ably) - Ably is a real-time messaging platform for live chat and data sync in modern apps. It offers global scale and rock-solid reliability for seamless, instant experiences.
- [Abuselpdb](https://composio.dev/toolkits/abuselpdb) - Abuselpdb is a central database for reporting and checking IPs linked to malicious online activity. Use it to quickly identify and report suspicious or abusive IP addresses.
- [Alchemy](https://composio.dev/toolkits/alchemy) - Alchemy is a blockchain development platform offering APIs and tools for Ethereum apps. It simplifies building and scaling Web3 projects with robust infrastructure.
- [Algolia](https://composio.dev/toolkits/algolia) - Algolia is a hosted search API that powers lightning-fast, relevant search experiences for web and mobile apps. It helps developers deliver instant, typo-tolerant, and scalable search without complex infrastructure.
- [Anchor browser](https://composio.dev/toolkits/anchor_browser) - Anchor browser is a developer platform for AI-powered web automation. It transforms complex browser actions into easy API endpoints for streamlined web interaction.
- [Apiflash](https://composio.dev/toolkits/apiflash) - Apiflash is a website screenshot API for programmatically capturing web pages. It delivers high-quality screenshots on demand for automation, monitoring, or reporting.
- [Apiverve](https://composio.dev/toolkits/apiverve) - Apiverve delivers a suite of powerful APIs that simplify integration for developers. It's designed for reliability and scalability so you can build faster, smarter applications without the integration headache.
- [Appcircle](https://composio.dev/toolkits/appcircle) - Appcircle is an enterprise-grade mobile CI/CD platform for building, testing, and publishing mobile apps. It streamlines mobile DevOps so teams ship faster and with more confidence.
- [Appdrag](https://composio.dev/toolkits/appdrag) - Appdrag is a cloud platform for building websites, APIs, and databases with drag-and-drop tools and code editing. It accelerates development and iteration by combining hosting, database management, and low-code features in one place.
- [Appveyor](https://composio.dev/toolkits/appveyor) - AppVeyor is a cloud-based continuous integration service for building, testing, and deploying applications. It helps developers automate and streamline their software delivery pipelines.
- [Backendless](https://composio.dev/toolkits/backendless) - Backendless is a backend-as-a-service platform for mobile and web apps, offering database, file storage, user authentication, and APIs. It helps developers ship scalable applications faster without managing server infrastructure.
- [Baserow](https://composio.dev/toolkits/baserow) - Baserow is an open-source no-code database platform for building collaborative data apps. It makes it easy for teams to organize data and automate workflows without writing code.
- [Bench](https://composio.dev/toolkits/bench) - Bench is a benchmarking tool for automated performance measurement and analysis. It helps you quickly evaluate, compare, and track your systems or workflows.
- [Better stack](https://composio.dev/toolkits/better_stack) - Better Stack is a monitoring, logging, and incident management solution for apps and services. It helps teams ensure application reliability and performance with real-time insights.
- [Bitbucket](https://composio.dev/toolkits/bitbucket) - Bitbucket is a Git-based code hosting and collaboration platform for teams. It enables secure repository management and streamlined code reviews.
- [Blazemeter](https://composio.dev/toolkits/blazemeter) - Blazemeter is a continuous testing platform for web and mobile app performance. It empowers teams to automate and analyze large-scale tests with ease.
- [Blocknative](https://composio.dev/toolkits/blocknative) - Blocknative delivers real-time mempool monitoring and transaction management for public blockchains. Instantly track pending transactions and optimize blockchain interactions with live data.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Render MCP?

With a standalone Render MCP server, the agents and LLMs can only access a fixed set of Render tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Render and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with OpenAI Agents SDK?

Yes, you can. OpenAI Agents SDK fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Render tools.

### Can I manage the permissions and scopes for Render while using Tool Router?

Yes, absolutely. You can configure which Render scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Render data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
