Tooling for the MADA multi-agent ecosystem
Project description
MADA Tools
This repository contains AI tooling for the MADA (Multi-Agent Design Assistant) ecosystem, including Model Context Protocol (MCP) servers.
Repository Structure
mada-tools/
├── src/
│ └── mada_tools/
│ ├── shared/ # Common utilities and base classes
│ ├── scheduler/ # Job scheduling tools
│ │ ├── flux/ # Flux workload manager
│ │ └── slurm/ # SLURM workload manager
│ ├── workflow/ # Workflow orchestration tools
│ ├── simulation/ # Simulation tools
│ │ └── vertex_cfd/ # Vertex-CFD multiphysics
│ ├── geometry/ # Geometry and mesh tools
│ ├── surrogate/ # Surrogate modeling and analysis tools
│ │ └── professor/ # Professor analysis tools
│ └── monitor/ # Job monitoring and failure diagnostics
│ └── job_monitor/ # Scheduler-agnostic log analysis server
├── examples/ # Example agents for using MCP servers
├── configs/ # Configuration files
├── scripts/ # Deployment and startup scripts
MCP Servers by Category
Scheduler
- Flux: Job scheduling and execution using Flux scheduler
- SLURM: Job scheduling and execution using SLURM
Simulation
- Vertex-CFD: Vertex-CFD mini-application tools
Geometry
- Coming soon!
Surrogate
- Professor: Surrogate modeling tools
Monitor
- Job Monitor: Scheduler-agnostic job diagnostics
Setup
python -m venv venv
source venv/bin/activate
# Basic installation (without Flux)
pip install -e .
# With Flux scheduler support
pip install -e ".[flux]"
# Install all optional dependencies
pip install -e ".[all]"
Set required environment variables for Professor server (LLM access):
export API_KEY="your-api-key-here"
export API_BASE_URL="https://api.openai.com/v1/responses"
Quick Start
Each MCP server run independently, so you can pick and choose which servers to start. There are multiple ways to start servers:
-
With the
mada-toolscommand (recommended):mada-tools start-servers configs/development.json
With this command, you can also choose individual servers from the configuration file to start. For example, to start just flux and vertex_cfd:
mada-tools start-servers configs/development.json -s flux vertex_cfd
-
With individual commands & config files:
mada-mcp-flux --config configs/development.json mada-mcp-slurm --config configs/development.json mada-mcp-professor --config configs/development.json mada-mcp-monitor --config configs/development.json
-
With individual commands & command line arguments:
# Using stdio transport (no host/port needed) mada-mcp-flux --transport stdio mada-mcp-slurm --transport stdio # Using streamable-http with custom host/port mada-mcp-flux --transport streamable-http --host localhost --port 9001 mada-mcp-slurm --transport streamable-http --host localhost --port 9002 mada-mcp-professor --transport streamable-http --host localhost --port 9006 mada-mcp-monitor --transport streamable-http --host localhost --port 9007
-
Start with defaults (streamable-http on localhost:8000):
mada-mcp-flux mada-mcp-slurm mada-mcp-professor mada-mcp-monitor
-
Start all servers at once:
./scripts/start_all_servers.sh
Using Example Agents with MCP Servers
The examples/ directory contains example agents that can connect to and use MADA MCP servers. This examples demonstrate how to integrate MCP tools with Large Language Models.
Quick Start with Multi-Server Agent
-
Set API credentials (required for example agent):
export API_KEY="your-api-key" export API_BASE_URL="https://api.openai.com/v1/responses"
If using LivAI's endpoint, request a LivAPI key.
-
Start MCP servers: Starting all servers:
mada-tools start-servers configs/development.json
Starting specific servers:
mada-tools start-servers configs/development.json -s flux vertex_cfd
-
Run the multi-server agent:
cd examples python simple_agent_loop.py --config config.json
Use custom config:
python simple_agent_loop.py --config my_config.json
Multi-Server Workflow Examples
The agent can now connect to multiple MCP servers simultaneously and use all their tools in a single session:
Complete Parameter Sweep Workflow:
Edit config.json to include only vertex_cfd and flux in "mcp_servers", then:
python simple_agent_loop.py
Try this example prompt:
Generate 10 runs in ./testrun with parameters velocity_0, velocity_1, "Exodus Write Frequency", "Minimum Time Step", "Maximum Time Step", "Initial Time Step", and "Final Time Index" with lower bounds 0, 5, 10, 1e-4, 1e-3, 1e-3, 1000 and upper bounds 5, 10, 10, 1e-4, 1e-3, 1e-3, 1000
Job Diagnostic Example
Analyze Existing Vertex_CFD Runs:
Start the server using: mada-mcp-monitor --port 8006 &, then run the diagnostic script:
python diagnose_existing_runs.py --monitor http://localhost:8006/mcp --study /path/to/study
This script will:
Scan the directory /path/to/study (for example ./testrun from above), locate all run_i folders, read the tail of run_i.out and run_i.err, and produce a structured summary for each run. The Job Monitor will classify failures such as segmentation faults, MPI rank aborts, missing files, permission errors, out-of-memory terminations, or scheduler preemptions. If no known signatures match, the summary includes an unclassified entry containing a log excerpt.
Configuration
The agent uses examples/config.json for all configuration:
- Model settings: Configure which model and API endpoint to use
- Server selection: Simply include/exclude servers in the
"mcp_servers"section
Example config:
{
"model": {
"model": "o3",
"api_key": "${API_KEY}",
"base_url": "${API_BASE_URL:-https://api.openai.com/v1/responses}"
},
"mcp_servers": {
"flux": {
"url": "http://localhost:8001/mcp",
"description": "Flux workload manager for job execution"
},
"professor": {
"transport": "streamable-http",
"url": "http://localhost:8005/mcp",
"description": "Professor visualization tool"
}
}
}
The agent provides an interactive chat interface where you can use natural language to orchestrate complex multi-server workflows.
Configuration
Server configurations can be found in the configs/ directory:
development.json- Development settings
Environment Variable Expansion
Configuration files support environment variable expansion for secure handling of sensitive values:
{
"servers": {
"professor": {
"env_vars": {
"API_KEY": "${API_KEY}",
"API_BASE_URL": "${API_BASE_URL:-https://api.openai.com/v1/responses}"
}
}
}
}
Supported formats:
${VAR_NAME}- Expands to the value ofVAR_NAMEenvironment variable${VAR_NAME:-default}- Uses default value ifVAR_NAMEis not set
This allows you to:
Set environment variables: export API_KEY="your-key" and reference them securely in config: "API_KEY": "${API_KEY}"
Transport Methods
MCP servers support different transport methods:
-
streamable-http: Network-based HTTP transport (default)
- Good for distributed systems and production
- Supports streaming responses
- Requires host and port configuration
-
stdio: standardio-based transport
- Good for local development and direct process communication
- No network configuration needed
- Communicates via stdin/stdout
Example configuration:
{
"servers": {
"flux": {
"transport": "streamable-http",
"host": "localhost",
"port": 8001,
"env_vars": {
"FLUX_HANDLE": "default"
}
},
"professor": {
"host": "localhost",
"port": 8005,
"transport": "streamable-http",
"env_vars": {
"API_KEY": "${API_KEY}",
"MODEL": "${MODEL:-o3}",
"PROF_VIS_PATH": "/usr/workspace/prof/bin/prof-vis",
"API_BASE_URL": "${API_BASE_URL:-https://api.openai.com/v1/responses}"
}
}
}
}
Note: host and port are only required when transport is streamable-http. For stdio transport, omit host and port since communication happens via process stdin/stdout.
Troubleshooting
Missing Dependencies
Each server has specific dependencies:
- Professor Server: Requires API access
export API_KEY="your-api-key"
Common Issues
- "No module named 'flux'": Install with Flux support:
pip install -e ".[flux]" - "Failed to connect to Flux": Ensure Flux is running and accessible
- API errors: Check
API_KEYenvironment variable. If using LivAI's endpoint, request a LivAPI key.
Building Documentation Locally
Install the optional dependencies:
pip install -e .[docs]
Then build the documentation:
mkdocs serve
This will provide a localhost URL for you. Open that in your browser to view the documentation.
Release
MADA Tools is distributed under the terms of the Apache License (Version 2.0) WITH LLVM Exception.
All new contributions must be made under the Apache 2.0 License WITH LLVM Exception.
See LICENSE, COPYRIGHT, and NOTICE for details.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
LLNL-CODE-2019936
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mada_tools-0.1.0.tar.gz.
File metadata
- Download URL: mada_tools-0.1.0.tar.gz
- Upload date:
- Size: 89.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6181891c6e7779f653749a9a18c29fa4d19757ef732c00986b511c444e606144
|
|
| MD5 |
49f1229bdf2d7b4bbe4d841fbd71ec51
|
|
| BLAKE2b-256 |
0e346b435a23c8ef30cc0f853178fffbd430466ba7b0598d87de150eeccdf22a
|
Provenance
The following attestation bundles were made for mada_tools-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on llnl/mada-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mada_tools-0.1.0.tar.gz -
Subject digest:
6181891c6e7779f653749a9a18c29fa4d19757ef732c00986b511c444e606144 - Sigstore transparency entry: 1855327965
- Sigstore integration time:
-
Permalink:
llnl/mada-tools@6e4ab9c963e9a3195a7a6f3958386741428a2c58 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/llnl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@6e4ab9c963e9a3195a7a6f3958386741428a2c58 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mada_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mada_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 121.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79c492a46f64d58bb06a22a630952006c4d2755c5d2bec2ba830ea9d7b603845
|
|
| MD5 |
280ce4e68e83748bab8a6b408c4144cd
|
|
| BLAKE2b-256 |
40080c051b0f7147d52158f9567d00a18d67de22444092be5002502ecf664298
|
Provenance
The following attestation bundles were made for mada_tools-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on llnl/mada-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mada_tools-0.1.0-py3-none-any.whl -
Subject digest:
79c492a46f64d58bb06a22a630952006c4d2755c5d2bec2ba830ea9d7b603845 - Sigstore transparency entry: 1855328021
- Sigstore integration time:
-
Permalink:
llnl/mada-tools@6e4ab9c963e9a3195a7a6f3958386741428a2c58 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/llnl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@6e4ab9c963e9a3195a7a6f3958386741428a2c58 -
Trigger Event:
release
-
Statement type: