How to Use the NewsAPI MCP in OpenAI Agents SDK
Build production news agents with the OpenAI Agents SDK that query real-time data from over 150,000 sources.
Works with every AI agent you already use
…and any MCP-compatible client
Connect NewsAPI MCP to OpenAI Agents SDK
Create your Vinkius account to connect NewsAPI to OpenAI Agents SDK and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Monitor news and trigger agent workflows
Give your agent the ability to watch the news. It can use `get_headlines_by_category` to monitor for breaking stories in a specific vertical, like tech or finance. When a relevant headline appears, it can trigger another specialized agent to dig deeper. That second agent can then use `search_articles` to find related coverage and build a full report. With the OpenAI dashboard, you get a full trace of this handoff, so you always know exactly what your agents are doing and why. It's a clear, auditable trail for production systems.
Run safe, validated news queries
Your agent gets access to powerful search tools, but you stay in control. Before your agent executes a call to `get_articles_from_domains` or `search_headlines`, OpenAI's built-in guardrails can validate the action. This prevents your agent from running nonsensical or unintended queries. You define the rules. The framework enforces them. This means you can confidently deploy agents that interact with real-world news data without worrying about them going off the rails. It’s a safety net for autonomous operations.
Auto-discover tools from this MCP Server
You don't need to manually define each NewsAPI function for your agent. Just point the OpenAI Agents SDK to the Vinkius endpoint for this MCP Server. It automatically discovers all 10 tools, from `list_sources` to `get_popular_articles`. Your agent immediately understands what it can do—search, list, and get headlines. Setting `cacheToolsList=True` makes this process even faster on subsequent runs. You write less boilerplate code and get to the real work faster.
Set up NewsAPI MCP in OpenAI Agents SDK
Prerequisites
- Python 3.10+ installed
-
openai-agentspackage (pip install openai-agents) - Active Vinkius subscription with a valid endpoint token
- 1
Install the SDK
Run
pip install openai-agentsto install the OpenAI Agents SDK. The MCP integration is built-in — no extra dependencies needed. - 2
Connect via SSE transport
Use
MCPServerSsewith your Vinkius endpoint URL. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. The SDK auto-discovers all NewsAPI tools at runtime. - 3
Create your Agent
Pass the MCP to
Agent(mcp_servers=[server]). The agent receives NewsAPI tools as native definitions — JSON schemas resolve automatically. - 4
Run the agent
Call
Runner.run(agent, prompt)to execute. The agent invokes the appropriate NewsAPI tools and returns structured results. Copy the full example on the right to get started.
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerSse
async def main():
async with MCPServerSse(
url="https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
) as server:
agent = Agent(
name="NewsAPI Agent",
instructions="You have access to NewsAPI tools.",
mcp_servers=[server],
)
result = await Runner.run(agent, "List recent transactions")
print(result.final_output)
asyncio.run(main()) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by NewsAPI. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about NewsAPI MCP in OpenAI Agents SDK
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the NewsAPI MCP today
We host it, we monitor it, we maintain it. You just paste one token.