Spaces:
Running
Running
update
Browse files
README.md
CHANGED
|
@@ -13,31 +13,31 @@ short_description: MCP server for the PolyOmics polymer materials database
|
|
| 13 |
|
| 14 |
# PolyOmics MCP Server
|
| 15 |
|
| 16 |
-
[PolyOmics dataset](https://huggingface.co/datasets/yhayashi1986/PolyOmics)
|
| 17 |
-
100,000
|
| 18 |
|
| 19 |
-
##
|
| 20 |
|
| 21 |
-
|
|
| 22 |
-
|--------
|
| 23 |
-
| `get_database_info` |
|
| 24 |
-
| `search_polymers_by_smiles` | SMILES
|
| 25 |
-
| `get_polymer_by_id` |
|
| 26 |
-
| `query_polymers_by_property` |
|
| 27 |
-
| `filter_by_polymer_class` |
|
| 28 |
-
| `get_chi_parameter` |
|
| 29 |
-
| `get_chi_parameters_for_polymer` |
|
| 30 |
|
| 31 |
-
## Claude Desktop
|
| 32 |
|
| 33 |
-
`claude_desktop_config.json`
|
| 34 |
|
| 35 |
```json
|
| 36 |
{
|
| 37 |
"mcpServers": {
|
| 38 |
"polyomics": {
|
| 39 |
"type": "sse",
|
| 40 |
-
"url": "https://<your-username>-polyomics-mcp.hf.space/
|
| 41 |
"headers": {
|
| 42 |
"Authorization": "Bearer <your-hf-token>"
|
| 43 |
}
|
|
@@ -46,11 +46,11 @@ short_description: MCP server for the PolyOmics polymer materials database
|
|
| 46 |
}
|
| 47 |
```
|
| 48 |
|
| 49 |
-
> **Note:** `<your-username>`
|
| 50 |
-
> HF
|
| 51 |
|
| 52 |
-
##
|
| 53 |
|
| 54 |
-
- **
|
| 55 |
-
- **
|
| 56 |
-
- **
|
|
|
|
| 13 |
|
| 14 |
# PolyOmics MCP Server
|
| 15 |
|
| 16 |
+
MCP server for the [PolyOmics dataset](https://huggingface.co/datasets/yhayashi1986/PolyOmics).
|
| 17 |
+
Query physical property data for 100,000+ polymer materials from Claude and other MCP clients.
|
| 18 |
|
| 19 |
+
## Available Tools
|
| 20 |
|
| 21 |
+
| Tool | Description |
|
| 22 |
+
|------|-------------|
|
| 23 |
+
| `get_database_info` | Get overview statistics of the database |
|
| 24 |
+
| `search_polymers_by_smiles` | Search polymers by SMILES fragment |
|
| 25 |
+
| `get_polymer_by_id` | Get all properties for a polymer by monomer ID |
|
| 26 |
+
| `query_polymers_by_property` | Filter polymers by property value range |
|
| 27 |
+
| `filter_by_polymer_class` | Filter by polymer class (PEST, PAMD, etc.) |
|
| 28 |
+
| `get_chi_parameter` | Get Flory-Huggins χ parameter for a specific solvent |
|
| 29 |
+
| `get_chi_parameters_for_polymer` | Get χ parameters for all solvents at once |
|
| 30 |
|
| 31 |
+
## Connecting from Claude Desktop
|
| 32 |
|
| 33 |
+
Add the following to `claude_desktop_config.json`:
|
| 34 |
|
| 35 |
```json
|
| 36 |
{
|
| 37 |
"mcpServers": {
|
| 38 |
"polyomics": {
|
| 39 |
"type": "sse",
|
| 40 |
+
"url": "https://<your-username>-polyomics-mcp-server.hf.space/mcp/sse",
|
| 41 |
"headers": {
|
| 42 |
"Authorization": "Bearer <your-hf-token>"
|
| 43 |
}
|
|
|
|
| 46 |
}
|
| 47 |
```
|
| 48 |
|
| 49 |
+
> **Note:** Replace `<your-username>` and `<your-hf-token>` with your actual values.
|
| 50 |
+
> Generate an HF token at [Settings > Access Tokens](https://huggingface.co/settings/tokens) (`read` permission is sufficient).
|
| 51 |
|
| 52 |
+
## Data Source
|
| 53 |
|
| 54 |
+
- **Dataset:** [yhayashi1986/PolyOmics](https://huggingface.co/datasets/yhayashi1986/PolyOmics)
|
| 55 |
+
- **License:** CC-BY 4.0
|
| 56 |
+
- **Paper:** arXiv:2511.11626
|
app.py
CHANGED
|
@@ -449,7 +449,7 @@ def build_demo() -> gr.Blocks:
|
|
| 449 |
"# PolyOmics MCP Server\n"
|
| 450 |
"Polymer property database with Flory-Huggins χ parameters.\n\n"
|
| 451 |
f"**Dataset:** [{DATASET_REPO}](https://huggingface.co/datasets/{DATASET_REPO})\n\n"
|
| 452 |
-
"**MCP endpoint:** `/mcp/sse`"
|
| 453 |
)
|
| 454 |
|
| 455 |
with gr.Tab("Database Info"):
|
|
@@ -502,10 +502,10 @@ def build_demo() -> gr.Blocks:
|
|
| 502 |
def build_app() -> GradioApp:
|
| 503 |
demo = build_demo()
|
| 504 |
|
| 505 |
-
# Gradio
|
| 506 |
app = GradioApp.create_app(demo, app_kwargs={"docs_url": "/docs"})
|
| 507 |
|
| 508 |
-
# MCP SSE
|
| 509 |
security = TransportSecuritySettings(enable_dns_rebinding_protection=False)
|
| 510 |
sse = SseServerTransport("/mcp/messages/", security_settings=security)
|
| 511 |
|
|
|
|
| 449 |
"# PolyOmics MCP Server\n"
|
| 450 |
"Polymer property database with Flory-Huggins χ parameters.\n\n"
|
| 451 |
f"**Dataset:** [{DATASET_REPO}](https://huggingface.co/datasets/{DATASET_REPO})\n\n"
|
| 452 |
+
"**MCP endpoint:** `https://mohnishi-polyomics-mcp-server.hf.space/mcp/sse`"
|
| 453 |
)
|
| 454 |
|
| 455 |
with gr.Tab("Database Info"):
|
|
|
|
| 502 |
def build_app() -> GradioApp:
|
| 503 |
demo = build_demo()
|
| 504 |
|
| 505 |
+
# Create the Gradio FastAPI app before calling launch()
|
| 506 |
app = GradioApp.create_app(demo, app_kwargs={"docs_url": "/docs"})
|
| 507 |
|
| 508 |
+
# Mount MCP SSE routes before uvicorn starts so they are registered at startup
|
| 509 |
security = TransportSecuritySettings(enable_dns_rebinding_protection=False)
|
| 510 |
sse = SseServerTransport("/mcp/messages/", security_settings=security)
|
| 511 |
|