Skip to main content
Glama

research-env

A portable research toolkit that bundles three things behind one research CLI:

  • Paper search — a FastAPI service over academic sources (arXiv, OpenAlex, Semantic Scholar, CORE, Exa).

  • MCP server — a FastMCP stdio server with 6 tools that OpenCode (or any MCP-compatible client) calls natively — no Temporal, no worker process.

  • Knowledge base — a conflict-aware, flat-file claim store validated by knowledge-base/verify.py. Research output is persisted here as candidate claims (no Supabase, no external database).

PDF ingestion runs through GROBID.

Architecture

OpenCode (MCP client)
    │
    │  stdio (JSON-RPC)
    ▼
research mcp          ← FastMCP server (research_mcp/server.py)
    ├─ search_papers  → paper search API  (docker: paper-search)
    ├─ search_github  → GitHub REST API
    ├─ save_claim     → knowledge-base/ (flat files + SQLite)
    ├─ ingest_pdf     → GROBID           (docker: grobid)
    ├─ render_pdf     → ~/research-output/
    └─ list_claims    → knowledge-base/claims/

The MCP server runs on the user's machine as a subprocess spawned by OpenCode. Docker only hosts GROBID and the paper-search API — no Temporal, no worker.

Related MCP server: OpenPapers

Quick start

./setup.sh            # creates .env, installs the package, verifies the CLI

Bring up the backing services:

docker compose up -d

Register the MCP server in your opencode.json:

{
  "mcp": {
    "research": {
      "type": "local",
      "command": ["research", "mcp"]
    }
  }
}

OpenCode will spawn research mcp automatically and expose all 6 tools.

CLI

research serve                 # paper search API on :8003
research mcp                   # MCP server (stdio) — normally spawned by OpenCode
research ingest paper.pdf      # PDF -> paper.grobid.tei.xml via GROBID

MCP tools

Tool

Description

search_papers

Search academic papers (OpenAlex, arXiv, Semantic Scholar, CORE, Exa)

search_github

Search GitHub repos for technology adoption signals

save_claim

Persist a research finding to the local knowledge base

ingest_pdf

Extract structured text from a PDF via GROBID

render_pdf

Render a research report to a styled PDF

list_claims

List saved claims, optionally filtered by topic

Configuration

All settings come from environment variables or a local .env file:

cp env.sample .env

Nothing in .env is required to import the package — values gate live features. Key variables:

Variable

Default

Purpose

PAPER_SEARCH_URL

http://localhost:8003

Paper search API base URL

GROBID_URL

http://localhost:8070

GROBID endpoint for research ingest

GITHUB_TOKEN

—

GitHub token for search_github (optional, raises rate limit)

KB_ROOT

./knowledge-base

Knowledge-base root

RESEARCH_DB_PATH

<kb>/../.research/runs.db

SQLite run log

See env.sample for the full list.

Layout

cli/                 Typer CLI (research serve / mcp / ingest)
research_mcp/        FastMCP server (6 tools)
paper_search/        FastAPI paper-search service
research_worker/     Shared helpers: config, persistence, grobid, research_pdf
knowledge-base/      Conflict-aware claim store + verify.py
tests/               pytest suite

Research skills

The repository includes two portable research workflows in .agents/skills/:

Skill

Use it for

Codex

OpenCode

research

One bounded question

$research

@research or /research

deep-research

A multi-part or contested question

$deep-research

@deep-research or /deep-research

The OpenCode slash commands are defined under .opencode/commands/. Both workflows use the current project's evidence store and preserve its source-of-truth rules. Use research for a focused question and deep-research when a question needs broader, adversarial review.

Development

pip install -e ".[dev]"
pytest

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers