Semantic Scholar MCP Server
Enables searching and retrieving academic papers, authors, citations, and references from Semantic Scholar via an HTTP MCP server with caching and rate limiting.
README
Semantic Scholar MCP Server
Remote MCP server with Streamable HTTP transport for Semantic Scholar API access.
Features
- π Streamable HTTP Transport - Remote MCP server accessible anywhere
- πΎ SQLite Caching - Persistent cache with TTL-based expiration
- π¦ Rate Limiting - Token bucket algorithm to prevent API quota exhaustion
- π Metrics - Prometheus-compatible metrics endpoint
- π Structured Logging - JSON logs with request IDs
- π Security - API key via environment variable only (no CLI exposure)
Quick Start
Installation
# Clone the repository
git clone https://github.com/your-org/semantic-scholar-mcp.git
cd semantic-scholar-mcp
# Install dependencies
npm install
# Build TypeScript
npm run build
Configuration
Set environment variables:
# Required: Semantic Scholar API key (get from https://www.semanticscholar.org/product/api)
export SEMANTIC_SCHOLAR_API_KEY="your-api-key"
# Optional: Server configuration
export PORT=3000
export HOST="0.0.0.0"
export LOG_LEVEL="info"
# Optional: Cache configuration
export CACHE_TTL_DAYS=7
export CACHE_MAX_SIZE=1073741824
# Optional: Rate limiting
export RATE_LIMIT_REQUESTS_PER_MINUTE=10
export RATE_LIMIT_BURST_SIZE=5
Running
# Production
npm start
# Development (with hot reload)
npm run dev
Authentication
Simple API Key (Default)
Uses environment variable for authentication. Good for personal use.
export SEMANTIC_SCHOLAR_API_KEY="your-api-key"
OAuth 2.1 (Enterprise)
For production multi-user deployments, use the OAuth 2.1 pattern:
Reusable OAuth Pattern: https://github.com/truaxki/mcp-oauth-pattern
The OAuth pattern provides:
- OAuth 2.1 authentication with Supabase
- Bearer token middleware
- Consent page for user authorization
- Per-user rate limiting (optional)
To add OAuth to this server:
- Clone https://github.com/truaxki/mcp-oauth-pattern
- Copy
src/auth.ts,src/logger.tsfrom OAuth pattern - Replace API key auth with Bearer token middleware
- Configure Supabase environment variables
Connect from Claude Code
Add to your .mcp.json:
{
"mcpServers": {
"semantic-scholar": {
"type": "streamable-http",
"url": "http://your-server:3000"
}
}
}
Endpoints
| Endpoint | Description |
|---|---|
POST /mcp |
MCP protocol handler |
GET /health |
Health check |
GET /metrics |
Prometheus metrics |
Available Tools
| Tool | Description |
|---|---|
search_papers |
Search for papers with filters |
get_paper |
Get paper details by ID |
get_authors |
Get authors for a paper |
get_citations |
Get papers that cite a paper |
get_references |
Get papers referenced by a paper |
batch_fetch |
Fetch multiple papers efficiently |
get_cache_stats |
View cache statistics |
clear_cache |
Clear cached data |
Deployment
Docker
# Build image
docker build -t semantic-scholar-mcp .
# Run container
docker run -d \
--name semantic-scholar-mcp \
-p 3000:3000 \
-e SEMANTIC_SCHOLAR_API_KEY="your-key" \
semantic-scholar-mcp
Railway Deployment
One-click deploy:
Manual deployment:
-
Connect repository
- Go to Railway and sign in
- Click "New Project" β "Deploy from GitHub repo"
- Select
truaxki/semantic-scholar-mcp
-
Configure environment variables
- In Railway dashboard, go to your service's "Variables" tab
- Add:
SEMANTIC_SCHOLAR_API_KEY=your-api-key-here LOG_LEVEL=info PORT=3000
-
Deploy
- Railway automatically detects Node.js and builds
- Deploys with Streamable HTTP on port 3000
- Gets free HTTPS endpoint automatically
-
Connect from Claude Code
{ "mcpServers": { "semantic-scholar": { "type": "streamable-http", "url": "https://your-service.up.railway.app/mcp" } } }
Railway pricing: Free tier available, $5/month for dedicated resources.
Manual Server (srv1338041)
# SSH to server
ssh user@srv1338041
# Clone and build
git clone your-repo
cd semantic-scholar-mcp
npm install
npm run build
# Create systemd service (see deploy/semantic-scholar-mcp.service)
sudo cp deploy/semantic-scholar-mcp.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable semantic-scholar-mcp
sudo systemctl start semantic-scholar-mcp
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Semantic Scholar MCP Server β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββ β
β β Express ββββΆβ MCP SDK ββββΆβ Tools β β
β β HTTP β β Server β β Registry β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββ β
β β β β
β βΌ βΌ β
β ββββββββββββββββ ββββββββββββββββ β
β β Logging β β Cache β β
β β (Pino) β β (SQLite) β β
β ββββββββββββββββ ββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
HTTPS Endpoint Persistent Cache Rate Limited API
API Key
Get your free Semantic Scholar API key from: https://www.semanticscholar.org/product/api
Free tier: 100 requests/day
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.