Skip to main content
Glama
research-mcp-lab

research-mcp-lab

research-mcp-lab

Hacker News × arXiv を横断する research intelligence エージェントの MCP サーバ。 自然文の問いを SQL / 全文検索に変換し、根拠(実行した SQL・検索ヒット)つきで答える。

特徴

  • MCP サーバ(Model Context Protocol)— Claude Code 等の AI クライアントから「道具」として呼べる。

  • DuckDB + FTS — HN/arXiv のメタデータを列指向 DB に格納し、BM25 で全文検索。

  • 根拠を返す — どのツールを・どんな SQL / 検索で答えたかを併記する。

  • ライブ取得(スクレイピング) — refresh_data で最新の HN×arXiv を取得し、別ストア(data/live/)に保存。凍結スナップショット(data/snapshot/)は再現性のため不変。

Related MCP server: nl2sql-mcp

ツール

ツール

役割

get_schema(live=False)

テーブル/列の意味・FTS 対象を返す(AI が SQL/検索の前に読む)

run_sql(sql, live=False)

読み取り専用 SQL を実行し表形式で返す(=根拠 SQL)

search_text(query, target="papers", live=False)

BM25 全文検索(papers の abstract / comments の本文)

refresh_data(top_n=120)

HN×arXiv を取得して live ストアを更新(スクレイピング)

live=True を付けると refresh_data 後の最新データに対して問い合わせる。 既定(live=False)は凍結スナップショット=再現可能な基準データを見る。

セットアップ

uv sync --dev

# 凍結スナップショット(data/snapshot/*.csv)から DuckDB を構築
PYTHONPATH=src uv run python -c "from research_mcp.data import build_db; build_db()"

uv run pytest

# MCP サーバを stdio 起動
PYTHONPATH=src uv run python -m research_mcp

MCP クライアントへの登録(例: Claude Code)

claude mcp add research-intelligence -s user \
  -e PYTHONPATH="$PWD/src" \
  -- uv run --directory "$PWD" python -m research_mcp

データ

  • data/snapshot/*.csv — HN/arXiv の凍結スナップショット(公開データ)。eval / デモの再現性の基準。

  • data/live/ — refresh_data が再生成(.gitignore 済み)。

データ源(API キー不要)

  • Hacker News API(Firebase)— https://hacker-news.firebaseio.com/v0/

  • arXiv API(Atom)— http://export.arxiv.org/api/query

構成

src/research_mcp/
  sources.py   # HN/arXiv 取得・arxiv_id 抽出・サニタイズ・build_snapshot
  data.py      # スナップショット→DuckDB、メタデータ層、FTS、接続
  server.py    # MCP ツール(get_schema / run_sql / search_text / refresh_data)
  __main__.py  # `python -m research_mcp` で stdio 起動
tests/         # pytest(取得の純関数・MCP ツール・live ルーティング)

Available Tools

4 tools
get_schemaA

テーブル/列の意味・FTS 対象を返す。AI が SQL/検索の前に読む。

live=True で refresh_data 後の最新データ(live ストア)のスキーマを見る。

Inputs: live. Returns: result

refresh_dataA

HN×ArXiv を今すぐ取得し、別の live ストア(data/live/)に保存する(スクレイピング)。

凍結スナップショット(data/snapshot=eval の基準)は変更しない。取得後は get_schema/run_sql/search_text に live=True を付けると最新データを検索できる。 top_n は HN topstories の取得上限(多いほど網羅的だが遅い)。

Inputs: top_n. Returns: result

run_sqlA

読み取り専用 SQL を実行し結果を表形式文字列で返す(=根拠 SQL)。

live=True で refresh_data 後の最新データ(live ストア)に対して実行する。

Inputs: sql (required), live. Returns: result

search_textA

FTS 全文検索。target は 'papers'(abstract) か 'comments'(text)。

BM25 スコア順にヒット行を返す(=どの文書がヒットしたかの根拠)。 live=True で refresh_data 後の最新データ(live ストア)を検索する。

Inputs: query (required), live, target. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a clearly distinct operation: schema introspection, read-only SQL execution, full-text search, and data refresh. There is no meaningful overlap between any two tools.

    Naming Consistency5/5

    All tool names follow the same verb_noun snake_case pattern: get_schema, run_sql, search_text, refresh_data. The naming is perfectly consistent and predictable.

    Tool Count5/5

    Four tools is an appropriate scope for a research data exploration server. Each tool covers a necessary part of the workflow without redundancy.

    Completeness4/5

    The set covers schema discovery, SQL querying, full-text search, and live data refresh, which forms a complete research workflow. A minor gap is the lack of an explicit refresh status or provenance tool, but this can be worked around via queries.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP (Model Context Protocol) server that exposes natural language to SQL functionality, allowing any MCP-compatible client to convert plain English questions into SQL queries for database interaction using AI.
      3
      MIT
    • F
      license
      Not graded
      quality
      F
      maintenance
      A production-ready MCP server that transforms natural language into safe, executable SQL queries with multi-database support and intelligent schema analysis.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Zero-auth multi-source research MCP server that enables web search, reading URLs, PDFs, GitHub repos, and querying Hacker News, Stack Overflow, Semantic Scholar, and YouTube transcripts without API keys.
      58 PyPI
      12
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for semantic research: search arXiv, fetch papers, and answer questions grounded in the actual paper text via RAG tools, resources, and prompts.
      1
      MIT