Content
# 🐋 serpapi_mcp
> Custom SerpAPI MCP Server — Enable Google Scholar Search for AI Assistants
[](https://opensource.org/licenses/MIT)
---
## ✨ Features
| Tool | Function | Support |
|------|------|:--:|
| `search_google_scholar` | Google Scholar Search | Chinese/English keywords, PDF links, citation counts |
| `search_google` | Google General Search | Page titles, links, summaries |
---
## 📦 Installation
### 1. Clone the Project
```bash
git clone https://github.com/Yotsuki2213/serpapi_mcp.git
cd serpapi_mcp
```
### 2. Install Dependencies
```bash
pip install -r requirements.txt
```
### 3. Get SerpAPI Key
Go to [serpapi.com](https://serpapi.com) and register (free 100 requests/month)
Copy your API Key from the Dashboard.
---
## ⚙️ Configure MCP Client
### Cherry Studio
**Settings → MCP Management → Edit as JSON**, add:
```json
{
"mcpServers": {
"serpapi-custom": {
"type": "stdio",
"command": "python",
"args": ["download_path\\serpapi_mcp\\serpapi_mcp_server.py"],
"env": {
"SERPAPI_API_KEY": "Your SerpAPI Key"
}
}
}
}
```
Replace `download_path` with the actual path, e.g., `C:\\Users\\YourUsername\\serpapi_mcp`
### Claude Desktop
Edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"serpapi-custom": {
"command": "python",
"args": ["/path/to/serpapi_mcp/serpapi_mcp_server.py"],
"env": {
"SERPAPI_API_KEY": "Your SerpAPI Key"
}
}
}
}
```
---
## 🧪 Testing
### Terminal Testing
```bash
# Windows CMD
set SERPAPI_API_KEY=YourKey
python serpapi_mcp_server.py
# Mac / Linux
export SERPAPI_API_KEY=YourKey
python serpapi_mcp_server.py
```
No errors indicate success (Ctrl+C to exit).
### Test in Cherry Studio
Create a new conversation, input:
> Search Google Scholar: Cai Jinhua China National Metrology Institute
If it returns a list of papers, it's successful.
---
## 🛠 Tool Details
### `search_google_scholar` — Google Scholar Search
| Parameter | Type | Required | Description |
|------|------|:--:|------|
| `query` | string | Yes | Search keywords, supports Chinese |
| `num_results` | integer | No | Number of results, default 10 |
| `language` | string | No | `zh-cn` or `en`, default `zh-cn` |
Returns: title, author, abstract (first 300 characters), citation count, PDF link.
### `search_google` — Google General Search
| Parameter | Type | Required | Description |
|------|------|:--:|------|
| `query` | string | Yes | Search keywords |
| `num_results` | integer | No | Number of results, default 10 |
Returns: page title, link, summary (first 200 characters).
---
## ❓ Frequently Asked Questions
| Issue | Solution |
|------|------|
| MCP connection failed | Check Python path, dependencies installed, API Key correct |
| No search results | Check API Key quota (free 100 requests/month) |
| Chinese character encoding issues | Ensure script file encoding is UTF-8 |
| `ModuleNotFoundError: mcp` | `pip install mcp` |
---
## 📄 License
MIT © Yotsuki2213
---
> 🐋 Open an issue if you have any questions!