Labsco
MCPmed logo

STRING-MCP

โ˜… 3

from MCPmed

Interact with the STRING protein-protein interaction database API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

STRING-MCP

A comprehensive Python package for interacting with the STRING database API through a Model Context Protocol (MCP) bridge.

Claude config

  "mcpServers": {
    "string-mcp": {
      "command": "/path/to/python/env/bin/string-mcp-server",
      "env": {}
    }
  }
}

Features

  • Protein Identifier Mapping: Convert various protein identifiers to STRING IDs
  • Network Analysis: Retrieve protein-protein interaction networks
  • Functional Enrichment: Perform gene ontology and pathway enrichment analysis
  • Network Visualization: Generate network images in various formats
  • Interaction Partners: Find all interaction partners for proteins
  • Functional Annotations: Get detailed functional annotations
  • Protein Similarity: Calculate similarity scores between proteins
  • PPI Enrichment: Test for protein-protein interaction enrichment
  • MCP Integration: Full Model Context Protocol server implementation

API Methods

Core Methods

  • map_identifiers(): Map protein identifiers to STRING IDs
  • get_network_interactions(): Get network interaction data
  • get_network_image(): Generate network visualization images
  • get_interaction_partners(): Find all interaction partners
  • get_functional_enrichment(): Perform enrichment analysis
  • get_functional_annotation(): Get functional annotations
  • get_protein_similarity(): Calculate similarity scores
  • get_ppi_enrichment(): Test for PPI enrichment
  • get_version_info(): Get STRING database version

Configuration

The package uses a StringConfig class for configuration:

from stringmcp.main import StringConfig, StringDBBridge

config = StringConfig(
    base_url="https://string-db.org/api",
    version_url="https://version-12-0.string-db.org/api",
    caller_identity="my_app",
    request_delay=1.0  # Delay between requests in seconds
)

bridge = StringDBBridge(config)

Output Formats

The package supports multiple output formats:

  • JSON: Structured data (default)
  • TSV: Tab-separated values
  • XML: XML format
  • IMAGE: Network visualization images
  • SVG: Scalable vector graphics
  • PSI_MI: PSI-MI format

Species Support

The package supports all species available in STRING. Common species IDs:

  • Human: 9606
  • Mouse: 10090
  • Rat: 10116
  • Yeast: 4932
  • E. coli: 511145

Development

Setup Development Environment

# Install in development mode with dev dependencies
pip install -e .[dev]

# Format code
black stringmcp/

# Type checking
mypy stringmcp/

# Lint code
flake8 stringmcp/

Note: Test files are not currently included in this repository. To add tests, create a tests/ directory and add test files following the pytest configuration in pyproject.toml.

Project Structure

STRINGmcp/
โ”œโ”€โ”€ pyproject.toml          # Package configuration and dependencies
โ”œโ”€โ”€ README.md              # This file
โ”œโ”€โ”€ LICENSE                # MIT License
โ”œโ”€โ”€ .gitignore             # Git ignore patterns
โ”œโ”€โ”€ stringmcp/             # Main package
โ”‚   โ”œโ”€โ”€ __init__.py        # Package initialization
โ”‚   โ””โ”€โ”€ main.py            # Core STRING API bridge and MCP server
โ””โ”€โ”€ string_mcp.egg-info/   # Package metadata (generated during install)
    โ”œโ”€โ”€ PKG-INFO           # Package information
    โ”œโ”€โ”€ SOURCES.txt        # Source files list
    โ”œโ”€โ”€ dependency_links.txt
    โ”œโ”€โ”€ entry_points.txt   # CLI entry points
    โ”œโ”€โ”€ requires.txt       # Dependencies
    โ””โ”€โ”€ top_level.txt      # Top-level package names

Support

For issues and questions, please use the GitHub issue tracker.