Labsco
jpoles1 logo

StatPearls

โ˜… 1

from jpoles1

Fetches peer-reviewed medical and disease information from StatPearls.

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

StatPearls MCP Server

smithery badge

A Model Context Protocol (MCP) server that fetches disease information from StatPearls, a trusted source of peer-reviewed medical content.

Give your AI system a relaible source of medical knowledge for its next conversation.

Features

  • Searches for diseases and medical conditions on StatPearls
  • Retrieve comprehensive, reliable medical information from StatPearls
  • Convert HTML content to well-formatted Markdown to make it AI-friendly
  • Integrates with AI models via the Model Context Protocol

Image

If you don't already have a Model Context Protocol (MCP) client:

If you are a casual user, you can use Claude Desktop to get started using MCP servers. It is a free and open-source desktop application that allows you to run MCP servers locally and connect to them.

If you are a power user/developer, I recommend using VSCode with the RooCode extension which enables you to connect in MCP servers to your development environment for infinite possibilities!

Tool Definition

The server provides a single tool:

  • statpearls_disease_info: Fetches comprehensive, reliable medical information about diseases from StatPearls.

Input Schema

{
  "query": "diabetes",
  "format_options": {
    "includeToc": true,
    "maxLength": 50000
  }
}
  • query: Disease or medical condition to search for (required)
  • format_options: Optional formatting preferences
    • includeToc: Whether to include a table of contents (default: true)
    • maxLength: Maximum length of the returned content in characters (default: 50000)

Example Output

The tool returns formatted Markdown content with:

  • Title and source information
  • Table of contents (optional)
  • Structured sections including etiology, epidemiology, pathophysiology, clinical features, diagnosis, treatment, and prognosis (when available)

Development

Project Structure

statpearls-mcp/
โ”œโ”€โ”€ src/                         # Source code
โ”‚   โ”œโ”€โ”€ index.ts                 # Main entry point and server setup
โ”‚   โ”œโ”€โ”€ test-html-parser.ts      # Test utility for HTML parser
โ”‚   โ”œโ”€โ”€ test-statpearls-parser.ts # Test utility for StatPearls parser
โ”‚   โ”œโ”€โ”€ testrun.ts               # Test runner utility
โ”‚   โ”œโ”€โ”€ tools/                   # Tool definitions and handlers
โ”‚   โ”‚   โ””โ”€โ”€ statpearls.ts        # StatPearls tool definition and handler
โ”‚   โ”œโ”€โ”€ services/                # Core functionality services
โ”‚   โ”‚   โ”œโ”€โ”€ search.ts            # Search functionality
โ”‚   โ”‚   โ”œโ”€โ”€ content.ts           # Content retrieval and processing
โ”‚   โ”‚   โ””โ”€โ”€ markdown.ts          # HTML to Markdown conversion
โ”‚   โ”œโ”€โ”€ types/                   # Type definitions
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts             # Common type definitions
โ”‚   โ”‚   โ””โ”€โ”€ statpearls.ts        # StatPearls-specific type definitions
โ”‚   โ””โ”€โ”€ utils/                   # Utility functions
โ”‚       โ”œโ”€โ”€ html.ts              # HTML parsing utilities
โ”‚       โ”œโ”€โ”€ error.ts             # Error handling utilities
โ”‚       โ””โ”€โ”€ statpearls-parser.ts # StatPearls content parsing utilities
โ”œโ”€โ”€ scripts/                     # Build and utility scripts
โ”‚   โ”œโ”€โ”€ build.ts                 # Build script for creating Node.js compatible bundle
โ”‚   โ”œโ”€โ”€ compile.ts               # Script for compiling executables
โ”‚   โ”œโ”€โ”€ release.ts               # Script for handling releases
โ”‚   โ””โ”€โ”€ version.ts               # Script for managing versioning
โ”œโ”€โ”€ dist/                        # Build output directory (not in repository)
โ”œโ”€โ”€ package.json                 # Project configuration and dependencies
โ”œโ”€โ”€ tsconfig.json                # TypeScript configuration
โ”œโ”€โ”€ bun.lock                     # Bun dependency lock file
โ”œโ”€โ”€ README.md                    # Main project documentation
โ””โ”€โ”€ RELEASE-PROCESS.md           # Documentation for release process

Building and Releasing

Building

The build process creates a single JavaScript file that can run with vanilla Node.js:

# Production build
bun run build
# or
bun run build:prod

# Development build
bun run build:dev

This creates a bundled file at dist/index.js that includes all dependencies.

Compiling Executables

You can compile platform-specific executables using Bun's compilation feature:

# Compile for all platforms
bun run compile:all

# Compile for specific platforms
bun run compile:linux
bun run compile:windows
bun run compile:mac

This creates executable files in the dist directory:

  • statpearls-mcp (default executable)
  • statpearls-mcp-linux-x64 (Linux)
  • statpearls-mcp-windows-x64.exe (Windows)
  • statpearls-mcp-darwin-x64 (macOS)

Releasing

The release process handles versioning, building, compiling, and Git operations:

# Release a patch version (bug fixes)
bun run release:patch

# Release a minor version (new features, backward compatible)
bun run release:minor

# Release a major version (breaking changes)
bun run release:major

This process:

  1. Updates the version in package.json
  2. Builds the distribution file
  3. Compiles executables for all platforms
  4. Creates a Git commit with the version number
  5. Creates a Git tag for the version
  6. Pushes the commit and tag to GitHub

Versioning

The project follows semantic versioning. You can check the current version with:

bun run version