Skip to main content

Durable Model Context Protocol (MCP) helpers for building resumable MCP servers on top of Reboot durable workflows.

Project description

Reboot Durable MCP

A framework for building durable MCP servers.

  • Takes advantage of the protocols ability to resume after disconnection, e.g., due to the server getting rebooted.

  • Any existing requests will be retried safely using Reboot workflows.

  • Using Reboot you can run multiple replicas of your server, and session messages will always be routed to the same replica.

Requirements

  • Linux and macOS
  • Python >= 3.12
  • Docker

Install

Using uv:

uv add durable-mcp

Using pip:

pip install durable-mcp

Run your application

Activate the venv (set up either via uv or python -m venv venv):

source .venv/bin/activate

Make sure you have Docker running:

docker ps

And run your app:

rbt dev run --python --application=path/to/your/main.py

If you want the application to be restarted when you modify your files you can add one or more --watch=path/to/**/*.py to the above command line.

To simplify you can move all command line args to a .rbtrc.

# This file will aggregate all of the command line args
# into a single command line that will be run when you
# use `rbt`.
#
# For example, to add args for running `rbt dev run`
# you can add lines that start with `dev run`. You can add
# one or more args to each line.

dev run --python
dev run --application=path/to/your/main.py
dev run --watch=path/to/**/*.py --watch=different/path/to/**/*.py

Supported client --> server requests:

  • initialize
  • tools/call
  • tools/list
  • prompts/get
  • prompts/list
  • resources/list
  • resources/read
  • resources/templates/list
  • resources/subscribe
  • resources/unsubscribe
  • completion/complete
  • logging/setLevel

Supported client --> server notifications:

  • notifications/initialized
  • notifications/progress (for server initiated requests, e.g., elicitation)
  • notifications/roots/list_changed

Supported client <-- server requests:

  • elicitation/create
  • roots/list
  • sampling/createMessage

Supported client <-- server notifications:

  • notifications/progress
  • notifications/message
  • notifications/prompts/list_changed
  • notifications/resources/list_changed
  • notifications/tools/list_changed
  • notifications/resources/updated

Supported client <--> server notifications:

  • notifications/cancelled

TODO:

  • EventStore support for resumability
  • Auth
  • Docs
  • yapf
  • Push to durable-mcp in pypi.org
  • Pydantic state for each session

Contributing

First grab all dependencies:

uv sync

Activate the venv:

source .venv/bin/activate

Generate code:

rbt generate

Make sure you have Docker running:

docker ps

Make your changes and run the tests:

pytest tests

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

durable_mcp-0.2.0.tar.gz (86.8 kB view details)

Uploaded Source

Built Distribution

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

durable_mcp-0.2.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file durable_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: durable_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 86.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for durable_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4fd8c8284a5fc7374f43a4c77567c449d83cd4aeac15c935fba5ee2ce6fa2871
MD5 baee0cb4b1b8ac320ce9c8221518b254
BLAKE2b-256 7d0ce8f15955173f26cd9abe04cc10f21c95ca621d903cf5d14109278d59371f

See more details on using hashes here.

File details

Details for the file durable_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: durable_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for durable_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d0f6b54feb2aec39ec28bcd726d85421ad8962137f57ff7801ab656f2c1068a
MD5 eea574ec8653e43e61e6fe6df5f15a21
BLAKE2b-256 08e4a231a719065b8018765eb1694ac2ed25fd8c011c336861d1b209629b2919

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