MCP integration¶
aiida-mcp is a
Model Context Protocol server that lets an MCP
client, such as an AI assistant, inspect an AiiDA database and submit calculations.
aiida-cif2j ships its own integration module, aiida_cif2j.mcp, which exposes
two pairs of tools.
Installing the optional mcp extra:
pip install "aiida-cif2j[mcp]"
pulls in aiida-mcp and registers aiida_cif2j.mcp under its aiida_mcp.plugins
entry point group. Any aiida-mcp server running in the same environment then
automatically exposes describe_cif2j_calcjob and submit_cif2j_job. The second
pair, describe_wannier_tb2j_workflow and submit_wannier_tb2j_workflow, are only
registered if aiida-wannier90-workflows and aiida-quantumespresso are also
installed (see submit_wannier_tb2j_workflow) — these are not published on PyPI,
so having the mcp extra installed does not by itself guarantee those two tools are
present; call rescan_plugins on the aiida-mcp server after installing them if the
server was already running.
submit_cif2j_job¶
The low-level TB2J step. It reads an existing Wannier90 calculation’s retrieved output
folder directly, so it is only useful once that Wannier90 calculation has already run.
For the full pipeline from a structure file, use submit_wannier_tb2j_workflow
instead.
Argument |
Meaning |
|---|---|
|
Label (e.g. |
|
Magnetic elements for which the exchange interaction is considered. |
|
TB2J command-line parameters as a dict of parameters (must include |
|
The structure, as a path, text, or PK of a |
|
If true, read atomic positions from the Wannier90 |
|
PK of the |
|
PK of the |
|
PK of the |
|
Machines to run on. Default 1. |
|
MPI processes per machine. Default 1. |
|
Optional label to set on the calcjob node. |
|
Optional description to set on the calcjob node. |
Example arguments:
{
"code": "tb2j@localhost",
"elements": ["Fe"],
"parameters": {"parameters": {"efermi": 0.0}},
"structure": {"pk": 123},
"wannier_folder": 456
}
The inputs are checked against the calcjob definition before anything is stored — a bad
input returns an error and creates no nodes. On success the tool returns the process PK
and the PKs of the input nodes; follow the job with aiida-mcp’s get_process and
get_process_report tools.
submit_wannier_tb2j_workflow¶
The full pipeline: Quantum ESPRESSO SCF/NSCF, Wannierisation, and TB2J in one go,
starting from a structure file. Wraps
WannierTB2JWorkChain.get_builder_from_protocol — see Introduction for
installing its optional aiida-wannier90/aiida-wannier90-workflows
dependencies.
Argument |
Meaning |
|---|---|
|
Code label or PK for each step, keyed by |
|
The input structure, as a path, text, or PK of a |
|
The pseudopotential family to use for the Wannier90/QE steps. |
|
The protocol to use for the underlying Wannier90BandsWorkChain. |
|
One of |
|
One of |
|
One of |
|
Whether to run |
|
Elements for which the exchange interaction is considered. If not given, auto-detected from the resolved structure at runtime. |
|
TB2J command-line parameters (the |
|
|
|
Optional label to set on the workflow node. |
|
Optional description to set on the workflow node. |
Example arguments:
{
"codes": {
"pw": "qe-pw@localhost",
"pw2wannier90": "qe-pw2wannier90@localhost",
"wannier90": "wannier90@localhost",
"tb2j": "tb2j@localhost"
},
"structure": {"path": "/data/structure.mcif"},
"pseudo_family": "SSSP/1.3/PBE/efficiency"
}
Magnetic elements and the Fermi energy are auto-detected unless given explicitly. The
tool returns the process PK, the structure node’s PK, and daemon state; follow the job
with get_process and get_process_report.