hal-mcp

hal-mcp

An MCP server that lets AI assistants query the HAL open archive, including publication search, statistics, citation export, and researcher tracking via natural language.

Category
访问服务器

README

<!-- 🇬🇧 English | 🇫🇷 Français -->

hal-mcp

An MCP (Model Context Protocol) server for HAL, the French national open archive (Hyper Articles en Ligne). It lets an AI assistant — Claude, or any MCP-compatible client — query HAL: search publications, compute statistics, export citations, and track a researcher's output.

No API key required. It goes beyond simple search with facets (aggregate statistics), author tracking by IdHAL, and native bibliographic export.

Features (6 tools)

Tool Description
search_publications Search with human-friendly filters: year range, document type, open access, full-text availability, sorting.
get_publication Full record for a single document by its HAL identifier.
export_citations Export to BibTeX / EndNote / CSV / TEI (via HAL's native wt parameter).
get_publication_stats Aggregate counts (by year, type, keyword, author) using Solr facets.
get_author_production Complete output of a researcher by IdHAL, with most frequent co-authors optionally.
search_structures Search for laboratories / research structures.

Requirements

  • Python 3.10 or newer
  • The mcp SDK, version 1.x (see the important note below)

⚠️ Important — mcp SDK version This server uses FastMCP, which was removed in mcp v2.0.0. The project therefore pins mcp>=1.2.0,<2.0.0. If you see a FastMCP import error at startup, v2 was installed by mistake: reinstall with pip install "mcp<2.0.0".

Installation

git clone https://github.com/Arpany-Tech/hal-mcp
cd hal-mcp
pip install -e .

Verify it works

1. Check the server starts

python -m hal_mcp.server

The cursor hangs with no output: this is expected. The server is running and waiting for MCP messages on standard input. Press Ctrl+C to stop it. (If you get an error instead, see the mcp SDK note above.)

2. Interactive testing with MCP Inspector

The official tool to explore an MCP server without a full client:

npx @modelcontextprotocol/inspector python -m hal_mcp.server

Open the printed URL, click Connect, then List Tools: the 6 tools appear. You can call each one by hand and inspect the responses.

3. Test the API layer directly (no MCP)

python3 - << 'PY'
import asyncio
from hal_mcp import client

async def main():
    res = await client.search_publications(
        "artificial intelligence", year_from=2023,
        open_access_only=True, rows=3,
    )
    print("Total:", res["total"])
    for d in res["documents"]:
        print("-", d.get("label_s"))

asyncio.run(main())
PY

Connect to Claude Desktop

In claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "hal": {
      "command": "python",
      "args": ["-m", "hal_mcp.server"]
    }
  }
}

Fully restart Claude Desktop. The HAL tools appear in the tools indicator of the message box.

Tip: if Claude Desktop can't find python, use the full path to your interpreter (e.g. C:\\Python313\\python.exe on Windows) instead of "python" in command.

Example questions

  • "Find open-access articles on federated learning since 2023."
  • "Give me the output of the researcher with IdHAL dominique-lesselier, with co-authors."
  • "What is the year-by-year breakdown of deep learning publications?"
  • "Export the 10 most recent publications on transformers to BibTeX."
  • "Which laboratories work on quantum physics?"

How it works

HAL exposes a search API built on Apache Solr, queryable over HTTP with no authentication. This server translates human-friendly parameters (year_from, doc_type, open_access_only...) into Solr syntax (fq, facet, wt...), so the agent gets a simple interface while still benefiting from Solr's power (filters, facets, exports).

  • HAL API documentation: https://api.archives-ouvertes.fr/docs/search
  • Structure reference: https://api.archives-ouvertes.fr/docs/ref/resource/structure

Architecture

src/hal_mcp/
├── server.py    # declares the 6 MCP tools (FastMCP)
├── client.py    # calls to HAL's Solr API (httpx)
└── fields.py    # constants: Solr fields, document types

The client.py layer has no MCP dependency: it can be tested in isolation.

Development

Run the tests:

pip install pytest pytest-asyncio
pytest                    # all tests
pytest -m "not network"   # unit tests only (offline, fast)
pytest -m network         # integration tests that call HAL

Roadmap

  • get_structure_output — output of a given laboratory.
  • Pivot facets (cross type × full-text, year × type).
  • Range facets (facet.range) for time-series/evolution charts.
  • Collection / portal filtering exposed as a parameter.
  • HTTP transport for Claude.ai (connector) and ChatGPT (developer mode).

License

MIT — see the LICENSE file.

Disclaimer

Independent project, not affiliated with the CCSD (which operates HAL). Metadata comes from HAL's public API. Please respect HAL's terms of use and the license of each individual publication.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选