Sign inSign up

mcpmesh/python-runtime

By mcpmesh

Updated 24 days ago

Image
0

10K+

mcpmesh/python-runtime repository overview

MCP Mesh Python Runtime

Base container image for building distributed Model Context Protocol (MCP) agents with Python

The MCP Mesh Python Runtime provides a pre-configured environment for developing and deploying MCP agents that automatically integrate with the MCP Mesh service discovery system.

🚀 Quick Start

Use as base image in your Dockerfile

FROM mcpmesh/python-runtime:latest

Copy your agent code

COPY my_agent.py .

Your agent automatically connects to MCP Mesh registry

CMD ["python", "my_agent.py"]

🏗️ What's Included

  • Python 3.11 - Modern Python runtime
  • MCP Mesh SDK - Full service mesh integration
  • FastMCP - High-performance MCP protocol implementation
  • Auto-Discovery - Automatic registry registration and capability injection
  • Health Monitoring - Built-in health checks and graceful shutdown
  • Dependency Injection - Dynamic remote function calls via HTTP proxies

🛠️ Agent Development

Create agents using simple decorators:

import mesh

@mesh.agent( name="my-agent", capabilities=["data_processing", "file_operations"], dependencies=["database", "storage"] ) class MyAgent: @mesh.tool def process_data(self, data: str) -> dict: # Your agent logic here return {"processed": data}

📦 Environment Variables

VariableDefaultDescription
MCP_MESH_REGISTRY_URLhttp://registry:8080Registry service URL
MCP_MESH_HTTP_PORT9090Agent HTTP server port
MCP_MESH_ENABLEDtrueEnable mesh integration
LOG_LEVELINFOLogging level

🔄 Runtime Features

  • Resilient Connection: Works offline, auto-connects when registry available
  • Hot Swapping: Dynamic capability updates without restarts
  • Graceful Degradation: Continues operation if registry fails
  • Microservices Ready: Designed for Kubernetes and Docker Compose

📋 Supported Architectures

  • linux/amd64 - Intel/AMD 64-bit
  • linux/arm64 - ARM 64-bit (Apple Silicon, Graviton)

🔗 Links

Part of the MCP Mesh ecosystem - see also https://hub.docker.com/r/mcpmesh/registry and https://hub.docker.com/r/mcpmesh/cli.


This focuses on the developer experience and shows how easy it is to build agents using the runtime image.

Tag summary

Content type

Image

Digest

sha256:49229f72f

Size

97.8 MB

Last updated

24 days ago

docker pull mcpmesh/python-runtime