
一个用TypeScript编写的Google Scholar的MCP服务器,支持可流式HTTP。
概览
一个模型上下文协议(MCP)服务器,通过可流式 HTTP 传输提供 Google Scholar 搜索功能。本项目演示如何利用自定义工具构建 MCP 服务器,并将其与 Google Gemini 等 AI 模型集成。 该项目由两个主要组成部分:- : 通过HTTP端点提供Google Scholar搜索工具 - : 与Google Gemini AI集成以处理查询和调用工具 服务器基于@modelcontextprotocol/SDK构建,实现: - :可流式HTTPServerTransport支持基于HTTP的通信 - :支持多条带有会话ID的同时连接 - :可扩展的工具注册和执行框架 - :全面的错误响应和日志记录 服务器目前提供一个主要工具: - :在Google Scholar中搜索学术论文和研究- :可配置的搜索参数(查询、筛选器等)
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,通过可流式 HTTP 传输提供 Google Scholar 搜索功能。本项目演示如何利用自定义工具构建 MCP 服务器,并将其与 Google Gemini 等 AI 模型集成。
概述
该项目由两个主要组成部分组成:
- MCP 服务器:通过 HTTP 端点提供 Google Scholar 搜索工具
- MCP 客户端:集成 Google Gemini AI 以处理查询和呼叫工具
建筑
MCP服务器实现
服务器使用 @modelcontextprotocol/sdk 构建,并实现:
- Transport:用于基于HTTP的可流式HTTPServerTransport通信
- 会话管理:支持多个同时连接的会话ID
- 工具系统:可扩展的工具注册与执行框架
- 错误处理:全面的错误响应和日志记录
可用工具
服务器目前提供一个主要工具:
search_google_scholar
- 描述:在谷歌学术中搜索学术论文和研究
- 参数:可配置的搜索参数(查询、筛选等)
- 返回:结构化搜索结果,附有论文细节
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google Scholar MCP Server
A Model Context Protocol (MCP) server that provides Google Scholar search capabilities through a streamable HTTP transport. This project demonstrates how to build an MCP server with custom tools and integrate it with AI models like Google’s Gemini.
Overview
This project consists of two main components:
- MCP Server: Provides Google Scholar search tools via HTTP endpoints
- MCP Client: Integrates with Google Gemini AI to process queries and call tools
Architecture
MCP Server Implementation
The server is built using the @modelcontextprotocol/sdk and implements:
- Transport: StreamableHTTPServerTransport for HTTP-based communication
- Session Management: Supports multiple simultaneous connections with session IDs
- Tool System: Extensible tool registration and execution framework
- Error Handling: Comprehensive error responses and logging
Available Tools
The server currently provides one main tool:
search_google_scholar
- Description: Search Google Scholar for academic papers and research
- Parameters: Configurable search parameters (query, filters, etc.)
- Returns: Structured search results with paper details
Transport Protocol
The server uses StreamableHTTPServerTransport which supports:
- HTTP POST: For sending requests and receiving responses
- HTTP GET: For establishing Server-Sent Events (SSE) streams
- Session Management: Persistent connections with unique session IDs
- Real-time Notifications: Streaming updates via SSE
Smithery
The server is now available in Smithery: Google Scholar Search Server
Installation
Installing via Smithery
To install google-scholar-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mochow13/google-scholar-mcp --client claude
- Clone the repository:
git clone
cd google-scholar-mcp
- Install and build:
cd server
npm install
npm run build
cd client
npm install
npm run build
Running the Server
- Start the MCP server:
cd server
node build/index.js
The server will start on port 3000 and provide the following endpoints:
POST /mcp- Main MCP communication endpointGET /mcp- SSE stream endpoint for real-time updates
Server Features
- Multi-session Support: Handle multiple clients simultaneously
- Graceful Shutdown: Proper cleanup on SIGINT
- Logging: Comprehensive request/response logging
- Error Handling: Structured JSON-RPC error responses
Running the Client
The client demonstrates how to integrate the MCP server with Google’s Gemini AI model.
安装
npx -y @smithery/cli install @mochow13/google-scholar-mcp --client claude