All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

Agents, Workers - Build MCP servers with the Agents SDK

1y ago

Source

CloudflareAgents, Workers - Build MCP servers with the Agents SDKcloudflare.com
Snippet from the RSS feed
The Agents SDK now includes built-in support for building remote MCP (Model Context Protocol) servers directly as part of your Agent. This allows you to easily create and manage MCP servers, without the need for additional infrastructure or configuration. The SDK includes a new MCPAgent class that extends the Agent class and allows you to expose resources and tools over the MCP protocol, as well as authorization and authentication to enable remote MCP servers. JavaScript export class MyMCP extends McpAgent { server = new McpServer ( { name : "Demo" , version : "1.0.0" , } ) ; async init () { this . server . resource ( `counter` , `mcp://resource/counter` , ( uri ) => { // ... } ) ; this . server . tool ( "add" , "Add two numbers together" , { a : z . number () , b : z . number () }, async ({ a , b }) => { // ... }, ) ; } } TypeScript export class MyMCP extends McpAgent < Env > { server = new McpServer ( { name : "Demo" , version : "1.0.0" , } ) ; async init () { this . server . resource ( `counter` , `mcp://resource/counter` , ( uri ) => { // ... } ) ; this . server . tool ( "add" , "Add two numbers together" , { a : z . number () , b : z . number () }, async ({ a , b }) => { // ... }, ) ; } } See the example for the full code and as the basis for building your own MCP servers, and the client example for how to build an Agent that acts as an MCP client. To learn more, review the announcement blog as part of Developer Week 2025. Agents SDK updates We've made a number of improvements to the Agents SDK , including: Support for building MCP servers with the new MCPAgent class. The ability to export the current agent, request and WebSocket connection context using import { context } from "agents" , allowing you to minimize or avoid direct dependency injection when calling tools. Fixed a bug that prevented query parameters from being sent to the Agent server from the useAgent React hook. Automatically converting the agent name in useAgent or useAgentChat to kebab-case to ensure it matches the naming convention expected by routeAgentRequest . To install or update the Agents SDK, run npm i agents@latest in an existing project, or explore the agents-starter project: npm create cloudflare@latest -- --template cloudflare/agents-starter See the full release notes and changelog on the Agents SDK repository and

You might also wanna read

Building Three Production-Ready MCP Servers for AI Agent Tool Integration

The article introduces the Model Context Protocol (MCP) as an open standard that unifies how AI agents connect to external tools and data so

dev.to·6d ago

Open-Source SDK 'mcp-use' for Building AI Agents with MCP Servers

The article introduces 'mcp-use,' an open-source SDK and cloud infrastructure designed to help development teams build and deploy custom AI

Product Hunt·11mo ago

API To MCP: A platform that converts business APIs into AI-agent-ready MCP servers

API To MCP is a tool that converts REST, GraphQL, SaaS, and internal business APIs into hosted MCP (Model Context Protocol) servers, enablin

Product Hunt·26d ago

Safari Technology Preview 247 adds built-in MCP server for AI agent browser control

Apple's Safari Technology Preview 247 introduces a built-in Model Context Protocol (MCP) server that provides 16 tools for AI agents to cont

briefly.co·1d ago

Exploring Model Context Protocol for Building Effective Agents on GitHub

The article discusses the use of Model Context Protocol (MCP) in building effective agents, specifically focusing on the mcp_realtor_agent e

github.com·11mo ago

Apple launches Safari MCP server in Technology Preview 247 for AI-assisted web development and debugging

Apple has introduced the Safari MCP (Model Context Protocol) server in Safari Technology Preview 247, enabling AI agents to connect directly

webkit.org·1d ago

Apple launches Safari MCP server in Technology Preview 247 for AI-assisted web development and debugging

Apple has introduced the Safari MCP (Model Context Protocol) server in Safari Technology Preview 247, enabling AI agents to connect directly

webkit.org·1d ago

Comments

Sign in to join the conversation.

No comments yet. Be the first.