Labsco
cyanheads logo

openalex-mcp-server

โ˜… 7

from cyanheads

270M+ academic publications

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

@cyanheads/openalex-mcp-server

Access the OpenAlex academic research catalog - 270M+ publications through MCP. STDIO & Streamable HTTP.

5 Tools โ€ข 2 Prompts

Install in Claude Desktop Install in Cursor Install in VS Code

Public Hosted Server: https://openalex.caseyjhand.com/mcp


Tools

Five tools for querying the OpenAlex academic research catalog:

Tool NameDescription
openalex_search_entitiesSearch, filter, sort, or retrieve by ID across all 8 entity types.
openalex_analyze_trendsGroup-by aggregation for trend and distribution analysis.
openalex_resolve_nameResolve a name or partial name to an OpenAlex ID via autocomplete.
openalex_get_citation_graphWalk the citation graph one hop from a seed work: cites, cited_by, or related_to.
openalex_describe_fieldsList valid filter, group_by, and select field names for an entity type โ€” call before building a query to avoid invalid-field errors.

openalex_search_entities

Primary discovery and lookup tool. Covers all OpenAlex entity types (works, authors, sources, institutions, topics, keywords, publishers, funders).

  • Retrieve a single entity by ID (OpenAlex ID, DOI, ORCID, ROR, PMID, PMCID, ISSN)
  • Keyword search with boolean operators, quoted phrases, wildcards, and fuzzy matching
  • Exact and AI semantic search modes
  • Rich filter syntax: AND across fields, OR within fields (us|gb), NOT (!us), ranges (2020-2024), comparisons (>100)
  • Sensible default field selection per entity type, applied to both searches and ID lookups โ€” prevents oversized responses; pass select to choose fields, or ["*"] for the full record
  • Invalid select field names produce an error listing the valid fields for that entity type
  • Formatted MCP output is a generic markdown renderer โ€” every returned field is surfaced without per-entity-type hard-coding
  • Cursor pagination, sorting, up to 100 results per page

Aggregate entities into groups and count them for trend, distribution, and comparative analysis.

  • Group by any supported field (publication year, OA status, institution, country, topic, etc.)
  • Combine with filters to scope the population before aggregation
  • Up to 200 groups per page with cursor pagination
  • Supports include_unknown to show entities with no value for the grouped field

openalex_resolve_name

Name-to-ID resolution via autocomplete. Always use this before filtering by entity โ€” names are ambiguous, IDs are not.

  • Returns up to 10 matches with disambiguation hints
  • Accepts partial names and DOIs for direct lookup
  • Optional entity type filter and field-level filters
  • ~200ms response time

openalex_get_citation_graph

One-hop citation graph traversal from a seed work. Wraps the OpenAlex cites/cited_by/related_to filters behind an explicit direction argument so callers do not have to know the filter names.

  • cites: works that cite the seed (incoming citations)
  • cited_by: works the seed cites (its reference list)
  • related_to: OpenAlex algorithmic "related works" (~8-30 typical, may be empty for less-cited seeds)
  • Accepts OpenAlex IDs, DOIs, PMIDs, PMCIDs as seed_id; validates the seed via a singleton /works/{id} lookup before walking, so non-existent seeds surface as NotFound
  • Stacks with filters/sort/select to narrow the graph (e.g., publication_year=">2020", is_oa="true")

openalex_describe_fields

Discover valid field names before constructing a query โ€” avoids invalid-field 400 errors. Backed by a catalog generated from OpenAlex's own field validation.

  • List valid fields for any entity type and context (filter, group_by, or select)
  • group_by resolves to the same valid-field set as filter
  • Pass query (a partial or guessed name) to rank results by name similarity โ€” surfaces the right field when you only know roughly what you want
  • Complements the ranked "did you mean" suggestions now appended to invalid-field errors on the search, trends, and citation-graph tools

Prompts

PromptDescription
openalex_literature_reviewGuides a systematic literature search: formulate query, search, filter, analyze citation network, synthesize findings.
openalex_research_landscapeAnalyzes the research landscape for a topic: volume trends, top authors/institutions, open access rates, funding sources.

Features

Built on @cyanheads/mcp-ts-core:

  • Declarative tool definitions โ€” single file per tool, framework handles registration and validation
  • Unified error handling across all tools
  • Pluggable auth (none, jwt, oauth)
  • Swappable storage backends via the framework (not currently used by this server)
  • Structured logging with optional OpenTelemetry tracing
  • Runs locally (stdio/HTTP) or in Docker from the same codebase

OpenAlex-specific:

  • Typed API client with automatic ID normalization (DOI, ORCID, ROR, PMID, PMCID, ISSN, OpenAlex URLs)
  • Abstract reconstruction from inverted indices โ€” plaintext instead of OpenAlex's position-keyed encoding
  • HTTP status codes mapped to specific MCP error classes (400/422 โ†’ InvalidParams, 429 โ†’ RateLimited, etc.) with upstream messages surfaced
  • Timeout-aware request retries and cancellation support via AbortSignal

Project Structure

DirectoryPurpose
src/mcp-server/tools/definitions/Tool definitions (*.tool.ts).
src/mcp-server/prompts/definitions/Prompt definitions (*.prompt.ts).
src/services/openalex/OpenAlex API client service and domain types.
src/config/Environment variable parsing and validation with Zod.
tests/Unit and integration tests, mirroring the src/ structure.

Development Guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches โ€” no try/catch in tool logic
  • Use ctx.log for logging, ctx.state for storage
  • Always resolve names to IDs via openalex_resolve_name before using them in filters