How peterbloomingdale/pmxagent works
PMxAgent turns pharmacometrics workflows into agent-callable tools: an MCP client invokes the Python server, which discovers and proxies the R Plumber API; its endpoints produce analysis, simulation, and standardized-data results. The graph preserves the five documented endpoint branches and their major domain engines. Endpoint implementations are represented by their exact tree paths, but their internals were not sampled; links to domain engines and the DATA-to-NCA handoff rely on README documentation.
Main entry points: rapi.R Plumber API · pk.R PK endpoint · server.py MCP server · data.R Data formatting
Components 15
Agent access
- MCP server
server.py - OAuth tokens
server.py
R API
- Plumber API
apis/rapi.R
Analysis workflows
- NCA endpoint
apis/endpoints/nca.R - Exposure-response
apis/endpoints/er.R - PK endpoint
apis/endpoints/pk.R - Data formatting
apis/endpoints/data.R - Model library
apis/endpoints/library.R - Data processing
apis/utils/data_processing.R
Model engines
- One-compartment model
apis/models/1CM.cpp - Two-compartment model
apis/models/2CM.cpp - ER model fitting
apis/models/er_models.R - Literature PK models
apis/models/nlmixr2lib_sim.R - mrgsolve simulation
apis/models/mrgsolve_pk.R
Other components
- AI agent
Connections 15
- AI agent → MCP server: invokes tools
README.md - MCP server → OAuth tokens: authenticates clients
server.py - MCP server → Plumber API: discovers and proxies
server.py - Plumber API → NCA endpoint: routes requests
README.md - Plumber API → Exposure-response: routes requests
README.md - Plumber API → PK endpoint: routes requests
README.md - Plumber API → Data formatting: routes requests
README.md - Plumber API → Model library: routes requests
README.md - Data formatting → Data processing: standardizes data
- Data formatting → NCA endpoint: feeds formatted data
README.md - PK endpoint → One-compartment model: simulates
- PK endpoint → Two-compartment model: simulates
- PK endpoint → mrgsolve simulation: uses simulation
- Exposure-response → ER model fitting: fits models
- Model library → Literature PK models: simulates library models