crossref-mcp
# crossref-mcp
[Crossref REST API](https://www.crossref.org/documentation/retrieve-metadata/rest-api/) を使って学術文献のメタデータを取得する [MCP](https://modelcontextprotocol.io) サーバーです。
## 機能 (Tools)
| Tool | 説明 |
| --- | --- |
| `get_work_by_doi` | DOI から1件の文献メタデータを取得します。 |
| `search_works` | フリーテキスト / タイトル / 著者から文献を検索します。 |
取得・検索結果には、タイトル・著者・掲載誌・出版年・DOI・被引用数・(提供されていれば)アブストラクトなどが含まれます。
## 実行 (uvx)
公開リポジトリから直接実行できます:
```bash
uvx --from git+https://github.com/ebiyu/crossref-mcp crossref-mcp
```
ローカルのクローンから実行する場合:
```bash
uvx --from . crossref-mcp
```
## MCP クライアントへの登録
Claude Desktop / Claude Code などの `mcpServers` 設定例:
```json
{
"mcpServers": {
"crossref": {
"command": "uvx",
"args": ["--from", "git+https://github.com/ebiyu/crossref-mcp", "crossref-mcp"],
"env": {
"CROSSREF_MAILTO": "you@example.com"
}
}
}
}
```
ローカルにクローンしたものを使う場合は、`--from` に絶対パスを指定します(Windows の例):
```json
{
"mcpServers": {
"crossref": {
"command": "uvx",
"args": [
"--from",
"PATH_TO_THIS_FOLDER",
"crossref-mcp"
],
"env": {
"CROSSREF_MAILTO": "you@example.com"
}
}
}
}
```
macOS / Linux の場合は `"/path/to/crossref-mcp"` のように指定してください。
Claude Code の CLI から登録する場合:
```bash
claude mcp add crossref -e CROSSREF_MAILTO=you@example.com -- uvx --from git+https://github.com/ebiyu/crossref-mcp crossref-mcp
```
## レート制限の尊重
Crossref の
[アクセスポリシー](https://www.crossref.org/documentation/retrieve-metadata/rest-api/access-and-authentication/)
に従い、自動でリクエスト間隔を調整します。
- レスポンスの `X-Rate-Limit-Limit` / `X-Rate-Limit-Interval` ヘッダから許容レートを学習し、`間隔 ÷ 上限` 秒ずつリクエストを空けます。リクエストは直列化され、同時実行数の上限も超えません。
- `429 Too Many Requests` を受けた場合は `Retry-After` を尊重し、なければ指数バックオフ(最大30秒、最大5回)で再試行します。
## CROSSREF_MAILTO(推奨)
環境変数 `CROSSREF_MAILTO` にメールアドレスを設定すると、Crossref の
["polite pool"](https://www.crossref.org/documentation/retrieve-metadata/rest-api/tips-for-using-the-crossref-rest-api/)
が使われ、より安定したレスポンスが得られます。設定は任意です。
## 開発
```bash
uv sync
uv run crossref-mcp # stdio でサーバー起動
```
## ライセンス
MIT
TDQS
Scored across 2 tools
The two tools are clearly distinct: one retrieves a specific work by DOI, the other searches for works using query parameters. There is no overlap in their purposes, making it easy for an agent to select the appropriate tool.
Both tools follow a consistent verb_noun pattern: 'get_work_by_doi' and 'search_works'. The naming clearly indicates the action and the resource, and there is no mixing of conventions.
With only two tools, the server feels thin for a general Crossref API, but for the narrow purpose of retrieving works by identifier or search, it is minimally sufficient. The count is at the low end of what is reasonable.
The core workflows of looking up a work by DOI and searching for works are covered. Minor gaps exist, such as no support for other identifiers or listing all works of an author directly, but the primary use cases are addressed.