# 🚀 Google Scholar MCP Setup Guide
This guide will help you set up the Google Scholar MCP Server for use with MCP clients like Claude Desktop.
## Prerequisites
- Python 3.8+ installed
- pip package manager
- An MCP client (like Claude Desktop)
## Installation Steps
### 1. Clone the Repository
```bash
git clone https://github.com/yourusername/google-scholar-mcp.git
cd google-scholar-mcp
```
### 2. Install Dependencies
```bash
pip install -r requirements.txt
```
### 3. Test the Installation
```bash
# Test basic functionality
python test_server.py
# Test query processing
python test_query_processor.py
```
### 4. Optional: Run Local Web Interface
```bash
python local_server.py
```
Then open your browser to `http://localhost:5000` to test the web interface.
## MCP Client Configuration
### Claude Desktop Configuration
1. **Find your config file location:**
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
- **Linux**: `~/.config/claude/claude_desktop_config.json`
2. **Add the server configuration:**
```json
{
"mcpServers": {
"google-scholar": {
"command": "python",
"args": ["/absolute/path/to/google-scholar-mcp/main.py"],
"cwd": "/absolute/path/to/google-scholar-mcp"
}
}
}
```
**Important:** Replace `/absolute/path/to/google-scholar-mcp` with the actual path to your project directory.
3. **Restart Claude Desktop** for the changes to take effect.
### Alternative: Using Python Virtual Environment
For better dependency management:
```bash
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Update Claude Desktop config to use virtual environment
{
"mcpServers": {
"google-scholar": {
"command": "/absolute/path/to/google-scholar-mcp/venv/bin/python",
"args": ["/absolute/path/to/google-scholar-mcp/main.py"],
"cwd": "/absolute/path/to/google-scholar-mcp"
}
}
}
```
## Usage Examples
Once configured, you can use these commands in Claude Desktop:
```
"Search for recent machine learning papers from 2023"
"Find papers by Geoffrey Hinton"
"Show me highly cited papers about quantum computing"
"What are the latest developments in computer vision?"
```
## Troubleshooting
### Common Issues
1. **Import Error**: Make sure all dependencies are installed with `pip install -r requirements.txt`
2. **Path Issues**: Use absolute paths in the Claude Desktop configuration
3. **Permission Issues**: Make sure Python has permission to execute the script
4. **Rate Limiting**: If you get blocked by Google Scholar, wait a few minutes and try again
### Debug Mode
To enable debug logging, create a `.env` file:
```bash
cp env.example .env
# Edit .env and set DEBUG=true
```
### Testing Configuration
Run this test to verify your setup:
```bash
# Test MCP server (this will run until you stop it with Ctrl+C)
python main.py
```
In another terminal:
```bash
# Test basic scraping
python -c "from main import GoogleScholarScraper; s = GoogleScholarScraper(); print(len(s.search_papers('test', 1)))"
```
## Getting Help
- Check the [README.md](README.md) for detailed documentation
- Run the test scripts to verify functionality
- Check the console output for error messages
- Open an issue on GitHub if you encounter problems
## Rate Limiting
This server implements respectful rate limiting:
- 5-second delays between requests
- Maximum 20 results per request
- Proper user-agent headers
Please use responsibly and respect Google Scholar's terms of service.
## Legal Notice
This tool is for educational and research purposes only. Please respect Google Scholar's terms of service and use responsibly.