{
  "markdown": "<div align=\"center\">\n  <h1>@cyanheads/openalex-mcp-server</h1>\n  <p><b>Access the OpenAlex academic research catalog - 270M+ publications through MCP. STDIO & Streamable HTTP.</b>\n  <div>5 Tools &bull; 2 Prompts</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.7.10-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openalex-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openalex-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openalex-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/openalex-mcp-server/releases/latest/download/openalex-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=openalex-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvb3BlbmFsZXgtbWNwLXNlcnZlciJdfQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22openalex-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads/openalex-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n<div align=\"center\">\n\n**Public Hosted Server:** [https://openalex.caseyjhand.com/mcp](https://openalex.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Tools\n\nFive tools for querying the [OpenAlex](https://openalex.org) academic research catalog:\n\n| Tool Name | Description |\n|:----------|:------------|\n| `openalex_search_entities` | Search, filter, sort, or retrieve by ID across all 8 entity types. |\n| `openalex_analyze_trends` | Group-by aggregation for trend and distribution analysis. |\n| `openalex_resolve_name` | Resolve a name or an identifier (DOI, ORCID, ROR, PMID, PMCID, ISSN, OpenAlex ID) to an OpenAlex ID. |\n| `openalex_get_citation_graph` | Walk the citation graph one hop from a seed work: cites, cited_by, or related_to. |\n| `openalex_describe_fields` | List valid filter, group_by, and select field names for an entity type — call before building a query to avoid invalid-field errors. |\n\n### `openalex_search_entities`\n\nPrimary discovery and lookup tool. Covers all OpenAlex entity types (works, authors, sources, institutions, topics, keywords, publishers, funders).\n\n- Retrieve a single entity by ID (OpenAlex ID, DOI, ORCID, ROR, PMID, PMCID, ISSN). `id` takes precedence: search criteria passed alongside it are not applied, and the response says which ones were dropped rather than echoing them back as though they ran. The search-only validations (semantic page cap, `sample` with `cursor`, `seed` without `sample`) are skipped too — a lookup is never rejected over parameters it ignores\n- Keyword search with boolean operators, quoted phrases, wildcards, and fuzzy matching\n- Exact and AI semantic search modes\n- Rich filter syntax: AND across fields, OR within fields (`us|gb`), NOT (`!us`), ranges (`2020-2024`), comparisons (`>100`)\n- 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\n- Invalid `select` field names produce an error listing the valid fields for that entity type\n- Formatted MCP output is a generic markdown renderer — every returned field is surfaced without per-entity-type hard-coding\n- Cursor pagination and up to 100 results per page; `sort` takes a single key or a comma-separated list, with the `-` descending prefix applied per key\n- `display_name` is nullable — OpenAlex holds no title for paratext and other untitled records, which pass through instead of failing the whole page\n\n---\n\n### `openalex_analyze_trends`\n\nAggregate entities into groups and count them for trend, distribution, and comparative analysis.\n\n- Group by any supported field (publication year, OA status, institution, country, topic, etc.)\n- Combine with filters to scope the population before aggregation\n- Up to 200 groups per page with cursor pagination\n- Supports `include_unknown` to show entities with no value for the grouped field\n\n---\n\n### `openalex_resolve_name`\n\nThe front door for turning anything you have into an OpenAlex ID. **Always use this before filtering by entity** — names are ambiguous, IDs are not.\n\n- A name or partial name runs an autocomplete search: up to 10 matches with disambiguation hints, ~200ms\n- An identifier resolves deterministically to the single record it addresses — OpenAlex ID, DOI, ORCID, ROR, PMID, PMCID, or ISSN, bare or in URL form. No `entity_type` needed: the identifier determines its own\n- An identifier that matches nothing returns an empty result naming the scheme, not name-search advice\n- Optional entity type filter and field-level filters, applied to name queries\n\n---\n\n### `openalex_get_citation_graph`\n\nOne-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.\n\n- `cites`: works that cite the seed (incoming citations)\n- `cited_by`: works the seed cites (its reference list)\n- `related_to`: OpenAlex algorithmic \"related works\" (~8-30 typical, may be empty for less-cited seeds)\n- 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`\n- Stacks with `filters`/`sort`/`select` to narrow the graph (e.g., `publication_year=\">2020\"`, `is_oa=\"true\"`)\n\n---\n\n### `openalex_describe_fields`\n\nDiscover valid field names before constructing a query — avoids invalid-field 400 errors. Backed by a catalog generated from OpenAlex's own field validation.\n\n- List valid fields for any entity type and context (`filter`, `group_by`, or `select`)\n- `group_by` returns the subset of the `filter` set OpenAlex can aggregate — raw date fields, `*.search` operators, and `from_*`/`to_*` range modifiers are excluded\n- 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\n- Complements the ranked \"did you mean\" suggestions now appended to invalid-field errors on the search, trends, and citation-graph tools\n\n## Prompts\n\n| Prompt | Description |\n|:-------|:------------|\n| `openalex_literature_review` | Guides a systematic literature search: formulate query, search, filter, analyze citation network, synthesize findings. |\n| `openalex_research_landscape` | Analyzes the research landscape for a topic: volume trends, top authors/institutions, open access rates, funding sources. |\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):\n\n- Declarative tool definitions — single file per tool, framework handles registration and validation\n- Unified error handling across all tools\n- Pluggable auth (`none`, `jwt`, `oauth`)\n- Swappable storage backends via the framework (not currently used by this server)\n- Structured logging with optional OpenTelemetry tracing\n- Runs locally (stdio/HTTP) or in Docker from the same codebase\n\nOpenAlex-specific:\n\n- Typed API client with automatic ID normalization (DOI, ORCID, ROR, PMID, PMCID, ISSN, OpenAlex URLs)\n- Abstract reconstruction from inverted indices — plaintext instead of OpenAlex's position-keyed encoding\n- HTTP status codes mapped to specific MCP error classes (400 → InvalidParams, 422 → ValidationError, 429 → RateLimited, etc.) with upstream messages surfaced\n- Every API-calling tool reports what the call spent against the OpenAlex daily budget and what is left of it, so a paginated sweep can be priced before it runs instead of ending in a 429. An account holding prepaid balance sees that too, since it keeps serving once the day's allowance is gone\n- Timeout-aware request retries and cancellation support via `AbortSignal`\n\n## Getting Started\n\n### Public Hosted Instance\n\nA public instance is available at `https://openalex.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:\n\n```json\n{\n  \"mcpServers\": {\n    \"openalex-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://openalex.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-Hosted / Local\n\nAdd to your MCP client config (e.g., `claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"openalex-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/openalex-mcp-server\"],\n      \"env\": {\n        \"OPENALEX_API_KEY\": \"your-openalex-api-key\"\n      }\n    }\n  }\n}\n```\n\n`OPENALEX_API_KEY` is optional — set it to a free [OpenAlex account key](https://openalex.org/settings/api) for keyed rate limits and budget under OpenAlex's usage-based pricing, or omit it for anonymous access. Set `OPENALEX_MAILTO` to an email if you want to identify yourself to OpenAlex (the [polite pool](https://developers.openalex.org/guides/authentication)).\n\n### Prerequisites\n\n- [Bun v1.3.0](https://bun.sh/) or higher (for development)\n\n### Installation\n\n1. **Clone the repository:**\n```sh\ngit clone https://github.com/cyanheads/openalex-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n```sh\ncd openalex-mcp-server\n```\n\n3. **Install dependencies:**\n```sh\nbun install\n```\n\n## Configuration\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `OPENALEX_API_KEY` | **Optional.** OpenAlex account API key, sent upstream as `api_key=` (free from [openalex.org/settings/api](https://openalex.org/settings/api)). Without it, anonymous rate limits apply. | — |\n| `OPENALEX_MAILTO` | **Optional.** Email sent upstream as `mailto=` to identify yourself to OpenAlex (the [polite pool](https://developers.openalex.org/guides/authentication)). A courtesy identifier, separate from the API key. | — |\n| `OPENALEX_BASE_URL` | OpenAlex API base URL. | `https://api.openalex.org` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_ALLOWED_ORIGINS` | Comma-separated allow-list of browser `Origin` headers for HTTP transport. Unset = loopback-only; set to `*` to disable. | _loopback only_ |\n| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `debug` |\n| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs). | `false` |\n\n## Running the Server\n\n### Local Development\n\n- **Build and run the production version:**\n  ```sh\n  bun run build\n  bun run start:http   # or start:stdio\n  ```\n\n- **Run checks and tests:**\n  ```sh\n  bun run devcheck     # Lints, formats, type-checks\n  bun run test         # Runs test suite\n  ```\n\n### Docker\n\n```sh\ndocker build -t openalex-mcp-server .\ndocker run -e OPENALEX_API_KEY=your-key -p 3010:3010 openalex-mcp-server\n```\n\n## Project Structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). |\n| `src/mcp-server/prompts/definitions/` | Prompt definitions (`*.prompt.ts`). |\n| `src/services/openalex/` | OpenAlex API client service and domain types. |\n| `src/config/` | Environment variable parsing and validation with Zod. |\n| `tests/` | Unit and integration tests, mirroring the `src/` structure. |\n\n## Development Guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for logging, `ctx.state` for storage\n- Always resolve names to IDs via `openalex_resolve_name` before using them in filters\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n",
  "bytes": 12934,
  "sha": "71c808dedcdc71e70082abe8e65eb433e7025e5be34522bd7561f061c89eb628",
  "repo_slug": "cyanheads/openalex-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cyanheads_openalex_mcp_server_58a12b14/readme"
}