petro-mcp

v1.1.2
io.github.petropt/petro-mcp Checked 3 hours ago Published 3 months ago

MCP server for petroleum engineering: LAS logs, decline curves, PVT, petrophysics, volumetrics.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

query_production

Query production data from a CSV file (columns: date, well_name, oil, gas, water). Args: file_path: Absolute path to the production CSV file. well_name: Optional well name to filter by. start_date: Optional start date (YYYY-MM-DD). end_date: Optional end date (YYYY-MM-DD).

ParameterTypeDescription
file_path *string
end_date
start_date
well_name

read_las

Parse a LAS 2.0 well log file and return header, curves list, and data summary. Args: file_path: Absolute path to the LAS file.

ParameterTypeDescription
file_path *string

get_curve_values

Get specific curve data from a LAS file with optional depth range filtering. For curves longer than ``max_samples`` points in the filtered range, the result is downsampled (every Nth point). Default 0 means no cap. Args: file_path: Absolute path to the LAS file. curve_names: List of curve mnemonics to retrieve (e.g., ["GR", "RHOB"]). start_depth: Optional start depth for filtering. end_depth: Optional end depth for filtering. max_samples: Optional cap on returned points per curve (default 0 = no cap).…

ParameterTypeDescription
curve_names *array
file_path *string
end_depth
max_samplesinteger
start_depth

compare_logs

Compare two or more LAS files: common curves, depth overlap, unit consistency. Args: paths: Two or more absolute LAS file paths.

ParameterTypeDescription
paths *array

calculate_pvt_properties

Calculate comprehensive black-oil PVT properties at given conditions. Returns bubble point, solution GOR, oil FVF, oil density, oil viscosity, gas Z-factor, gas FVF, gas viscosity, and gas compressibility. Supported oil correlation sets: - 'standing' (default): Standing (1947) - 'vasquez_beggs': Vasquez and Beggs (1980) - 'petrosky_farshad': Petrosky and Farshad (1993) Args: api_gravity: Oil API gravity (degrees). gas_sg: Gas specific gravity (air = 1.0). temperature: Reservoir temperatur…

ParameterTypeDescription
api_gravity *number
gas_sg *number
pressure *number
temperature *number
correlationstring
separator_pressurenumber

calculate_bubble_point

Calculate bubble point pressure using Standing's correlation (1947). Args: api_gravity: Oil API gravity (degrees). gas_sg: Gas specific gravity (air = 1.0). temperature: Reservoir temperature in F. rs: Solution gas-oil ratio at bubble point in scf/STB.

ParameterTypeDescription
api_gravity *number
gas_sg *number
rs *number
temperature *number

calculate_gas_z

Calculate gas Z-factor with choice of correlation and pseudocritical method. Z-factor methods: 'hall_yarborough' (default), 'dranchuk_abou_kassem'. Pseudocritical methods: 'sutton' (default), 'piper' (better for gas condensates and sour gases). Args: temperature: Temperature in F. pressure: Pressure in psi. gas_sg: Gas specific gravity (air = 1.0). method: Z-factor correlation -- 'hall_yarborough' or 'dranchuk_abou_kassem'. pseudocritical_method: Pseudocritical method -- 'sutton' or 'piper'.…

ParameterTypeDescription
gas_sg *number
pressure *number
temperature *number
co2_fractionnumber
h2s_fractionnumber
methodstring
n2_fractionnumber
pseudocritical_methodstring

pz_analysis

Gas material balance: P/Z vs cumulative gas production analysis. Fits a linear P/Z vs Gp trend to estimate Original Gas In Place (OGIP). The #1 reservoir engineering spreadsheet calculation. Args: pressures: Reservoir pressures (or P/Z values) in psi at each time step. cumulative_gas: Cumulative gas production in Bcf at each pressure. abandonment_pressure: Optional abandonment pressure in psi for recoverable gas estimate.

ParameterTypeDescription
cumulative_gas *array
pressures *array
abandonment_pressure

volumetric_ooip

Calculate volumetric Original Oil In Place (OOIP). OOIP = 7758 * A * h * phi * (1-Sw) / Bo (STB) Args: area_acres: Reservoir area in acres. thickness_ft: Net pay thickness in feet. porosity: Porosity (fraction, 0-1). sw: Water saturation (fraction, 0-1). bo: Oil formation volume factor (bbl/STB).

ParameterTypeDescription
area_acres *number
bo *number
porosity *number
sw *number
thickness_ft *number

volumetric_ogip

Calculate volumetric Original Gas In Place (OGIP). OGIP = 43560 * A * h * phi * (1-Sw) / Bg (scf) Args: area_acres: Reservoir area in acres. thickness_ft: Net pay thickness in feet. porosity: Porosity (fraction, 0-1). sw: Water saturation (fraction, 0-1). bg: Gas formation volume factor (ft3/scf).

ParameterTypeDescription
area_acres *number
bg *number
porosity *number
sw *number
thickness_ft *number

recovery_factor

Calculate recovery factor (RF = Np/N or Gp/G). Works for both oil and gas -- just use consistent units. Args: ooip_or_ogip: Original oil or gas in place. cumulative_production: Cumulative production (same units).

ParameterTypeDescription
cumulative_production *number
ooip_or_ogip *number

convert_oilfield_units

Convert between oilfield and SI units. Supports volume (bbl, m3, gal, liters, Mcf, MMcf, Bcf), rate (bbl/day, m3/day, Mcf/day, bbl/month), pressure (psi, kPa, MPa, bar, atm), length (ft, m, in, cm, miles, km), density (g/cc, kg/m3, lb/ft3, API gravity, SG), temperature (F, C, K), permeability (md, m2), viscosity (cp, Pa.s), and energy/BOE (BOE, MMBtu, Mcf_gas). Args: value: Numeric value to convert. from_unit: Source unit (e.g. 'bbl', 'psi', 'API'). to_unit: Target unit (e.g. 'm3', 'kPa', 'SG').

ParameterTypeDescription
from_unit *string
to_unit *string
value *number

list_oilfield_units

List all supported oilfield unit categories and their units.

calculate_vshale

Calculate shale volume (Vshale) from gamma ray log. Methods: linear, larionov_tertiary, larionov_older, clavier. Args: gr: Gamma ray reading (API units). gr_clean: GR in clean sand (API units). gr_shale: GR in pure shale (API units). method: Calculation method. Default 'linear'.

ParameterTypeDescription
gr *number
gr_clean *number
gr_shale *number
methodstring

calculate_density_porosity

Calculate porosity from bulk density log. Args: rhob: Bulk density (g/cc). rho_matrix: Matrix density (g/cc). Default 2.65 (sandstone). rho_fluid: Fluid density (g/cc). Default 1.0 (fresh water).

ParameterTypeDescription
rhob *number
rho_fluidnumber
rho_matrixnumber

calculate_archie_sw

Calculate water saturation using Archie equation (clean sands). Sw = (a * Rw / (phi^m * Rt))^(1/n) Args: rt: True formation resistivity (ohm-m). phi: Porosity (fraction v/v, 0-1). rw: Formation water resistivity (ohm-m). a: Tortuosity factor. Default 1.0. m: Cementation exponent. Default 2.0. n: Saturation exponent. Default 2.0.

ParameterTypeDescription
phi *number
rt *number
rw *number
anumber
mnumber
nnumber

calculate_net_pay

Determine net pay by applying porosity, Sw, and Vshale cutoffs to log data. Returns net pay thickness, net-to-gross, average properties over pay, and per-sample pay flags. Args: depths: Measured depths (ft). phi: Porosity values (fraction v/v) at each depth. sw: Water saturation values (fraction v/v) at each depth. vshale: Shale volume values (fraction v/v) at each depth. phi_cutoff: Minimum porosity for pay. Default 0.06. sw_cutoff: Maximum water saturation for pay. Default 0.5. vsh_c…

ParameterTypeDescription
depths *array
phi *array
sw *array
vshale *array
phi_cutoffnumber
sw_cutoffnumber
vsh_cutoffnumber

fit_decline

Fit an Arps decline curve to production data. Returns fitted parameters, R-squared, and predicted rates. Physics-constrained: b-factor bounded to [0, 2], non-negative rates enforced. Args: production_data: List of dicts with 'time' (months) and 'rate' keys, or 'oil'/'gas' keys (time assumed as sequential months). model: Arps decline model - 'exponential', 'hyperbolic', or 'harmonic'.

ParameterTypeDescription
production_data *array
modelstring

calculate_eur

Calculate Estimated Ultimate Recovery from Arps decline parameters. Args: qi: Initial production rate (bbl/day or Mcf/day). Di: Initial decline rate (1/month, nominal). b: Arps b-factor (0=exponential, 1=harmonic, 0-2=hyperbolic). economic_limit: Minimum economic rate (same units as qi). model: Arps model - 'exponential', 'hyperbolic', or 'harmonic'.

ParameterTypeDescription
qi *number
Dinumber
bnumber
economic_limitnumber
modelstring