academia-mcp 1.7.3__tar.gz → 1.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/PKG-INFO +1 -1
  2. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/server.py +2 -0
  3. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/__init__.py +2 -0
  4. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/latex.py +21 -8
  5. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/review.py +3 -1
  6. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp.egg-info/PKG-INFO +1 -1
  7. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/pyproject.toml +1 -1
  8. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_latex.py +21 -0
  9. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_web_search.py +0 -1
  10. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/LICENSE +0 -0
  11. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/README.md +0 -0
  12. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/__init__.py +0 -0
  13. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/__main__.py +0 -0
  14. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/files.py +0 -0
  15. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/latex_templates/agents4science_2025/agents4science_2025.sty +0 -0
  16. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/latex_templates/agents4science_2025/agents4science_2025.tex +0 -0
  17. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/llm.py +0 -0
  18. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/pdf.py +0 -0
  19. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/py.typed +0 -0
  20. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/anthology_search.py +0 -0
  21. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/arxiv_download.py +0 -0
  22. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/arxiv_search.py +0 -0
  23. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/bitflip.py +0 -0
  24. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/document_qa.py +0 -0
  25. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/hf_datasets_search.py +0 -0
  26. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/py.typed +0 -0
  27. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/s2_citations.py +0 -0
  28. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/visit_webpage.py +0 -0
  29. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/tools/web_search.py +0 -0
  30. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp/utils.py +0 -0
  31. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp.egg-info/SOURCES.txt +0 -0
  32. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp.egg-info/dependency_links.txt +0 -0
  33. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp.egg-info/entry_points.txt +0 -0
  34. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp.egg-info/requires.txt +0 -0
  35. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/academia_mcp.egg-info/top_level.txt +0 -0
  36. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/setup.cfg +0 -0
  37. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_anthology_search.py +0 -0
  38. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_arxiv_download.py +0 -0
  39. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_arxiv_search.py +0 -0
  40. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_bitflip.py +0 -0
  41. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_document_qa.py +0 -0
  42. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_extract_json.py +0 -0
  43. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_hf_dataset_search.py +0 -0
  44. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_review.py +0 -0
  45. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_s2_citations.py +0 -0
  46. {academia_mcp-1.7.3 → academia_mcp-1.8.0}/tests/test_visit_webpage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: academia-mcp
3
- Version: 1.7.3
3
+ Version: 1.8.0
4
4
  Summary: MCP server that provides different tools to search for scientific publications
5
5
  Author-email: Ilya Gusev <phoenixilya@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/IlyaGusev/academia_mcp
@@ -17,6 +17,7 @@ from .tools.latex import (
17
17
  compile_latex_from_str,
18
18
  get_latex_template,
19
19
  get_latex_templates_list,
20
+ read_pdf,
20
21
  )
21
22
  from .tools.web_search import web_search, tavily_web_search, exa_web_search, brave_web_search
22
23
  from .tools.visit_webpage import visit_webpage
@@ -70,6 +71,7 @@ def run(
70
71
  server.add_tool(get_latex_templates_list)
71
72
  server.add_tool(visit_webpage)
72
73
  server.add_tool(download_pdf_paper)
74
+ server.add_tool(read_pdf)
73
75
 
74
76
  if not disable_web_search_tools:
75
77
  if os.getenv("TAVILY_API_KEY"):
@@ -9,6 +9,7 @@ from .latex import (
9
9
  compile_latex_from_str,
10
10
  get_latex_template,
11
11
  get_latex_templates_list,
12
+ read_pdf,
12
13
  )
13
14
  from .web_search import web_search, tavily_web_search, exa_web_search, brave_web_search
14
15
  from .visit_webpage import visit_webpage
@@ -37,4 +38,5 @@ __all__ = [
37
38
  "score_research_proposals",
38
39
  "review_pdf_paper",
39
40
  "download_pdf_paper",
41
+ "read_pdf",
40
42
  ]
@@ -7,6 +7,7 @@ from pathlib import Path
7
7
 
8
8
 
9
9
  from academia_mcp.files import get_workspace_dir, DEFAULT_LATEX_TEMPLATES_DIR_PATH
10
+ from academia_mcp.pdf import parse_pdf_file
10
11
 
11
12
 
12
13
  def get_latex_templates_list() -> str:
@@ -118,9 +119,11 @@ def compile_latex_from_str(
118
119
  try:
119
120
  subprocess.run(
120
121
  [
121
- "pdflatex",
122
+ "latexmk",
123
+ "-pdf",
122
124
  "-interaction=nonstopmode",
123
125
  "-file-line-error",
126
+ "-diagnostics",
124
127
  tex_filename,
125
128
  ],
126
129
  cwd=str(temp_dir_path),
@@ -133,13 +136,10 @@ def compile_latex_from_str(
133
136
  return f"Compilation timed out after {timeout} seconds"
134
137
  except subprocess.CalledProcessError as e:
135
138
  combined_output = (e.stdout or "") + "\n" + (e.stderr or "")
136
- error_lines = [
137
- line
138
- for line in combined_output.split("\n")
139
- if ("error" in line.lower() or "!" in line)
140
- ]
141
- if error_lines:
142
- return "Compilation failed. LaTeX errors:\n" + "\n".join(error_lines)
139
+ log_path = temp_dir_path / "temp.log"
140
+ if log_path.exists():
141
+ log_content = log_path.read_text(encoding="utf-8", errors="ignore")
142
+ combined_output = combined_output + "\n\ntemp.log content:\n" + log_content
143
143
  return f"Compilation failed. Full LaTeX output:\n{combined_output}"
144
144
 
145
145
  pdf_path = temp_dir_path / pdf_filename
@@ -154,3 +154,16 @@ def compile_latex_from_str(
154
154
  )
155
155
  except Exception as e:
156
156
  return f"Compilation failed due to an unexpected error: {e}"
157
+
158
+
159
+ def read_pdf(pdf_path: str) -> str:
160
+ """
161
+ Read a PDF file to text from the file system.
162
+
163
+ Args:
164
+ pdf_path: The path to the pdf file in the working directory.
165
+
166
+ Returns a JSON-serialized list of strings where each string is a page of the pdf file.
167
+ """
168
+ full_path = Path(get_workspace_dir()) / pdf_path
169
+ return json.dumps(parse_pdf_file(full_path))
@@ -131,8 +131,10 @@ Return the result as a JSON object in the following format:
131
131
  "limitations": "Limitations of the paper",
132
132
  "overall": "Number + short description",
133
133
  "confidence": "Number + short description",
134
- "format_issues": "Format issues",
134
+ "format_issues": "Format issues"
135
135
  }
136
+
137
+ Always produce a correct JSON object.
136
138
  """
137
139
 
138
140
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: academia-mcp
3
- Version: 1.7.3
3
+ Version: 1.8.0
4
4
  Summary: MCP server that provides different tools to search for scientific publications
5
5
  Author-email: Ilya Gusev <phoenixilya@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/IlyaGusev/academia_mcp
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "academia-mcp"
7
- version = "1.7.3"
7
+ version = "1.8.0"
8
8
  description = "MCP server that provides different tools to search for scientific publications"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -7,6 +7,7 @@ from academia_mcp.tools.latex import (
7
7
  compile_latex_from_str,
8
8
  get_latex_template,
9
9
  get_latex_templates_list,
10
+ read_pdf,
10
11
  )
11
12
 
12
13
 
@@ -40,3 +41,23 @@ def test_latex_compile_latex_from_file() -> None:
40
41
  tex_file_path.write_text(template["template"], encoding="utf-8")
41
42
  result = compile_latex_from_file(str(tex_file_path), pdf_filename)
42
43
  assert "Compilation successful" in result
44
+
45
+
46
+ def test_latex_read_pdf() -> None:
47
+ template = json.loads(get_latex_template("agents4science_2025"))
48
+ with tempfile.TemporaryDirectory() as temp_dir:
49
+ temp_dir_path = Path(temp_dir)
50
+ tex_filename = "temp.tex"
51
+ tex_file_path = temp_dir_path / tex_filename
52
+ pdf_filename = "test.pdf"
53
+ tex_file_path.write_text(template["template"], encoding="utf-8")
54
+ compile_latex_from_file(str(tex_file_path), pdf_filename)
55
+ read_result = json.loads(read_pdf(pdf_filename))
56
+ assert read_result
57
+ assert "Page 1" in read_result[0]
58
+
59
+
60
+ def test_latex_compile_latex_error() -> None:
61
+ template = json.loads(get_latex_template("agents4science_2025"))
62
+ result = compile_latex_from_str(template["template"][:100], "test.pdf")
63
+ print(result)
@@ -5,7 +5,6 @@ from academia_mcp.tools import web_search
5
5
 
6
6
  def test_web_search_base() -> None:
7
7
  result = web_search("autoregressive models path-star graphs", limit=20)
8
- assert "The Mystery of the Pathological" in result
9
8
  results = json.loads(result)
10
9
  assert results
11
10
  assert "score" not in str(results)
File without changes
File without changes
File without changes