# MCP Mesh Python Runtime
Python runtime for the MCP Mesh service mesh framework.
## Installation
```bash
pip install mcp-mesh
```
## Quick Start
```python
import mesh
# Import types from public API
from mesh.types import McpMeshAgent
# Define your agent
@mesh.agent(name="hello-world", http_port=9090)
class HelloWorldAgent:
"""Hello World agent demonstrating MCP Mesh features."""
pass
# Create a greeting function with dependency injection
@mesh.tool(
capability="greeting",
dependencies=["date_service"],
description="Greeting function with date dependency injection"
)
def greet(name: str = "World", systemDate: McpMeshAgent = None) -> str:
"""Greeting function with automatic dependency injection."""
if systemDate is not None:
try:
current_date = systemDate()
return f"Hello, {name}! Today is {current_date}"
except Exception:
pass
return f"Hello, {name}!"
# The runtime auto-initializes when you import mcp_mesh
# Your functions are automatically registered with the mesh registry
```
## Features
- **Automatic Registration**: Functions are automatically registered with the Go registry
- **Health Monitoring**: Built-in health checks and heartbeats
- **Dependency Injection**: Inject dependencies into your functions
- **Service Discovery**: Find and use other services in the mesh
- **Graceful Degradation**: Works even if registry is unavailable
## Configuration
The runtime can be configured via environment variables:
- `MCP_MESH_ENABLED`: Enable/disable runtime (default: "true")
- `MCP_MESH_REGISTRY_URL`: Registry URL (default: "http://localhost:8080")
- `MCP_MESH_AGENT_NAME`: Custom agent name (auto-generated if not set)
## API Architecture
MCP Mesh uses a clear separation between public and private APIs:
- **`mesh`** - Public user API for decorators and types
- **`_mcp_mesh`** - Private internal implementation (do not import directly)
The underscore prefix on `_mcp_mesh` follows Python conventions to indicate internal/private packages. Users should only import from the `mesh` package to ensure compatibility across versions.
## Documentation
See the [main repository](https://github.com/dhyansraj/mcp-mesh) for complete documentation.
Raw data
{
"_id": null,
"home_page": null,
"name": "mcp-mesh",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "agents, ai, distributed, kubernetes, mcp, microservices, orchestration",
"author": null,
"author_email": "MCP Mesh Contributors <noreply@mcp-mesh.dev>",
"download_url": "https://files.pythonhosted.org/packages/dc/ed/dd8c96e2b5af682405ed7aeee0c09f623b7e11ae0d24764eb8cb4ab8560f/mcp_mesh-0.5.4.tar.gz",
"platform": null,
"description": "# MCP Mesh Python Runtime\n\nPython runtime for the MCP Mesh service mesh framework.\n\n## Installation\n\n```bash\npip install mcp-mesh\n```\n\n## Quick Start\n\n```python\nimport mesh\n\n# Import types from public API\nfrom mesh.types import McpMeshAgent\n\n# Define your agent\n@mesh.agent(name=\"hello-world\", http_port=9090)\nclass HelloWorldAgent:\n \"\"\"Hello World agent demonstrating MCP Mesh features.\"\"\"\n pass\n\n# Create a greeting function with dependency injection\n@mesh.tool(\n capability=\"greeting\",\n dependencies=[\"date_service\"],\n description=\"Greeting function with date dependency injection\"\n)\ndef greet(name: str = \"World\", systemDate: McpMeshAgent = None) -> str:\n \"\"\"Greeting function with automatic dependency injection.\"\"\"\n if systemDate is not None:\n try:\n current_date = systemDate()\n return f\"Hello, {name}! Today is {current_date}\"\n except Exception:\n pass\n\n return f\"Hello, {name}!\"\n\n# The runtime auto-initializes when you import mcp_mesh\n# Your functions are automatically registered with the mesh registry\n```\n\n## Features\n\n- **Automatic Registration**: Functions are automatically registered with the Go registry\n- **Health Monitoring**: Built-in health checks and heartbeats\n- **Dependency Injection**: Inject dependencies into your functions\n- **Service Discovery**: Find and use other services in the mesh\n- **Graceful Degradation**: Works even if registry is unavailable\n\n## Configuration\n\nThe runtime can be configured via environment variables:\n\n- `MCP_MESH_ENABLED`: Enable/disable runtime (default: \"true\")\n- `MCP_MESH_REGISTRY_URL`: Registry URL (default: \"http://localhost:8080\")\n- `MCP_MESH_AGENT_NAME`: Custom agent name (auto-generated if not set)\n\n## API Architecture\n\nMCP Mesh uses a clear separation between public and private APIs:\n\n- **`mesh`** - Public user API for decorators and types\n- **`_mcp_mesh`** - Private internal implementation (do not import directly)\n\nThe underscore prefix on `_mcp_mesh` follows Python conventions to indicate internal/private packages. Users should only import from the `mesh` package to ensure compatibility across versions.\n\n## Documentation\n\nSee the [main repository](https://github.com/dhyansraj/mcp-mesh) for complete documentation.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Kubernetes-native platform for distributed MCP applications",
"version": "0.5.4",
"project_urls": {
"Discussions": "https://github.com/dhyansraj/mcp-mesh/discussions",
"Documentation": "https://github.com/dhyansraj/mcp-mesh/tree/main/docs",
"Homepage": "https://github.com/dhyansraj/mcp-mesh",
"Issues": "https://github.com/dhyansraj/mcp-mesh/issues",
"Repository": "https://github.com/dhyansraj/mcp-mesh"
},
"split_keywords": [
"agents",
" ai",
" distributed",
" kubernetes",
" mcp",
" microservices",
" orchestration"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "77ba1a8edc84c0ee5a7c96fdd8aeacba69ac8bb348d4783bf7a22bae38c62346",
"md5": "40e326c5bc4fc58fd4d9c41d794bc50f",
"sha256": "722b205ffe026677aa3cc0dae32d08612db3c7977ea2c7a090cf8b73532d024e"
},
"downloads": -1,
"filename": "mcp_mesh-0.5.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "40e326c5bc4fc58fd4d9c41d794bc50f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 265420,
"upload_time": "2025-09-10T03:14:21",
"upload_time_iso_8601": "2025-09-10T03:14:21.093220Z",
"url": "https://files.pythonhosted.org/packages/77/ba/1a8edc84c0ee5a7c96fdd8aeacba69ac8bb348d4783bf7a22bae38c62346/mcp_mesh-0.5.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dceddd8c96e2b5af682405ed7aeee0c09f623b7e11ae0d24764eb8cb4ab8560f",
"md5": "f9a0a52835c4dbbf648c2c78492df869",
"sha256": "0533302fa71de829417e6d4d447ae61b419e66bd1c0e5d00e555dc486cab585e"
},
"downloads": -1,
"filename": "mcp_mesh-0.5.4.tar.gz",
"has_sig": false,
"md5_digest": "f9a0a52835c4dbbf648c2c78492df869",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 163507,
"upload_time": "2025-09-10T03:14:22",
"upload_time_iso_8601": "2025-09-10T03:14:22.588370Z",
"url": "https://files.pythonhosted.org/packages/dc/ed/dd8c96e2b5af682405ed7aeee0c09f623b7e11ae0d24764eb8cb4ab8560f/mcp_mesh-0.5.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 03:14:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dhyansraj",
"github_project": "mcp-mesh",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mcp-mesh"
}