Skip to main content

Add your description here

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_aslan11_weather-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_aslan11_weather-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_aslan11_weather-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_aslan11_weather-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_aslan11_weather-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32cad905dcf166e903f41e6d9154a5567f7c98ccdaf57900d6f8dfdd21996082
MD5 e71a6a866830f529a3da8c6a42065f00
BLAKE2b-256 57ac6214b48463e832db75ad78a465edf0699c431066a236159f30a66b1ff060

See more details on using hashes here.

File details

Details for the file iflow_mcp_aslan11_weather-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_aslan11_weather-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_aslan11_weather-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa5af4174c723f271ce23bd30094797432401b23219f671d2c0cd5c622424d24
MD5 f2525c6366cfc44403d6d3c3ca18ae6c
BLAKE2b-256 b398436edbc9ca7fa397dbcf42647aca8adfe3890f1578a99502079850528dd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page