MCP cover image

轻巧且可扩展的Python SDK,用于构建多代理系统,简化通信和集成,并对模型上下文协议(MCP)的一流支持

0

Github Watches

0

Github Forks

0

Github Stars

SimpleMAS

A lightweight SDK for building Multi-Agent Systems with a focus on the Model Context Protocol (MCP).

Features

  • Agent communication - HTTP, WebSockets, and MCP-based communication between agents
  • Environment-based configuration - Configure agents using environment variables
  • Belief-Desire-Intention (BDI) agents - Build agents that reason about beliefs, desires, and intentions
  • Reasoning integration - Easily integrate LLMs and other reasoning systems
  • Deployment tools - Generate and orchestrate deployment configurations for Docker Compose and Kubernetes

Installation

pip install simple-mas

Or with Poetry:

poetry add simple-mas

Usage

Basic Agent

from simple_mas import Agent
from simple_mas.communication import HTTPCommunicator

agent = Agent(
    name="my-agent",
    communicator=HTTPCommunicator(
        agent_name="my-agent",
        service_urls={"other-agent": "http://other-agent:8000/"}
    )
)

# Add capabilities, start the agent, etc.

Deployment Orchestration

SimpleMas includes powerful tools for deploying multi-agent systems:

# Discover SimpleMas components in your project
simplemas discover --directory ./my-project

# Orchestrate components into a single Docker Compose file
simplemas orchestrate --directory ./my-project --output docker-compose.yml

# Generate Kubernetes manifests for a component
simplemas k8s --input ./my-project/agent/simplemas.deploy.yaml --output k8s/

Documentation

For more details, see the documentation.

Quick Start

from simple_mas.agent import BaseAgent
from simple_mas.communication import McpSseCommunicator

class MyAgent(BaseAgent):
    async def setup(self) -> None:
        # Initialize your agent here
        pass

    async def run(self) -> None:
        # Run your agent's main logic
        response = await self.communicator.send_request(
            "chess-engine",
            "make_move",
            {"board_state": "..."}
        )

    async def shutdown(self) -> None:
        # Clean up resources
        pass

# Run the agent
async def main():
    agent = MyAgent(name="my-orchestrator")
    await agent.start()

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

Development

# Clone the repository
git clone https://github.com/yourusername/simple-mas.git
cd simple-mas

# Install dependencies
poetry install

# Install pre-commit hooks
poetry run pre-commit install

# Run tests
poetry run pytest

# Run all code quality checks at once
./scripts/check_quality.sh

# Or run individual checks
poetry run black src tests
poetry run isort src tests
poetry run flake8 src tests
poetry run mypy src

Code Quality

This project uses several tools to ensure code quality:

  • black: Code formatting
  • isort: Import sorting
  • flake8: Linting
  • mypy: Type checking
  • pytest: Testing

Pre-commit hooks are configured to run these checks automatically before each commit. You can also run all checks manually using the ./scripts/check_quality.sh script.

License

MIT

相关推荐

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Aurity Ltd
  • Create and Publish Business Websites in seconds. AI will gather all the details about your website and generate link to your website.

  • Convincible Ltd
  • You're in a stone cell – can you get out? A classic choose-your-adventure interactive fiction game, based on a meticulously-crafted playbook. With a medieval fantasy setting, infinite choices and outcomes, and dice!

  • John Rafferty
  • Text your favorite pet, after answering 10 questions about their everyday lives!

  • Ian O'Connell
  • Provide players' names or enter Quickstart to start the game!

  • analogchat.com
  • Efficient Spotify assistant for personalized music data.

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • langgenius
  • alibaba
  • Azure
  • 该存储库用于开发Azure MCP服务器,将Azure的功能带给您的代理商。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • microsoft
  • Python tool for converting files and office documents to Markdown.

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • mindsdb
  • AI's query engine - Platform for building AI that can answer questions over large scale federated data. - The only MCP Server you'll ever need

  • WangRongsheng
  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • caio-moliveira
  • 创建该项目是为了证明我们如何与不同的模型上下文协议(MCP)连接。

  • AstrBotDevs
  • llm llm聊天机器人及开发框架平台支持QQ QQ QQ 频道、电报| mcp 服务器、 openai,deepseek,双子座、硅基流动、月之暗面、 ollama,

    Reviews

    2.8 (5)
    Avatar
    user_fPw0dFsR
    2025-04-24

    I've been using simple-mas by wilson-urdaneta and it has significantly improved my workflow. The straightforward design and easy-to-navigate interface make it a pleasure to use. I appreciate the effort put into making this application user-friendly. Highly recommend it to anyone looking for a reliable and efficient solution!

    Avatar
    user_1M1LPDTK
    2025-04-24

    I've been using simple-mas by wilson-urdaneta and it has exceeded my expectations. The ease of use and intuitive interface makes it a standout tool. Whether you're new to this type of application or an experienced user, you'll appreciate the thoughtful design and functionality. Highly recommend giving it a try!

    Avatar
    user_xkpEMP4L
    2025-04-24

    I've been using Simple-MAS by Wilson Urdaneta and it has completely exceeded my expectations. This application is user-friendly, efficient, and a reliable tool for managing multiple tasks seamlessly. Highly recommended for anyone looking for simplicity and functionality in one package.

    Avatar
    user_e8zy1gOH
    2025-04-24

    As a dedicated user of MCP applications, I highly recommend "simple-mas" by Wilson Urdaneta. This straightforward and efficient product stands out for its user-friendly interface and robust functionality. It's perfect for those who need a reliable solution with minimal hassle. The welcome message sets a positive tone, and the starting URL makes it easy to jump right in. Overall, "simple-mas" delivers on its promises and enhances productivity seamlessly.

    Avatar
    user_SG2jVPPz
    2025-04-24

    As a dedicated user of MCP applications, I highly recommend simple-mas by wilson-urdaneta. Its intuitive design and seamless user experience make it an excellent tool for both beginners and advanced users. The straightforward navigation and helpful welcome guide ensure that users can easily get started and benefit from its features right away. Simple-mas truly stands out for its efficiency and user-friendly interface. A must-try for anyone looking to streamline their processes!