Reference
Python API
Call Scholar's tools from Python as plain functions that return dictionaries.
# Python API `scholar_mcp.api` turns each MCP tool into a plain function. MCP, the command line and Python share one implementation, so every function returns a plain `dict` with the same fields as the tool's structured output. ```python from scholar_mcp import api query = "diffusion policy for dexterous manipulation" hits = api.search(query, limit=10, year="2024-2026") for paper in hits["results"]: print(paper["year"], paper["title"], paper["id"]) detail = api.info("arXiv:2303.04137", include="detail,citations") neighbours = api.related("arXiv:2303.04137", relation="similar") people = api.authors("Fei-Fei Li") text = api.read("arXiv:2303.04137", pages="1-4") saved = api.download("10.1038/s41586-021-03819-2", save_dir="papers") graph = api.graph(["arXiv:2303.04137"], max_hops=1) ``` ## Functions | Function | MCP tool | Returns | |---|---|---| | `api.search` | [`search_papers`](/scholar-mcp/tools/#search_papers) | `results`, plus a `warning` when coverage was reduced | | `api.info` | [`paper_info`](/scholar-mcp/tools/#paper_info) | `paper`, `citations` and `references`, as requested by `include` | | `api.related` | [`recommend_papers`](/scholar-mcp/tools/#recommend_papers) | `relation`, `seed`, `papers` and `total` | | `api.authors` | [`search_authors`](/scholar-mcp/tools/#search_authors) | Author profiles | | `api.read` | [`read_paper`](/scholar-mcp/tools/#read_paper) | Page-aware text with table and figure selectors | | `api.download` | [`download_paper`](/scholar-mcp/tools/#download_paper) | The saved file path and its library collection | | `api.graph` | [`build_paper_graph`](/scholar-mcp/tools/#build_paper_graph) | `nodes`, `edges`, PageRank, bridges and a Mermaid diagram | | `api.library` | [`paper_library`](/scholar-mcp/tools/#paper_library) | The result of the chosen library action | For independent [scientific data](/scholar-mcp/scientific-data/), `api.search_data` searches typed objects and `api.data_info` reads native records. These functions are available through CLI/Python; paper associations use the existing `api.info(..., include="data")` / `paper_info` path. Parameter names and defaults match the [MCP tools reference](/scholar-mcp/tools/), with one convenience: `api.graph` accepts seeds as a list as well as a comma-separated string. A lookup that finds nothing returns a dictionary with an `error` key, the same way the tools report it to a model. The functions use the same environment variables as the server, so API keys, the data directory and reranker settings from [Configuration](/scholar-mcp/configuration/) apply unchanged.scholar_mcp.api turns each MCP tool into a plain function. MCP, the command line and Python share one implementation, so every function returns a plain dict with the same fields as the tool’s structured output.
from scholar_mcp import api
query = "diffusion policy for dexterous manipulation"hits = api.search(query, limit=10, year="2024-2026")for paper in hits["results"]: print(paper["year"], paper["title"], paper["id"])
detail = api.info("arXiv:2303.04137", include="detail,citations")neighbours = api.related("arXiv:2303.04137", relation="similar")people = api.authors("Fei-Fei Li")text = api.read("arXiv:2303.04137", pages="1-4")saved = api.download("10.1038/s41586-021-03819-2", save_dir="papers")graph = api.graph(["arXiv:2303.04137"], max_hops=1)Functions
Section titled “Functions”| Function | MCP tool | Returns |
|---|---|---|
api.search |
search_papers |
results, plus a warning when coverage was reduced |
api.info |
paper_info |
paper, citations and references, as requested by include |
api.related |
recommend_papers |
relation, seed, papers and total |
api.authors |
search_authors |
Author profiles |
api.read |
read_paper |
Page-aware text with table and figure selectors |
api.download |
download_paper |
The saved file path and its library collection |
api.graph |
build_paper_graph |
nodes, edges, PageRank, bridges and a Mermaid diagram |
api.library |
paper_library |
The result of the chosen library action |
For independent scientific data, api.search_data searches typed objects and api.data_info reads native records. These functions are available through CLI/Python; paper associations use the existing api.info(..., include="data") / paper_info path.
Parameter names and defaults match the MCP tools reference, with one convenience: api.graph accepts seeds as a list as well as a comma-separated string. A lookup that finds nothing returns a dictionary with an error key, the same way the tools report it to a model.
The functions use the same environment variables as the server, so API keys, the data directory and reranker settings from Configuration apply unchanged.