Connect OpenAI API to Nodes2Cloud
The Responses API's hosted MCP tool.
OpenAI API talks to the Nodes2Cloud MCP server at https://api.nodes2cloud.com/mcp over Streamable HTTP. Once connected, your agent can read the node catalogue, write and check workflows, and request deploys that wait for your approval by default.
Use a Personal Access Token
OpenAI API connects with a Personal Access Token. Create one in the editor under Integrations → MCP server → Headless & CI Tokens, then Generate Token. Replace n2c_pat_YOUR_TOKEN below with it. The code reads it from the N2C_API_KEY environment variable.
Treat the token like a password and keep it out of source control.
Python
pythonimport os
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5",
input="List my Nodes2Cloud workflows.",
tools=[{
"type": "mcp",
"server_label": "nodes2cloud",
"server_url": "https://api.nodes2cloud.com/mcp",
"authorization": os.environ["N2C_API_KEY"],
"require_approval": "always",
}],
)
print(response.output_text)OpenAI API's MCP documentationInstructions checked