npm package: @surendirakrishna/medrxiv-mcp-server
Description: An MCP server for searching and retrieving articles from medRxiv
Latest version: 0.1.0

# medRxiv MCP Server (Node.js/TypeScript Version)

🔍 Enable AI assistants to search and access medRxiv papers through a simple MCP interface.

The medRxiv MCP Server provides a bridge between AI assistants and medRxiv's preprint repository through the Model Context Protocol (MCP). It allows AI models to search for health sciences preprints and access their content in a programmatic way.

## ✨ Core Features
- 🔎 Paper Search: Query medRxiv papers with custom search strings or advanced search parameters ✅
- 🚀 Efficient Retrieval: Fast access to paper metadata ✅
- 📊 Metadata Access: Retrieve detailed metadata for specific papers using DOI ✅
- 📊 Research Support: Facilitate health sciences research and analysis ✅

## 🚀 Quick Start

### Prerequisites
- Node.js 18 or higher
- npm or npx

### Installing via npx (Recommended)

You can run the server directly using npx without installation:

```bash
npx @medrxiv/mcp-server
```

### Installing Globally

```bash
npm install -g @medrxiv/mcp-server
medrxiv-mcp-server
```

### Installing Locally for Development

```bash
# Clone the repository
git clone https://github.com/YourUsername/medRxiv-MCP-Server.git
cd medRxiv-MCP-Server

# Install dependencies
npm install

# Build the project
npm run build

# Run the server
npm start

# Or run in development mode
npm run dev
```

## 📊 Configuration

### For Claude Desktop

Add this to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "medrxiv": {
      "command": "npx",
      "args": ["@medrxiv/mcp-server"]
    }
  }
}
```

Or if installed globally:

```json
{
  "mcpServers": {
    "medrxiv": {
      "command": "medrxiv-mcp-server"
    }
  }
}
```

### For Cursor

Add to Cursor's MCP settings (`Settings → Cursor Settings → MCP`):

```json
{
  "medrxiv": {
    "command": "npx",
    "args": ["@medrxiv/mcp-server"]
  }
}
```

### For Windsurf, Cline, or other MCP clients

Configure similarly using the npx command or the global binary.

## 🔧 Available Tools

### 1. search_medrxiv_key_words

Search for articles using keywords.

**Parameters:**
- `key_words` (string, required): Search query string
- `num_results` (number, optional): Number of results to return (default: 10)

**Example:**
```typescript
{
  "key_words": "COVID-19 vaccine efficacy",
  "num_results": 5
}
```

### 2. search_medrxiv_advanced

Perform an advanced search with multiple parameters.

**Parameters:**
- `term` (string, optional): General search term
- `title` (string, optional): Search in title
- `author1` (string, optional): First author
- `author2` (string, optional): Second author
- `abstract_title` (string, optional): Search in abstract and title
- `text_abstract_title` (string, optional): Search in full text, abstract, and title
- `section` (string, optional): Section of medRxiv
- `start_date` (string, optional): Start date for search range (YYYY-MM-DD)
- `end_date` (string, optional): End date for search range (YYYY-MM-DD)
- `num_results` (number, optional): Number of results to return (default: 10)

**Example:**
```typescript
{
  "term": "COVID-19",
  "author1": "MacLachlan",
  "start_date": "2020-01-01",
  "end_date": "2023-12-31",
  "num_results": 3
}
```

### 3. get_medrxiv_metadata

Fetch metadata for a specific article using its DOI.

**Parameters:**
- `doi` (string, required): DOI of the article

**Example:**
```typescript
{
  "doi": "10.1101/2021.12.20.21268134"
}
```

## 📝 Usage Examples

Once configured with your MCP client, you can ask your AI assistant:

- "Search medRxiv for papers about COVID-19 vaccine efficacy"
- "Find recent papers by Dr. Smith on cancer research"
- "Get metadata for DOI 10.1101/2021.12.20.21268134"
- "Search for papers about machine learning in medical imaging published in 2023"

## 🛠️ Development

### Project Structure

```
medRxiv-MCP-Server/
├── src/
│   ├── index.ts                 # Main server entry point
│   └── medrxiv-web-search.ts   # Search and scraping functions
├── dist/                        # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README-NPX.md
```

### Building

```bash
npm run build
```

### Running in Development Mode

```bash
npm run dev
```

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## 📄 License

MIT

## 🔗 Links

- [Model Context Protocol Documentation](https://modelcontextprotocol.io/)
- [medRxiv Website](https://www.medrxiv.org/)
- [medRxiv API Documentation](https://api.medrxiv.org/)

## ⚠️ Notes

- This server scrapes the medRxiv website and uses their public API. Please use responsibly and respect their terms of service.
- Rate limiting may apply for extensive searches.
- The server requires an internet connection to function.