Hi ;) Ynon Perek We Start at 10:00
MCP Server
REST API
get_tools()
run_tool(tool_name)
HTTP Streaming
Server Sent Events
Command line (stdio)
MCP Client VS Code ChatGPT Web Interface Claude Desktop
what's the weather today? => I don't know BUT if you run this code and give the result I will know and tell you get_weather()
=> MCP - decouple tools --- agent
-
Intro & Tools
- What is a public MCP Server
- Tools: Official MCP TypeScript SDK + Cloudflare Agents SDK
- https://zod.dev
- Create the project:
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless
- Update @modelcontextprotocol/sdk to the latest version
- https://github.com/modelcontextprotocol/servers
-
Run in dev mode
- npm run dev
- npx @modelcontextprotocol/inspector
- Connect: http://localhost:8787/mcp
- Connect: http://localhost:8787/sse
-
Add state
type State = { log: Array<string> };
export class MyMCP extends McpAgent<Env, State, {}> {
initialState: State = {
log: [] as Array<string>,
}
...
this.setState({ log: [...this.state.log, text] })
-
Build something useful
- AI logger
- Use to log or notify important events during development
-
Publish the tool
- npm run deploy
- demo: Use the tool from VS Code
-
Add persistent data
npx wrangler kv namespace create MCP_LOG
- add to code:
interface Env { MCP_LOG: KVNamespace; }
-
Authentication
-
How it works https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/index.ts
-
How it looks from VS Code https://code.visualstudio.com/blogs/2025/06/12/full-mcp-spec-support
-
-
Q & A