OpenAI SDK Integration
Integrate Thordata MCP Server with OpenAI SDK to give AI agents access to real-time SERP data and structured search results.
Connect the OpenAI SDK to the ThorData MCP server to enable GPT-4o and o-series models to perform real-time web searches, scraping, and structured data access.
Hosted MCP
1
Get your API token
Go to SERP API-API Token to create an API token.
Copy your API Token (format as:
sk_7qBRe***************************)
2
Configure your MCP server
from openai import OpenAI
client = OpenAI()
resp = client.responses.create(
model="gpt-4o",
tools=[
{
"type": "mcp",
"server_label": "ThorData",
"server_url": "https://mcp.thordata.net/API_TOKEN/mcp",
"require_approval": "never",
},
],
input="What is the weather in Paris ?",
)
print(resp.output_text)3
Testing to see if it works.
Ask your AI: "Can you use Google to search for 'today's weather'?"
The AI will request permission—click "Allow."
You should be able to see results!
4
Monitor usage
View your API usage in the ThorData SERP API usage logs.
Last updated
Was this helpful?