Skip to main content
Glama
kyeshmz
by kyeshmz
README.md
# Academix MCP

A remote MCP server for academic paper search, deployed on Cloudflare Workers. Aggregates results from multiple academic databases with PDF storage and full-text search.

## Data Sources

| Source | Auth | Coverage |
|--------|------|----------|
| OpenAlex | Free (email for polite pool) | 240M+ works |
| Semantic Scholar | Free (API key for higher limits) | AI-powered recommendations |
| DBLP | Free | CS papers, native BibTeX |
| CrossRef | Free (email for polite pool) | DOI resolution |
| arXiv | Free | Preprints |
| Google Scholar | SerpAPI key ($75/mo) | Optional, broadest coverage |

## Tools (11 total)

### Search & Discovery
- `academic_search_papers` — search across all sources with filters (author, year, venue, DOI)
- `academic_get_paper_details` — get full metadata by DOI, arXiv ID, OpenAlex ID, or DBLP key
- `academic_search_author` — find papers by author name
- `academic_get_related_papers` — AI-powered recommendations via Semantic Scholar
- `academic_get_citations` — get papers that cite a given paper
- `academic_get_citation_network` — graph data (nodes/edges) for visualization

### Export
- `academic_get_bibtex` — export BibTeX citations (single or batch)

### PDF Storage & Search
- `academic_save_pdf` — download PDF, extract text, store in R2, index in D1
- `academic_list_pdfs` — list stored PDFs
- `academic_search_stored` — full-text search across extracted PDF text
- `academic_verify_citation` — verify if a sentence appears in any stored paper

## Setup

```bash
npm install
```

### Local development

```bash
# Create .dev.vars with your secrets
echo 'SERPAPI_API_KEY=your_key' > .dev.vars
echo 'ACADEMIX_EMAIL=you@example.com' >> .dev.vars

npm run dev
```

### Deploy to Cloudflare

```bash
# Create resources
npx wrangler r2 bucket create academix-papers
npx wrangler d1 create academix-index
# Update database_id in wrangler.jsonc

# Apply D1 schema
npx wrangler d1 execute academix-index --remote --file=schema.sql

# Set secrets
npx wrangler secret put SERPAPI_API_KEY
npx wrangler secret put ACADEMIX_EMAIL

# Optional paid PDF downloads
npx wrangler secret put OPENALEX_API_KEY

# Deploy
npm run deploy
```

### Add to Claude Code

```json
{
  "mcpServers": {
    "academix": {
      "command": "npx",
      "args": ["mcp-remote", "https://your-worker.workers.dev/mcp"]
    }
  }
}
```

## Testing

```bash
npm run dev          # terminal 1
npm test             # terminal 2

# Against production
npx tsx test.ts https://your-worker.workers.dev

# With Google Scholar
SERPAPI_API_KEY=xxx npm test
```

## Architecture

- **Cloudflare Workers** — serverless runtime
- **Durable Objects** — MCP session management
- **R2** — PDF and extracted text storage
- **D1** — paper metadata index with FTS5 full-text search
- **unpdf** — edge-compatible PDF text extraction

## Based on

TypeScript port of [Academix](https://github.com/xingyulu23/Academix) (Python), extended with R2/D1 storage, Google Scholar, and citation verification.