legal_scholarship_mcp

legal_scholarship_mcp

Enables searching scholarly literature via the OpenAlex database, with tools for full-text search, work details, citation lookup, and author queries.

Category
访问服务器

README

legal_scholarship_mcp

An MCP (Model Context Protocol) server that lets an AI assistant search scholarly literature — useful for legal and academic research — through the OpenAlex database of 250M+ works. It exposes five read-only tools that a client such as Claude Desktop can call directly.

**Personal proof-of-concept, in active development.** It returns scholarly **metadata and abstracts** — not full-text articles — and it does not give legal advice. The tools below work; more are planned (see Status).

What it does

  • search\_scholarship — full-text search of works by query, with year filters and sort by relevance / citations / date. Returns title, authors, year, venue, citation count, OpenAlex ID and DOI.
  • get\_work\_details — fetch one work's full record by OpenAlex ID or DOI, including a plain-text abstract reconstructed from OpenAlex's inverted index, and its reference count.
  • find\_citing\_works — the citation-graph workhorse: given a work's ID, find the works that cite it (forward citations), newest or most-cited first.
  • search\_authors — resolve an author name to OpenAlex author profiles (ID, institution, works count, citations, h-index). Names are ambiguous, so this implements OpenAlex's recommended "resolve to an ID first" pattern.
  • get\_author\_works — given an author ID (from search\_authors), list that author's works.

Every tool returns either readable Markdown or structured JSON, and all are read-only.

What it does not do

  • It does not return full-text articles (OpenAlex provides metadata and abstracts).
  • It does not give legal advice or evaluate authority — it finds and summarises sources for a human to read.

Requirements

pip install -r requirements.txt

OpenAlex API key (free, required)

Since 13 February 2026, OpenAlex requires a free API key for all requests (the old "polite pool" / mailto parameter was retired). Get one in about 30 seconds:

  1. Create a free account at https://openalex.org.
  2. Copy your key from https://openalex.org/settings/api.
  3. Set it in your environment:
export OPENALEX\_API\_KEY="your-free-key"

A free key gives $1 of usage per day — ample for interactive research. The key is sent as the api\_key query parameter on each request.

Run it

Inspect the tools with the MCP Inspector:

mcp dev legal\_scholarship\_mcp.py

Connect it to Claude Desktop — add this to your claude\_desktop\_config.json (Settings → Developer → Edit Config), using the absolute path to the file:

{
  "mcpServers": {
    "legal-scholarship": {
      "command": "python",
      "args": \["/absolute/path/to/legal\_scholarship\_mcp.py"],
      "env": { "OPENALEX\_API\_KEY": "your-free-key" }
    }
  }
}

Restart Claude Desktop, and the five tools become available in chat.

How it works

Built on the MCP Python SDK's FastMCP. Each tool validates its inputs with Pydantic field constraints, calls OpenAlex asynchronously via httpx, and formats the result as Markdown or JSON. Shared logic — the API request (with a polite User-Agent and retry-with-exponential-backoff on transient 429/5xx/timeout failures, as OpenAlex recommends), error handling, abstract reconstruction, field formatting and the works-list path — is factored into helper functions. Author queries follow OpenAlex's "resolve a name to an ID, then filter by ID" pattern. Transport is stdio, which is what local clients like Claude Desktop use.

Tests

pip install pytest
pytest

The suite runs fully offline: the deterministic helpers are tested directly, the tools are tested with the network call replaced by a fake, and the retry logic is tested with httpx's MockTransport. No API key or network access is needed. (One test is a regression guard ensuring the pagination parameter stays per\_page, OpenAlex's required spelling.)

Status & roadmap

Working now: the five read-only tools above, with input validation, retries, and Markdown/JSON output.

Planned (this is an in-development prototype):

  • Structured tool output — define outputSchema / return structuredContent per MCP best practice, so clients get typed results rather than text/JSON strings.
  • More entity coverage — tools for topics, institutions and sources; a related-works tool and a reference-list (backward-citation) tool.
  • Open-access PDF retrieval for works that have a free full text.
  • An MCP evaluation suite — a set of realistic, verifiable questions (per the MCP evaluation methodology) run against a live key.
  • Response caching to reduce repeat calls and cost.

Boundaries and responsible use

Proof-of-concept in development, for demonstration and research only. Not legal advice; it returns scholarly metadata and abstracts, not full text, and does not evaluate the authority or correctness of any source. Confirm anything important against the original. Built through AI-assisted development.

Licence

MIT — see LICENSE.

About

Built by Mahmoud Hussein, an Egypt-qualified lawyer (registered at Appeal level), through AI-assisted development — directing and assembling AI-generated code on a foundation of Python, with the design and the OpenAlex API verification his own. This server is an actively-developed work in progress.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选