For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cloudflare Agents SDK Integration

Integrate Talordata MCP Server with Cloudflare Agents SDK to give AI agents access to real-time SERP data and structured search results.

How to integrate Cloudflare's Agents SDK with TalorData's Web MCP server to build AI agents on Cloudflare Workers, featuring over 60 MCP tools.

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

Set up your Cloudflare environment

Please ensure you have Node.js 20 or later installed, then log in to Cloudflare:

npx wrangler login

3

Install the Agents Starter template.

npx create-cloudflare@latest mcp-demo --template cloudflare/agents-starter
cd mcp-example
npm install

4

Configure environment variables

Copy the example .env file and add your OpenAI API key:

cp .dev.vars.example .dev.vars

edit .dev.vars

OPENAI_API_KEY=sk-...

5

Connect TalorData MCP in your agent.

In src/server.ts,find the default, commented-out MCP connection onChatMessage:

// const mcpConnection = await this.mcp.connect(
//   "https://path-to-mcp-server/mcp"
// );

Replace it with the TalorData MCP connection:

// Connect to TalorData MCP server
const mcpConnection = await this.mcp.connect(
  "https://mcp.talordata.net/API_TOKEN/mcp"
);

// Merge MCP tools with local tools
const allTools = {
  ...tools,
  ...this.mcp.getAITools()
};

Please ensure that mcp.connect() is called before this.mcp.getAITools() to avoid an error indicating that jsonSchema is uninitialized.

6

Testing to see if it works.

  • Please replace <API_TOKEN> with your actual TalorData API token.

  • Start the development server:

    npm start
  • Open the application in your browser and ask customer service a question, for example:

Find the latest 3 news items about Cloudflare Agents and summarize them in bullets with links.

You should be able to see agents using TalorData's web scraping tools to retrieve and aggregate real-time results:

7

Monitor usage

View your API usage in the TalorData SERP API usage logs.

Last updated