Skip to content

Latest commit

 

History

History

sdk

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Modulector SDK

Typed Python SDK for the Modulector API. The package contains client helpers for querying predicted and experimentally validated miRNA target interactions, miRNA aliases, methylation sites, disease associations, drug associations, and PubMed subscriptions without installing the Django backend dependencies.

Installation

pip install modulector-sdk

Usage

from modulector_sdk import (
    get_mirna_details,
    get_mirna_target_interactions,
    get_mirna_target_validations,
)

details = get_mirna_details("hsa-miR-21-5p")
interactions = get_mirna_target_interactions(
    mirna="hsa-miR-21-5p",
    gene="PTEN",
    include_pubmeds=True,
)
validations = get_mirna_target_validations(
    mirna="hsa-miR-122-5p",
    target="SLC7A1",
    experiment="Western blot",
)

Set MODULECTOR_API_BASE_URL to target a different Modulector deployment:

MODULECTOR_API_BASE_URL=https://your-modulector.example.org python script.py

Every service function also accepts a base_url keyword argument for per-request overrides.

MCP server

The SDK also installs a Model Context Protocol server that exposes the same service functions as LLM-callable tools.

For local stdio MCP clients:

modulector-mcp

Example client configuration:

{
  "mcpServers": {
    "modulector": {
      "command": "modulector-mcp"
    }
  }
}

For Streamable HTTP clients:

modulector-mcp --transport streamable-http --host 127.0.0.1 --port 8000

Then connect the client to http://127.0.0.1:8000/mcp.

The server includes tools for predicted and experimentally validated miRNA target interactions, miRNA details and aliases, miRNA identifier resolution, methylation site lookup and annotation, disease associations, drug associations, and PubMed news subscriptions. Use MODULECTOR_API_BASE_URL or each tool's base_url argument to target a custom Modulector deployment.

When deployed with the root Docker Compose stack, nginx proxies the MCP Streamable HTTP endpoint at https://<mydomain.com>/mcp.

Development

Build this SDK from the sdk/ directory:

uv build

The generated source distribution and wheel are written to sdk/dist/.