PH

Pharos MCP Server: NCATS Targets, Drugs, Diseases

Explore the MCP server for Pharos (NCATS) to access target, drug, and disease data for drug discovery research.

Quick Install
npx -y @QuentinCody/pharos-mcp-server

Overview

The Pharos MCP Server implements a Model Context Protocol (MCP) front-end for the Pharos dataset (NCATS). It provides an HTTP API that exposes curated target, drug (compound), and disease metadata to developer tools, machine learning models, and discovery pipelines. By packaging Pharos data behind a simple, predictable API, the server makes it easy to fetch, search, and stream contextual information that can be used to enrich predictions, power UIs, or supply LLMs with up-to-date domain context.

This server is designed for developers who want a lightweight, local or containerized service that serves Pharos content in machine-friendly JSON. It is useful for reproducible research, sandboxed model evaluation, and integration into drug-discovery workflows where reliable programmatic access to target-drug-disease relationships is required.

Features

  • Implements a Model Context Protocol (MCP)-style HTTP interface for serving Pharos content
  • Endpoint groups for Targets, Drugs (compounds), and Diseases
  • Full-text and fielded search over the dataset
  • Single-record retrieval and bulk/filtered queries
  • JSON responses optimized for downstream model ingestion
  • Simple configuration via environment variables or command-line flags
  • Docker-friendly: run locally or in CI pipelines
  • CORS enabled for browser-based clients (configurable)

Installation / Configuration

Clone the repository and run the server locally, or use Docker. Replace with the GitHub URL: https://github.com/QuentinCody/pharos-mcp-server

Install from source (Node.js example)

git clone https://github.com/QuentinCody/pharos-mcp-server.git
cd pharos-mcp-server

# install dependencies
npm install

# start the server (default port 8080)
npm start
# or
node server.js

Run with Docker

# build the image
docker build -t pharos-mcp-server .

# run the container, mounting a local data directory
docker run -d \
  -p 8080:8080 \
  -e PORT=8080 \
  -e DATA_DIR=/data \
  -v "$(pwd)/data":/data \
  pharos-mcp-server

Configuration (environment variables)

PORT            - HTTP port to listen on (default: 8080)
DATA_DIR        - Directory containing Pharos JSON/DB files (default: ./data)
DATABASE_URL    - Optional DB connection string (if using external DB)
ENABLE_SEARCH   - Enable full-text search indexing (true/false)
CORS_ORIGINS    - Comma-separated list of allowed origins (default: *)
LOG_LEVEL       - Logging verbosity (info, debug, warn, error)

If your deployment uses a database (Postgres, SQLite), set DATABASE_URL accordingly and ensure the dataset is loaded or the server has migration tools to import Pharos data files.

Available Resources

The server exposes resource endpoints for programmatic access. Below is a representative set of endpoints — exact routes may vary slightly depending on configuration or version. Check the repository README or OpenAPI spec for the authoritative list.

EndpointMethodDescription
/mcp/manifestGETReturns MCP manifest / metadata about the server and available resources
/targetsGETList or query targets (filter/paginate)
/targets/:idGETRetrieve a single target by identifier
/drugsGETList or query drugs/compounds
/drugs/:idGETRetrieve a single drug by identifier
/diseasesGETList or query diseases/phenotypes
/diseases/:idGETRetrieve a single disease by identifier
/searchGET/POSTFull-text and fielded search across resources

Common query parameters:

  • q: free-text search string
  • limit, offset: pagination
  • fields: comma-separated fields to include
  • filter: simple field=value filters (implementation-dependent)

Example: get server manifest

curl http://localhost:8080/mcp/manifest

Example: fetch a target by id

curl http://localhost:8080/targets/TG000123

Example: perform a search

curl -G http://localhost:8080/search --data-urlencode "q=kinase BRAF" --data-urlencode "limit=10"

Responses are JSON objects containing resource metadata and links suitable for programmatic consumption.

Use Cases

  • Enriching LLM prompts with factual context

    • Fetch a target’s mechanism, associated diseases, and known compounds, then append that structured context to a prompt so an LLM can reason with evidence rather than hallucinating.
    • Example flow: /targets/:id -> /drugs?filter=target:TID -> /diseases?filter=target:TID
  • Integrating with drug-discovery dashboards

    • Drive UI panels that show a target’s druggability, known ligands, and disease associations. Use pagination and fields to reduce payload size for responsive interfaces.
  • Batch annotation and feature generation

    • Pipeline that reads a list of gene symbols, queries /targets, then derives features (target family, clinical-phase compounds, known side effects) for ML training.
  • Reproducible model evaluation

    • Pin a specific snapshot of Pharos data in DATA_DIR and run identical MCP queries across experiments to ensure consistent inputs for model comparisons.
  • Search-driven exploration and hypothesis generation

    • Use /search to find compounds or targets by text or property, then follow links to related records to surface new hypotheses for follow-up experiments.

Tips for Developers

  • Start by exploring /mcp/manifest to learn which fields and resources the instance exposes.
  • Use the fields parameter to request only the data you need — this reduces bandwidth and speeds up downstream processing.
  • If using the Docker image in production, mount a persistent volume for DATA_DIR so your dataset snapshots survive container restarts.
  • For large-scale batch jobs, prefer server-side bulk endpoints (if available) to avoid many small HTTP requests.

Repository and source

  • GitHub: https://github.com/QuentinCody/pharos-mcp-server

For exact API schema, data field names, and deployment options refer to the repository’s API documentation or OpenAPI/Swagger file.