Crossref MCP Server

MIT License

Integrations

  • Allows interaction with the Crossref API to search for academic works by title or author, and retrieve detailed publication metadata using Digital Object Identifiers (DOIs).

Crossref MCP 服务器

用于与 Crossref API 交互的模型上下文协议 (MCP) 服务器。

特征

  • 按标题搜索作品
  • 按作者搜索作品
  • 通过 DOI 获取工作详细信息

安装

{ "mcpServers": { "crossref": { "command": "npx", "args": [ "-y", "@botanicastudios/crossref-mcp" ] } } }

用法

该服务器提供三个主要工具:

1. 按标题搜索

在 Crossref 中按标题搜索作品:

// Example: Search for works containing "quantum computing" in the title { "title": "quantum computing", "rows": 5 // Optional, defaults to 5 }

2. 按作者搜索

在 Crossref 中按作者搜索作品:

// Example: Search for works by "Einstein" { "author": "Einstein", "rows": 5 // Optional, defaults to 5 }

3. 通过 DOI 获取作品

使用 DOI 检索特定作品:

// Example: Get work with DOI "10.1088/1742-6596/1398/1/012023" { "doi": "10.1088/1742-6596/1398/1/012023" }

响应格式

所有响应均以以下格式的结构化 JSON 对象返回:

对于成功的搜索:

{ "status": "success", "query": { /* the original query parameters */ }, "count": 5, "results": [ { "title": "Work title", "authors": [ { "given": "First name", "family": "Last name", "name": "First name Last name" } ], "published": { "dateParts": [2023, 1, 15], "dateString": "2023-1-15" }, "type": "journal-article", "doi": "10.xxxx/xxxxx", "url": "https://doi.org/10.xxxx/xxxxx", "container": "Journal Name", "publisher": "Publisher Name", "issue": "1", "volume": "42", "abstract": "This is the abstract of the work, if available." } // additional results... ] }

对于单个 DOI 查找:

{ "status": "success", "query": { "doi": "10.xxxx/xxxxx" }, "result": { // work details as shown above } }

对于错误或无结果:

{ "status": "error" | "no_results" | "not_found", "message": "Error message" | null, "query": { /* the original query parameters */ } }

测试

该服务器附带使用 Vitest 的全面测试套件。测试涵盖所有可用工具,并涵盖各种场景,包括成功响应、空结果和错误处理。

运行测试

npm test

测试结构

这些测试使用 Vitest 的模拟功能来模拟 Crossref API 响应,而无需发出实际的网络请求。测试结构包括:

  1. 模拟数据:标题搜索、作者搜索和 DOI 查找的示例响应
  2. 模拟处理程序mcp-server-test-handlers.js中的处理程序函数的测试版本
  3. 测试用例:针对所有工具的测试,涵盖:
    • 成功的 API 响应
    • 空结果集
    • 错误处理和网络故障

扩展测试

要添加更多测试用例:

  1. 如果需要,将新的模拟数据添加到测试文件
  2. 在相关的描述块中创建额外的测试用例
  3. 使用mockFetchResponse()助手来模拟 API 响应

例子:

it("should handle a new edge case", async () => { // Mock the response mockFetchResponse({ // Your sample response data }); // Call the handler const result = await handlers.searchByTitle({ title: "example" }); // Assert the expected results expect(result).toMatchObject({ // Expected response structure }); });
-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器,可查询 Crossref API 以按标题、作者或 DOI 搜索学术出版物,返回有关学术作品的结构化元数据。

  1. 特征
    1. 安装
      1. 用法
        1. 1. 按标题搜索
        2. 2. 按作者搜索
        3. 3. 通过 DOI 获取作品
      2. 响应格式
        1. 对于成功的搜索:
        2. 对于单个 DOI 查找:
        3. 对于错误或无结果:
      3. 测试
        1. 运行测试
        2. 测试结构
        3. 扩展测试

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        Semantic Scholar API, providing comprehensive access to academic paper data, author information, and citation networks.
        Last updated -
        22
        Python
        MIT License
      • A
        security
        A
        license
        A
        quality
        A Model Context Protocol server that provides access to the DBLP computer science bibliography database, allowing AI models to search publications, process citations, and generate accurate BibTeX entries.
        Last updated -
        6
        1
        Python
        MIT License
        • Apple
        • Linux
      • -
        security
        F
        license
        -
        quality
        A Model-Client-Protocol server that enables users to search the Gallica digital library of the National Library of France and generate structured sequential research reports with formatted citations and relevant images.
        Last updated -
        2
        Python
      • -
        security
        F
        license
        -
        quality
        Provides tools for accessing the Semantic Scholar API to search papers, retrieve paper and author details, and fetch citations and references through the Model Context Protocol.
        Last updated -
        1
        Python
        • Apple
        • Linux

      View all related MCP servers

      ID: 67odz8ewc2