With our newest 26.4.1 release of the Zügel MCP server we added Python as a second supported language after. This article only explains the Python setup and Python specific features. If you want to learn what Zügel is and what it can do for you, please read our introduction article.
Python Setup
As described in the introduction you need to create an .mcp.json file that tells your agent how to start Zügel. Then start your agent in the root directory of your Python project and ask it to use the generate_config tool to generate the zugel.json file followed by a call to reload_all. After that the agent load the will analyze your project and create the initial baselines. It will inform you about existing cyclic dependencies on the file and directory/package level. If you add architecture definition files it will also check your architectural rules.
The Python version of zugel.json looks like that:
{
"language": "python",
"project": {
"modules": [
{ "name": "widget", "sourceRoots": ["src"] }
],
"generatedPatterns": ["**/*_pb2.py", "**/*_pb2_grpc.py", "**/generated.py"]
},
"arcFiles": ["architecture/Widget.arc"]
}
The configuration for tolerated cyclic dependencies is the same as in Java. To mark generated code you can provide a list of patterns that match generated Python files. This is relevant for cycle analysis. Cyclic dependencies only consisting of generated files are tolerated automatically.
Read More