Skip to main content

MCP for Guide to Pharmacology database

Project description

pharmacology-mcp

Tests PyPI version Python 3.10+ License: MIT

MCP (Model Context Protocol) server for the Guide to PHARMACOLOGY database, providing access to pharmacological data including targets, ligands, and interactions.

This server implements the Model Context Protocol (MCP) for the Guide to PHARMACOLOGY, providing a standardized interface for accessing pharmacological data. MCP enables AI assistants and agents to access specialized pharmacological knowledge through structured interfaces to authoritative data sources.

The Guide to PHARMACOLOGY is an expert-curated database of drug targets and their ligands, providing comprehensive information about:

  • Targets: Pharmacological targets (receptors, enzymes, ion channels, etc.)
  • Ligands: Chemical compounds and drugs
  • Interactions: Target-ligand interactions with affinity data
  • Diseases: Disease associations
  • Families: Target family classifications

If you want to understand more about what the Model Context Protocol is and how to use it more efficiently, you can take the DeepLearning AI Course or search for MCP videos on YouTube.

About MCP (Model Context Protocol)

MCP is a protocol that bridges the gap between AI systems and specialized domain knowledge. It enables:

  • Structured Access: Direct connection to authoritative pharmacological data sources
  • Natural Language Queries: Simplified interaction with specialized databases
  • Type Safety: Strong typing and validation through FastMCP
  • AI Integration: Seamless integration with AI assistants and agents

Quick Start

Installing uv

# Download and install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Verify installation
uv --version
uvx --version

uvx is a very nice tool that can run a python package installing it if needed.

Running with uvx

You can run the pharmacology-mcp server directly using uvx without cloning the repository:

# Run the server in streamed http mode (default)
uvx pharmacology-mcp
Other uvx modes (STDIO, HTTP, SSE)

STDIO Mode (for MCP clients that require stdio, can be useful when you want to save files)

# Or explicitly specify stdio mode
uvx pharmacology-mcp stdio

HTTP Mode (Web Server)

# Run the server in streamable HTTP mode on default (3001) port
uvx pharmacology-mcp server

# Run on a specific port
uvx pharmacology-mcp server --port 8000

SSE Mode (Server-Sent Events)

# Run the server in SSE mode
uvx pharmacology-mcp sse

In cases when there are problems with uvx often they can be caused by cleaning uv cache:

uv cache clean

The HTTP mode will start a web server that you can access at http://localhost:3001/mcp (with documentation at http://localhost:3001/docs). The STDIO mode is designed for MCP clients that communicate via standard input/output, while SSE mode uses Server-Sent Events for real-time communication.

API Endpoints

The server provides REST API endpoints for:

  • Targets: Pharmacological targets (receptors, enzymes, ion channels, etc.)
  • Ligands: Chemical compounds and drugs
  • Interactions: Target-ligand interactions with affinity data
  • Diseases: Disease associations
  • Families: Target family classifications

Example API Usage

import httpx

# Search for GPCR targets
async with httpx.AsyncClient() as client:
    response = await client.post(
        "http://localhost:8000/targets",
        json={"type": "GPCR", "immuno": True}
    )
    targets = response.json()

# Get specific target information
async with httpx.AsyncClient() as client:
    response = await client.get("http://localhost:8000/targets/1")
    target = response.json()

# Search for approved drugs
async with httpx.AsyncClient() as client:
    response = await client.post(
        "http://localhost:8000/ligands",
        json={"approved": True, "type": "Synthetic organic"}
    )
    ligands = response.json()

Local File Tools

The server also provides MCP tools for saving search results to files:

  • search_targets_to_file: Search targets and save results
  • search_ligands_to_file: Search ligands and save results
  • get_target_interactions_to_file: Get target interactions and save
  • get_ligand_interactions_to_file: Get ligand interactions and save

Configuring your AI Client (Anthropic Claude Desktop, Cursor, Windsurf, etc.)

We provide preconfigured JSON files for different use cases:

  • For STDIO mode (recommended): Use mcp-config-stdio.json
  • For HTTP mode: Use mcp-config.json
  • For local development: Use mcp-config-stdio-debug.json

Inspecting Pharmacology MCP server

Using MCP Inspector to explore server capabilities

If you want to inspect the methods provided by the MCP server, use npx (you may need to install nodejs and npm):

For STDIO mode with uvx:

npx @modelcontextprotocol/inspector --config mcp-config-stdio.json --server pharmacology-mcp

For HTTP mode (ensure server is running first):

npx @modelcontextprotocol/inspector --config mcp-config.json --server pharmacology-mcp

For local development:

npx @modelcontextprotocol/inspector --config mcp-config-stdio-debug.json --server pharmacology-mcp

You can also run the inspector manually and configure it through the interface:

npx @modelcontextprotocol/inspector

After that you can explore the tools and resources with MCP Inspector at http://127.0.0.1:6274

Integration with AI Systems

Simply point your AI client (like Cursor, Windsurf, ClaudeDesktop, VS Code with Copilot, or others) to use the appropriate configuration file from the repository.

Repository setup

# Clone the repository
git clone https://github.com/antonkulaga/pharmacology-mcp.git
cd pharmacology-mcp
uv sync

Running the MCP Server

If you already cloned the repo you can run the server with uv:

# Start the MCP server locally (HTTP mode)
uv run server

# Or start in STDIO mode  
uv run stdio

# Or start in SSE mode
uv run sse

Testing & Verification

Run tests for the MCP server:

uv run pytest -vvv -s

You can use MCP inspector with locally built MCP server same way as with uvx.

Note: Using the MCP Inspector is optional. Most MCP clients (like Cursor, Windsurf, etc.) will automatically display the available tools from this server once configured. However, the Inspector can be useful for detailed testing and exploration.

If you choose to use the Inspector via npx, ensure you have Node.js and npm installed. Using nvm (Node Version Manager) is recommended for managing Node.js versions.

API Documentation

When the server is running, you can access:

Data Source

This server provides access to data from the Guide to PHARMACOLOGY, an expert-curated database of drug targets and their ligands.

License

This project is licensed under the MIT License.

  • Database: Open Data Commons Open Database License (ODbL)
  • Contents: Creative Commons Attribution-ShareAlike 4.0 International License

Citations

If you use this server in your research, please cite:

Armstrong JF, Faccenda E, Harding SD, Pawson AJ, Southan C, Sharman JL, Campo B, Cavanagh DR, Alexander SPH, Davenport AP, Spedding M, Davies JA; NC-IUPHAR. (2020) The IUPHAR/BPS Guide to PHARMACOLOGY in 2020: extending immunopharmacology content and introducing the IUPHAR/MMV Guide to MALARIA PHARMACOLOGY. Nucleic Acids Research 48: D1006-D1021.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

This project is part of the Longevity Genie organization, which develops open-source AI assistants and libraries for health, genetics, and longevity research.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pharmacology_mcp-0.1.2.tar.gz (173.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pharmacology_mcp-0.1.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file pharmacology_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: pharmacology_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 173.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for pharmacology_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 59c871b0671fe146731f2e33706b1eac23b34c9b7b25366bd8ebaa111fd88514
MD5 76ef8a746511d9cd3ce30032007b6d94
BLAKE2b-256 fba8669e0d081fffe5057d78679dbdb0133c510a453b0cc14516ba10a8bf93fb

See more details on using hashes here.

File details

Details for the file pharmacology_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pharmacology_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c511e709e7c7a0acc9580cac8054417bfa4eeb80d45c7a0dc71ffaa96db9d54b
MD5 30b029c7cbb2edc0ea750d70b2500262
BLAKE2b-256 96b4db86df79722c2d7147332cba3885d82f0bb07a96bcf30ec5fe1864091df0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page