Sponsored by Deepsite.site

Temporal Durable Mcp Weather Sample

Created By
Aslan118 months ago
he purpose of this repo is to demonstrate how easy it is to leverage workflows as tools for MCP servers by taking modelcontext.io's weather example and making it durable by implementing the MCP tools as Temporal workflows
Content

Temporal & Durable MCP

The purpose of this repo is to demonstrate how easy it is to leverage workflows as tools for MCP servers by taking modelcontext.io's weather example and making it durable by implementing the MCP tools as Temporal workflows


Prerequisites:


Getting Started

  1. First step - clone me
  2. cd temporal-durable-mcp-weather-sample
  3. uv venv (create virtual env)
  4. source .venv/bin/activate
  5. uv pip install pyproject.toml
  6. Start Temporal Server: temporal server start-dev
  7. Start Worker: python worker.py
  8. Edit your Claude for Desktop Config:
    • Open Claude for Desktop
    • Click Settings in the toolbar
    • Click Developer
    • Click Edit Config (this should open up a finder window that points to a file called claude_desktop_config.json)
    • Open the file mentioned above in your editor of choice and modify it to look like the following
      • {
          "mcpServers": {
            "weather": {
              "command": "uv",
              "args": [
                "--directory",
                "/ABSOLUTE/PATH/TO/PARENT/FOLDER/temporal-durable-mcp-weather-sample",
                "run",
                "weather.py"
              ]
            }
          }
        }
        
    • Validate that the tools exposed by the server (get_alerts, get_forecast) show up in Search and Tools by clicking the slider icon in the chat box of Claude for Desktop
  9. Ask Claude for any weather alerts and the forecast for a particular city - it should leverage the tools. If it doesn't, try prompting it again encouraging it to use MCP tools that it has access to.

Results

Here we can see Claude is using the tools intelligently to look for weather alerts while getting me weather information:

Claude MCP Example

What's Cool About This

This demonstrates how tools in MCP can be implemented as workflows, adding durability. Per Claude:

Traditional MCP tool implementations are like having a single phone conversation - if the line cuts out at any point, you lose everything and have to start over from scratch. When an AI agent is performing complex, multi-step operations (like processing a large dataset, coordinating multiple API calls, or handling a lengthy business process), a single failure anywhere in the chain means complete failure.

MCP API Example

Temporal workflows act like a detailed journal that remembers exactly where you left off. Think of it as having a conversation with someone who takes meticulous notes - even if you both get interrupted and come back hours later, you can pick up exactly where you left off without missing a beat.

MCP Tools As Workflows Example

This demonstrates what we're calling "tools as workflows" - a tool is implemented as a Temporal Workflow, with the benefits of durability, state management, and retries built in.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.