Skip to content

Commit 4f2ec39

Browse files
committed
rewrite to mcp tools
1 parent 789336b commit 4f2ec39

File tree

12 files changed

+3200
-2888
lines changed

12 files changed

+3200
-2888
lines changed

README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,36 @@ MCP is a protocol that bridges the gap between AI systems and specialized domain
2626

2727
## Available API Interfaces
2828

29-
This server provides dedicated API interfaces for different BioThings data types, leveraging the `biothings-typed-client` library. These interfaces are implemented using the following mixins:
30-
31-
- **Gene Interface**: `GeneRoutesMixin` (wraps `GeneClientAsync`)
32-
- **Variant Interface**: `VariantsRoutesMixin` (wraps `VariantClientAsync`)
33-
- **Chemical Interface**: `ChemRoutesMixin` (wraps `ChemClientAsync`)
34-
- **Taxon Interface**: `TaxonRoutesMixin` (wraps `TaxonClientAsync`)
29+
This server provides dedicated API interfaces for different BioThings data types, leveraging the `biothings-typed-client` library. These interfaces are implemented using the following tool handlers:
30+
31+
- **Gene Interface**: `GeneTools` (wraps `GeneClientAsync`)
32+
- **Variant Interface**: `VariantTools` (wraps `VariantClientAsync`)
33+
- **Chemical Interface**: `ChemTools` (wraps `ChemClientAsync`)
34+
- **Taxon Interface**: `TaxonTools` (wraps `TaxonClientAsync`)
35+
- **Download Interface**: `DownloadTools` (provides file download and sequence analysis capabilities)
36+
37+
## Local File Saving Features
38+
39+
The server includes local file saving capabilities through the `DownloadTools` interface, which provides:
40+
41+
### Download Tools
42+
- **`download_entrez_data`**: Download data from NCBI Entrez databases (returns content as string)
43+
- **`download_entrez_data_local`**: Download data from NCBI Entrez databases and save to local file
44+
- **`perform_pairwise_alignment`**: Perform pairwise sequence alignment (returns alignment results)
45+
- **`perform_pairwise_alignment_local`**: Perform pairwise sequence alignment and save results to local file
46+
47+
### Output Directory Management
48+
- **Default Location**: Files are saved to `biothings_output/` directory in the current working directory
49+
- **Custom Location**: Use `--output-dir` parameter to specify a custom output directory
50+
- **Automatic Creation**: Output directories are created automatically if they don't exist
51+
- **Unique Filenames**: Auto-generated filenames include UUID prefixes to avoid conflicts
52+
53+
### Supported File Formats
54+
- **FASTA**: `.fasta` extension for sequence data
55+
- **GenBank**: `.gb` extension for GenBank format data
56+
- **Alignment**: `.aln` extension for alignment results
57+
- **JSON**: `.json` extension for structured data
58+
- **Text**: `.txt` extension for general text data
3559

3660
## Quick Start
3761

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "biothings-mcp"
3-
version = "0.1.1"
3+
version = "0.1.3"
44
description = "MCP for Biothings"
55
readme = "README.md"
66
authors = [
@@ -9,11 +9,14 @@ authors = [
99
requires-python = ">=3.10"
1010
dependencies = [
1111
"biopython>=1.85",
12-
"biothings-typed-client>=0.0.5",
12+
"biothings-typed-client>=0.0.7",
1313
"eliot>=1.17.5",
1414
"pycomfort>=0.0.18",
15-
"fastmcp>=2.6.1",
16-
"fastapi>=0.115.12",
15+
"fastmcp>=2.10.2",
16+
"aiosqlite>=0.21.0",
17+
"sqlite-utils>=3.38",
18+
"huggingface-hub>=0.33.2",
19+
"typer>=0.16.0",
1720
]
1821

1922
[project.scripts]
@@ -35,6 +38,6 @@ exclude = [
3538

3639
[dependency-groups]
3740
dev = [
38-
"pytest>=8.3.5",
39-
"pytest-asyncio>=0.26.0",
41+
"pytest>=8.4.1",
42+
"pytest-asyncio>=1.0.0",
4043
]

server.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/biothings_mcp/biothings_api.py

Lines changed: 637 additions & 1060 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)