File size: 3,007 Bytes
2279159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---

title: Psc Predict MCP Server
emoji: ☀️
colorFrom: yellow
colorTo: yellow
sdk: docker
app_port: 7860
pinned: false
license: mit
---


# Psc_Predict MCP Server



Perovskite Solar Cell Performance Prediction MCP Service



## Features



Predict 8 performance metrics from CIF crystal structure files:



| Metric | Description | Unit |

|--------|-------------|------|

| PCE | Power Conversion Efficiency | % |

| DFT Band Gap | DFT calculated band gap | eV |

| Energy Above Hull | Thermodynamic stability | eV/atom |

| Stability Retention | Stability retention percentage | % |

| Stability T80 | T80 lifetime | hours |

| Voc | Open-circuit voltage | V |

| Jsc | Short-circuit current density | mA/cm² |

| FF | Fill factor | - |



## Available Model Types



| Model | Description | Recommendation |

|-------|-------------|----------------|

| **XGBoost** | Gradient boosting ensemble | ⭐ Default & Recommended |

| **Random Forest** | Ensemble of decision trees | Good interpretability |

| **Neural Network** | 3-layer MLP (128-64-32) | Deep learning approach |



## MCP Connection



### SSE Connection Configuration



```json

{

  "mcpServers": {

    "psc-predict": {

      "url": "https://your-space.hf.space/sse"

    }

  }

}

```



### Available Tools (Simplified)



| Tool | Description | Parameters |

|------|-------------|------------|

| `predict_ensemble` | **Predict using ALL 3 models with ensemble statistics** | cif, targets |
| `parse_cif_features` | Parse CIF and extract features | cif |
| `get_model_info` | Get model information | - |
| `list_available_models` | List all available models | - |

### Ensemble Prediction (Autonomous Multi-Model)

The `predict_ensemble` tool automatically calls all three models and provides:
- Individual predictions from XGBoost, Random Forest, and Neural Network
- Ensemble statistics: mean, std, min, max, range
- Recommendation based on model performance benchmarks

Example response:
```json

{

  "results": {

    "pce": {

      "predictions": {"xgboost": 18.5, "random_forest": 17.8, "neural_network": 19.1},

      "ensemble": {"mean": 18.47, "std": 0.53, "range": 1.3},

      "recommendation": {"model": "xgboost", "value": 18.5}

    }

  }

}

```

## Input Example

```cif

data_CsPbI3

_cell_length_a   6.2894

_cell_length_b   6.2894

_cell_length_c   6.2894

_cell_angle_alpha   90.0

_cell_angle_beta   90.0

_cell_angle_gamma   90.0

_cell_volume   248.89

_chemical_formula_sum   'Cs1 Pb1 I3'

```

## Model Information

- **Model Types**: XGBoost (recommended), Random Forest, Neural Network
- **Input Features**: 93-dimensional (7 lattice parameters + 86 element fractions)
- **Training Data**: Perovskite solar cell database

## Local Development

```bash

# Install dependencies

pip install -r requirements.txt



# Run server

python server.py



# Or with Docker

docker build -t psc-predict .

docker run -p 7860:7860 psc-predict

```

## License

MIT