The OpenAI Agents SDK connects agents to MCP servers, so an agent can use Reelspan's hosted MCP server to publish, schedule and read results. There is no separate Reelspan package to install.
Install
pip install openai-agentsAPI key
Create a key under Developers → API keys and export it with your OpenAI key. Start with a test key (rs_test_…): every check runs, but nothing is posted.
export REELSPAN_API_KEY=rs_test_...
export OPENAI_API_KEY=sk-...Example
This agent publishes a text post to the sandbox network, which needs no connected account, and then checks the result.
import asyncio
import os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main():
async with MCPServerStreamableHttp(
name="Reelspan",
params={
"url": "https://api.reelspan.com/mcp",
"headers": {"Authorization": f"Bearer {os.environ['REELSPAN_API_KEY']}"},
"timeout": 30,
},
cache_tools_list=True,
) as reelspan:
agent = Agent(
name="Social publisher",
instructions="You publish and check social media posts with the Reelspan tools.",
mcp_servers=[reelspan],
)
result = await Runner.run(
agent,
"Publish 'Hello from my OpenAI agent' as a text post to the sandbox network for the profile my-brand, "
"then check its status and tell me the result.",
)
print(result.final_output)
asyncio.run(main())Replace my-brand with one of your profiles (the agent can find them with list_profiles).
Notes
- Posting runs in the background. The publish tools return a
request_id; the agent callsupload_statusto read each network's result. - Media goes in as URLs.
upload_videoandupload_photostake publichttpsURLs, not local files. - Scope the key. The agent can do whatever the key allows. A key with only Publish and Read can't create or delete profiles.
- Going live: swap the test key for a live one (
rs_live_…) and use real networks instead ofsandbox.
The full tool list is on the MCP server page. The SDK's own guide: openai.github.io/openai-agents-python/mcp.