MCP ScannerCustom audit
All servers

open-energy-transition/pypsa-mcp

PyPSA MCP: PyPSA Energy Modeling for LLMs

Packagepypsamcp
Version0.1.4 in pyproject.toml
PublisherOpen Energy Transition Official
MCP Registrynot listed
Scanned2026-11-25
Scannerv1.3.0
Methodologyv1.2
Stars 74Forks 10Last push 2026-03-20
Python 100.0%by source files the scanner reads
Code safety10.0Exposure9.2Prompts10.0Supply chainnot checkedSecrets10.0Transparency10.0
Analysis confidence97%
How much of the server the scanner could read: tools analyzed, files parsed, limits hit.
Code Safetynothing published yet10.0/10

Paths from tool input into commands, SQL, files and URLs

Capability Exposure9.2/10Good

How much power the tools give an agent over the machine

Prompt Integritynothing published yet10.0/10

Hidden instructions and poisoning in text for the model

Supply Chainnot checked—

Known vulnerabilities in the packages the server uses

Secrets & Credentialsnothing published yet10.0/10

How the server reads credentials and where they can go

Behavior Transparencynothing published yet10.0/10

Whether the tools do only what their descriptions say

How far the analysis went

  • Supply Chain: the dependency files state no exact versions the scanner could check, so it has no number

Top risks in plain words

  • HIGHTool run_simulation executes code by design: an agent steered by prompt injection can use it that way.

How to use it safely

Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.

  • Run it in a container or a virtual machine

    run_simulation can start programs or run code they are given. Keep it away from your home folder, keys and other projects.

  • Turn off the tools you do not use

    Most MCP clients let you disable single tools. If you do not need run_simulation, switch them off.

  • Keep confirmations on

    Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.

What its tools can do on your machine

The server offers 22 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.

None of the tools reaches any of these in the code the scanner could trace.

Where its requests and secrets go

Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.

Hosts written in the code

The literal addresses the tools' requests name.

  • None: no request names a fixed host.
Addresses from settings

Constants or settings that start an address; the value comes from configuration.

  • None seen.
Secrets it reads

Credential-like environment variables. Give the server a key with the least access it needs.

  • None: no credential-like variable is read by the tools.

Text it brings in from outside

No tool was seen returning text from outside the server to the model.

Tool annotations

No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.

Tools, prompts and resources (22: 22 tools)

Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.

run_simulationtool Run a simulation on a PyPSA network.Executes code
Run a simulation on a PyPSA network.

    Supports 8 modes: pf, lpf, optimize, mga, security_constrained,
    rolling_horizon, transmission_expansion_iterative, optimize_and_pf.
add_bustool [Deprecated] Add a bus to a PyPSA model. Use add_component() instead.
[Deprecated] Add a bus to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        bus_id: The ID for the new bus
        v_nom: Nominal voltage in kV
        x: x-coordinate for plotting
        y: y-coordinate for plotting
        carrier: Energy carrier (e.g., "AC", "DC")
        country: Country code if applicable
add_componenttool Add any PyPSA component to a model.
Add any PyPSA component to a model.

    Args:
        model_id: The model to add the component to
        component_type: Component type (e.g. 'Generator', 'Bus', 'Line')
        component_id: Unique ID for the new component
        params: Static/scalar input parameters
        time_series: Time-varying parameters as {attr: [values...]}
add_generatortool [Deprecated] Add a generator to a PyPSA model. Use add_component() instead.
[Deprecated] Add a generator to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        generator_id: The ID for the new generator
        bus: The bus ID to connect to
        p_nom: Nominal power capacity in MW
        p_nom_extendable: Whether capacity can be expanded
        capital_cost: Investment cost in currency/MW
        marginal_cost: Operational cost in currency/MWh
        carrier: Energy carrier (e.g., "wind", "solar")
        efficiency: Generator efficiency (0 to 1)
add_linetool [Deprecated] Add a transmission line to a PyPSA model. Use add_component() instead.
[Deprecated] Add a transmission line to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        line_id: The ID for the new line
        bus0: The ID of the first bus
        bus1: The ID of the second bus
        x: Reactance in ohm
        r: Resistance in ohm
        s_nom: Nominal apparent power capacity in MVA
        s_nom_extendable: Whether capacity can be expanded
        capital_cost: Investment cost in currency/MW
        length: Line length in km
add_loadtool [Deprecated] Add a load to a PyPSA model. Use add_component() instead.
[Deprecated] Add a load to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        load_id: The ID for the new load
        bus: The bus ID to connect to
        p_set: Active power demand in MW
        q_set: Reactive power demand in MVAr
cluster_networktool Cluster a network spatially or temporally, storing result as a new model.
Cluster a network spatially or temporally, storing result as a new model.

    Args:
        model_id: Source model ID.
        domain: 'spatial' or 'temporal'.
        method: Clustering method. Spatial: 'kmeans', 'hac', 'greedy_modularity'.
                Temporal: 'resample', 'downsample', 'segment', 'snapshot_map'.
        output_model_id: ID to store the clustered network under.
        n_clusters: Number of clusters (spatial methods).
        bus_weightings: Optional bus weighting dict (spatial).
        line_length_factor: Line length factor (spatial kmeans).
        affinity: Affinity metric (spatial hac).
        linkage: Linkage method (spatial hac).
        with_time: Include time in spatial clustering.
        aggregate_generators_weighted: Weight generator aggregation.
        scale_link_capital_costs: Scale link capital costs.
        offset: Resample offset string, e.g. '3h' (temporal resample).
        stride: Downsample stride (temporal downsample).
        num_segments: Number of segments (temporal segment).
        solver: Solver for segmentation (temporal segment).
        snapshot_map: Snapshot mapping dict (temporal snapshot_map).

    Returns:
        Dict with clustering summary including input/output bus and snapshot counts.
configure_timetool Configure time snapshots, investment periods, scenarios, or risk preference.
Configure time snapshots, investment periods, scenarios, or risk preference.

    Args:
        model_id: The model to configure
        mode: One of 'snapshots', 'investment_periods', 'scenarios', 'risk_preference'
        snapshots: ISO datetime strings (mode='snapshots')
        weightings: Snapshot weightings dict (mode='snapshots')
        periods: Investment years e.g. [2025, 2030] (mode='investment_periods')
        scenarios: Scenario definition (mode='scenarios')
        alpha: CVaR confidence level (mode='risk_preference')
        omega: Weight on CVaR term 0-1 (mode='risk_preference')
create_energy_modeltool Create a new PyPSA energy model with the given ID.
Create a new PyPSA energy model with the given ID.

    Args:
        model_id: A unique identifier for the model
        name: A descriptive name for the model (defaults to model_id if not provided)
        override: Whether to override an existing model with the same ID
delete_modeltool Delete a PyPSA model by ID.
Delete a PyPSA model by ID.

    Args:
        model_id: The ID of the model to delete
describe_componenttool Describe the full input-parameter schema for a PyPSA component type.
Describe the full input-parameter schema for a PyPSA component type.

    Args:
        component_type: Component type name (e.g. 'Generator', 'Bus', or 'generators')
        include_defaults: Whether to include default values in the response
export_model_summarytool Export a comprehensive summary of the model.
Export a comprehensive summary of the model.

    Args:
        model_id: The ID of the model to export
get_statisticstool Get statistics from a solved PyPSA model.
Get statistics from a solved PyPSA model.

    Args:
        model_id: The model to query
        metric: Metric name or 'all'. One of: system_cost, capex, opex, fom,
                overnight_cost, installed_capacity, optimal_capacity,
                expanded_capacity, installed_capex, expanded_capex,
                capacity_factor, curtailment, energy_balance, supply,
                withdrawal, revenue, market_value, prices, transmission
        components: Filter to specific component types
        carrier: Filter by carrier name
        bus_carrier: Filter by bus carrier
        groupby: Aggregation grouping (e.g. 'carrier', 'bus')
        aggregate_across_components: Merge component types into one row per carrier
        nice_names: Use human-readable carrier names
        drop_zero: Omit zero-value rows
list_component_typestool List all available PyPSA component types with descriptions.
List all available PyPSA component types with descriptions.

    Returns the catalog of 13 user-facing component types. No model required.
list_modelstool List all currently available PyPSA models.
List all currently available PyPSA models.
network_iotool Perform I/O and network manipulation operations.
Perform I/O and network manipulation operations.

    Operations:
    - export_netcdf: Export network to NetCDF file (requires path)
    - export_csv: Export network to CSV folder (requires path)
    - import_netcdf: Import network from NetCDF file (requires path), stores as model_id
    - import_csv: Import network from CSV folder (requires path), stores as model_id
    - merge: Merge another network into this one (requires other_model_id, output_model_id)
    - copy: Copy this network (optionally subset by snapshots/buses), stores as output_model_id
    - consistency_check: Run consistency check on the network
query_componentstool Query components of a given type, optionally filtered.
Query components of a given type, optionally filtered.

    Args:
        model_id: The model to query
        component_type: Component type (e.g. 'Generator', 'Bus')
        filters: Optional {attr: value} dict to filter rows
remove_componenttool Remove a component from a model.
Remove a component from a model.

    Args:
        model_id: The model containing the component
        component_type: Component type (e.g. 'Generator', 'Bus')
        component_id: ID of the component to remove
run_optimizationtool [Deprecated] Run optimization. Use run_simulation(mode='optimize') instead.
[Deprecated] Run optimization. Use run_simulation(mode='optimize') instead.

    Args:
        model_id: The model ID
        solver_name: Solver to use
        formulation: Network formulation
        extra_functionality: Custom constraint code
run_powerflowtool [Deprecated] Run power flow. Use run_simulation(mode='pf') instead.
[Deprecated] Run power flow. Use run_simulation(mode='pf') instead.

    Args:
        model_id: The model ID
        snapshot: Specific snapshot to run for (optional)
set_snapshotstool [Deprecated] Set time snapshots. Use configure_time(mode='snapshots') instead.
[Deprecated] Set time snapshots. Use configure_time(mode='snapshots') instead.

    Args:
        model_id: The model ID
        snapshots: List of datetime strings
update_componenttool Update parameters of an existing component.
Update parameters of an existing component.

    Args:
        model_id: The model containing the component
        component_type: Component type (e.g. 'Generator', 'Bus')
        component_id: ID of the component to update
        params: Static/scalar parameters to update
        time_series: Time-varying parameters to update as {attr: [values...]}

Text the model reads (22)

Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.

cluster_network tool
Cluster a network spatially or temporally, storing result as a new model.

    Args:
        model_id: Source model ID.
        domain: 'spatial' or 'temporal'.
        method: Clustering method. Spatial: 'kmeans', 'hac', 'greedy_modularity'.
                Temporal: 'resample', 'downsample', 'segment', 'snapshot_map'.
        output_model_id: ID to store the clustered network under.
        n_clusters: Number of clusters (spatial methods).
        bus_weightings: Optional bus weighting dict (spatial).
        line_length_factor: Line length factor (spatial kmeans).
        affinity: Affinity metric (spatial hac).
        linkage: Linkage method (spatial hac).
        with_time: Include time in spatial clustering.
        aggregate_generators_weighted: Weight generator aggregation.
        scale_link_capital_costs: Scale link capital costs.
        offset: Resample offset string, e.g. '3h' (temporal resample).
        stride: Downsample stride (temporal downsample).
        num_segments: Number of segments (temporal segment).
        solver: Solver for segmentation (temporal segment).
        snapshot_map: Snapshot mapping dict (temporal snapshot_map).

    Returns:
        Dict with clustering summary including input/output bus and snapshot counts.
add_component tool
Add any PyPSA component to a model.

    Args:
        model_id: The model to add the component to
        component_type: Component type (e.g. 'Generator', 'Bus', 'Line')
        component_id: Unique ID for the new component
        params: Static/scalar input parameters
        time_series: Time-varying parameters as {attr: [values...]}
update_component tool
Update parameters of an existing component.

    Args:
        model_id: The model containing the component
        component_type: Component type (e.g. 'Generator', 'Bus')
        component_id: ID of the component to update
        params: Static/scalar parameters to update
        time_series: Time-varying parameters to update as {attr: [values...]}
remove_component tool
Remove a component from a model.

    Args:
        model_id: The model containing the component
        component_type: Component type (e.g. 'Generator', 'Bus')
        component_id: ID of the component to remove
query_components tool
Query components of a given type, optionally filtered.

    Args:
        model_id: The model to query
        component_type: Component type (e.g. 'Generator', 'Bus')
        filters: Optional {attr: value} dict to filter rows
add_bus tool
[Deprecated] Add a bus to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        bus_id: The ID for the new bus
        v_nom: Nominal voltage in kV
        x: x-coordinate for plotting
        y: y-coordinate for plotting
        carrier: Energy carrier (e.g., "AC", "DC")
        country: Country code if applicable
add_generator tool
[Deprecated] Add a generator to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        generator_id: The ID for the new generator
        bus: The bus ID to connect to
        p_nom: Nominal power capacity in MW
        p_nom_extendable: Whether capacity can be expanded
        capital_cost: Investment cost in currency/MW
        marginal_cost: Operational cost in currency/MWh
        carrier: Energy carrier (e.g., "wind", "solar")
        efficiency: Generator efficiency (0 to 1)
add_load tool
[Deprecated] Add a load to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        load_id: The ID for the new load
        bus: The bus ID to connect to
        p_set: Active power demand in MW
        q_set: Reactive power demand in MVAr
add_line tool
[Deprecated] Add a transmission line to a PyPSA model. Use add_component() instead.

    Args:
        model_id: The ID of the model
        line_id: The ID for the new line
        bus0: The ID of the first bus
        bus1: The ID of the second bus
        x: Reactance in ohm
        r: Resistance in ohm
        s_nom: Nominal apparent power capacity in MVA
        s_nom_extendable: Whether capacity can be expanded
        capital_cost: Investment cost in currency/MW
        length: Line length in km
set_snapshots tool
[Deprecated] Set time snapshots. Use configure_time(mode='snapshots') instead.

    Args:
        model_id: The model ID
        snapshots: List of datetime strings
run_powerflow tool
[Deprecated] Run power flow. Use run_simulation(mode='pf') instead.

    Args:
        model_id: The model ID
        snapshot: Specific snapshot to run for (optional)
run_optimization tool
[Deprecated] Run optimization. Use run_simulation(mode='optimize') instead.

    Args:
        model_id: The model ID
        solver_name: Solver to use
        formulation: Network formulation
        extra_functionality: Custom constraint code
list_component_types tool
List all available PyPSA component types with descriptions.

    Returns the catalog of 13 user-facing component types. No model required.
describe_component tool
Describe the full input-parameter schema for a PyPSA component type.

    Args:
        component_type: Component type name (e.g. 'Generator', 'Bus', or 'generators')
        include_defaults: Whether to include default values in the response
network_io tool
Perform I/O and network manipulation operations.

    Operations:
    - export_netcdf: Export network to NetCDF file (requires path)
    - export_csv: Export network to CSV folder (requires path)
    - import_netcdf: Import network from NetCDF file (requires path), stores as model_id
    - import_csv: Import network from CSV folder (requires path), stores as model_id
    - merge: Merge another network into this one (requires other_model_id, output_model_id)
    - copy: Copy this network (optionally subset by snapshots/buses), stores as output_model_id
    - consistency_check: Run consistency check on the network
create_energy_model tool
Create a new PyPSA energy model with the given ID.

    Args:
        model_id: A unique identifier for the model
        name: A descriptive name for the model (defaults to model_id if not provided)
        override: Whether to override an existing model with the same ID
list_models tool
List all currently available PyPSA models.
delete_model tool
Delete a PyPSA model by ID.

    Args:
        model_id: The ID of the model to delete
export_model_summary tool
Export a comprehensive summary of the model.

    Args:
        model_id: The ID of the model to export
run_simulation tool
Run a simulation on a PyPSA network.

    Supports 8 modes: pf, lpf, optimize, mga, security_constrained,
    rolling_horizon, transmission_expansion_iterative, optimize_and_pf.
get_statistics tool
Get statistics from a solved PyPSA model.

    Args:
        model_id: The model to query
        metric: Metric name or 'all'. One of: system_cost, capex, opex, fom,
                overnight_cost, installed_capacity, optimal_capacity,
                expanded_capacity, installed_capex, expanded_capex,
                capacity_factor, curtailment, energy_balance, supply,
                withdrawal, revenue, market_value, prices, transmission
        components: Filter to specific component types
        carrier: Filter by carrier name
        bus_carrier: Filter by bus carrier
        groupby: Aggregation grouping (e.g. 'carrier', 'bus')
        aggregate_across_components: Merge component types into one row per carrier
        nice_names: Use human-readable carrier names
        drop_zero: Omit zero-value rows
configure_time tool
Configure time snapshots, investment periods, scenarios, or risk preference.

    Args:
        model_id: The model to configure
        mode: One of 'snapshots', 'investment_periods', 'scenarios', 'risk_preference'
        snapshots: ISO datetime strings (mode='snapshots')
        weightings: Snapshot weightings dict (mode='snapshots')
        periods: Investment years e.g. [2025, 2030] (mode='investment_periods')
        scenarios: Scenario definition (mode='scenarios')
        alpha: CVaR confidence level (mode='risk_preference')
        omega: Weight on CVaR term 0-1 (mode='risk_preference')

What we checked

The same checks run on every server. Each line below has one of these marks:

FoundA published issue such as a risky tool or a CVE
PassedWe ran the check on this server and found nothing
After reviewChecked; we publish it once a person verifies it
Partly tracedRan, but the scanner could not follow every path to its end
FactWhat the code does, not a judgement either way
Not checkedThe scanner had nothing to read for it, or it needs the live server
Code Safety10.0
  • 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injection
    Checked on every scan. Results in this category are published only after a person has verified them.
Capability Exposure9.2
  • Runs programs the caller chooses
    No tool runs a command or program the caller supplies — 22 tool handlers traced
  • Executes caller-supplied code
    1 finding the scanner could not decide; see the findings below
  • Reads or writes any file path
    No tool works on a file path the caller supplies without a root check — 22 tool handlers traced
  • Requests any address
    No tool sends a request to an address the caller supplies — 22 tool handlers traced
  • Runs caller-supplied SQL
    No tool executes a query the caller supplies — 22 tool handlers traced
  • Tools that start processes
    Not seen in the traced code of 22 capabilities; 22 more call code the scanner could not follow, where it may happen
  • Tools that touch files
    Not seen in the traced code of 22 capabilities; 22 more call code the scanner could not follow, where it may happen
  • Tools that call the network
    Not seen in the traced code of 22 capabilities; 22 more call code the scanner could not follow, where it may happen
Where the code is: 22 handlers in 10 files at commit b771396ec065
Prompt Integrity10.0
  • 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrity
    Checked on every scan. Results in this category are published only after a person has verified them.
Supply Chainnot checked
  • Dependency manifests
    1 manifest: pyproject.toml
  • Lockfiles checked against OSV
    Nothing could be resolved to exact versions; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
  • MCP SDK version
    fastmcp >=2.2.0
Secrets & Credentials10.0
  • 3 checks: credential harvesting, undeclared credential access, credentials sent over the network
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tools that read credentials
    Not seen in the traced code of 22 capabilities; 22 more call code the scanner could not follow, where it may happen
  • Authentication declared
    Not checked: needs the live server's tools/list (a remote server declares how clients authenticate)
Behavior Transparency10.0
  • 3 checks: undeclared network access, undeclared file access, undeclared process execution
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tool descriptions present
    Every tool has a description the model and the user can read
  • Statically known names
    Every tool's name could be read from the code
  • Input schemas
    Not checked: needs the live server's tools/list (every tool declares an input schema)
  • Destructive tools annotated
    Not checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)

Dependencies with known vulnerabilities (0 in production)

Dependency ranges were not resolved against a lockfile, so the score is capped at 7.

No known vulnerabilities in the production dependencies that could be checked.

Past security advisories

Vulnerabilities published for this server itself, from the GitHub Advisory Database.

No security advisories have been published for this server in the GitHub Advisory Database.

How it runs

Where it runsOn your machine, started by your MCP client from this repository or its package
Transportnot stated in the code the scanner read; most local servers talk over stdio
Sign-innot checked needs the live server
MCP SDKfastmcp >=2.2.0
Servers in the code1 (pypsa-mcp)

The project's own security

Security policynone no SECURITY.md in the repository: report issues privately through GitHub if it is enabled
Past advisoriesnone in the GitHub Advisory Database
Last push2026-03-20
Signed releasesnot checked yet

Where it is published

Listed in3 catalogs (github_search, glama, mcp_toplist)
LicenseMIT
Created2025-04-22

Attack map

How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.

Request a scan or an audit

Tell us about your server. We reply within 5 working days.

What do you need? *

We use these details only to answer you.