MCPcopy Create free account
hub / github.com/Farama-Foundation/MAgent2

github.com/Farama-Foundation/MAgent2 @0.3.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.4 ↗ · + Follow
356 symbols 855 edges 57 files 79 documented · 22% updated 16d ago0.3.4 · 2026-05-23★ 33819 open issues

Browse by type

Functions 307 Types & classes 49
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://raw.githubusercontent.com/Farama-Foundation/MAgent2/main/MAgent2-text.png" width="500px"/>

MAgent2 is a library for the creation of environments where large numbers of pixel agents in a gridworld interact in battles or other competitive scenarios.

MAgent2 is a maintained fork of the original MAgent codebase. It contains some reference environments implemented using the PettingZoo API. These environments used to be included in PettingZoo itself, but have been moved here to exist independently. They are being regularly maintained and will receive bug fixes, support new versions of Python, etc. Development used to take place at github.com/Farama-Foundation/MAgent but was moved to github.com/Farama-Foundation/MAgent2 so that the distinction from the original MAgent library is clear to users.

Installation

Install using pip: pip install magent2. See docs for usage information.

Requirements

MAgent2 supports Linux and macOS and Python 3.8+.

References

@inproceedings{zheng2018magent,
  title={MAgent: A many-agent reinforcement learning platform for artificial collective intelligence},
  author={Zheng, Lianmin and Yang, Jiacheng and Cai, Han and Zhou, Ming and Zhang, Weinan and Wang, Jun and Yu, Yong},
  booktitle={Thirty-Second AAAI Conference on Artificial Intelligence},
  year={2018}
}

If you wish to cite this repo with it's modifications specifically, please cite:

@misc{magent2020,
  author = {Terry, Jordan K and Black, Benjamin and Jayakumar, Mario},
  title = {MAgent},
  year = {2020},
  publisher = {GitHub},
  note = {GitHub repository},
  howpublished = {\url{https://github.com/Farama-Foundation/MAgent}}
}

Project Maintainers

  • Project Manager: Travis Virgil - travis@farama.org
  • Maintenance for this project is also contributed by the broader Farama team: farama.org/team.

Core symbols most depended-on inside this repo

Shape

Method 227
Function 80
Class 49

Languages

C++56%
Python44%

Modules by API surface

src/gridworld/GridWorld.h57 symbols
magent2/gridworld.py54 symbols
src/gridworld/Map.cc23 symbols
src/gridworld/GridWorld.cc20 symbols
src/runtime_api.cc19 symbols
magent2/environments/magent_env.py17 symbols
src/gridworld/Range.h15 symbols
magent2/environment.py13 symbols
src/gridworld/grid_def.h10 symbols
magent2/render.py10 symbols
src/gridworld/Map.h9 symbols
src/gridworld/RewardEngine.cc8 symbols

For agents

$ claude mcp add MAgent2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page