Skip to content

Python SDK

Looking for Java? See the Java SDK | 📘 Looking for TypeScript? See the TypeScript SDK

Build distributed MCP agents with Python decorators and zero boilerplate

Overview

The MCP Mesh Python SDK provides a decorator-based API for building distributed agent systems. Combined with FastMCP, you get:

  • @mesh.tool - Register capabilities with dependency injection
  • @mesh.agent - Configure agent servers with auto-run
  • @mesh.llm - LLM-powered tools with automatic tool discovery
  • @mesh.llm_provider - Zero-code LLM providers via LiteLLM
  • @mesh.route - FastAPI routes with mesh DI

Installation

# Install the SDK
pip install mcp-mesh

# Install the CLI (required for development)
npm install -g @mcpmesh/cli

Quick Start

# View the quick start guide
meshctl man quickstart

# Or scaffold a new agent
meshctl scaffold --name my-agent

Documentation

For comprehensive documentation, use the built-in man pages:

meshctl man --list              # List all topics
meshctl man <topic>             # View a topic
meshctl man <topic> --raw       # Get markdown output (LLM-friendly)

Key Topics

Topic Command Description
Quick Start meshctl man quickstart Get started in minutes
Decorators meshctl man decorators @mesh.tool, @mesh.agent, @mesh.llm
Dependency Injection meshctl man di How DI works
LLM Integration meshctl man llm Build AI-powered agents
Deployment meshctl man deployment Local, Docker, Kubernetes

Next Steps

Decorators Reference

Complete API reference for all decorators

View Reference →

LLM Integration

Build AI-powered agents

Learn More →