academia-mcp 1.7.3__py3-none-any.whl → 1.8.0__py3-none-any.whl

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.
academia_mcp/server.py CHANGED
@@ -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,26 +4,26 @@ academia_mcp/files.py,sha256=tvt3OPr5q6pAPCZ0XvRHHL9ZWuTXINRZvqjeRFmx5YE,815
4
4
  academia_mcp/llm.py,sha256=E0TjWUCjo2q3lONyWMxdppX72m6BdCjsZk-vFLRvGyo,1003
5
5
  academia_mcp/pdf.py,sha256=9PlXzHGhb6ay3ldbTdxCcTWvH4TkET3bnb64mgoh9i0,1273
6
6
  academia_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- academia_mcp/server.py,sha256=ZAd-sunkEkka6snOlzgLCMaIQCzstiXP1pFlo20oyvA,3195
7
+ academia_mcp/server.py,sha256=h6mhYHnWxIROhFS9D4E8bQZTvtEv6bYBx3EikQMScDE,3239
8
8
  academia_mcp/utils.py,sha256=P9U3RjYzcztE0KxXvJSy5wSBaUg2CM9tpByljYrsrl4,4607
9
9
  academia_mcp/latex_templates/agents4science_2025/agents4science_2025.sty,sha256=hGcEPCYBJS4vdhWvN_yEaJC4GvT_yDroI94CfY2Oguk,12268
10
10
  academia_mcp/latex_templates/agents4science_2025/agents4science_2025.tex,sha256=Tl1QkHXHRopw9VEfWrD3Layr5JP_0gIzVQjL4KXIWqc,15814
11
- academia_mcp/tools/__init__.py,sha256=nzMOzrIPVSXA3LQa02GPeX9SfAmg9f6_eZY97ALLNs4,1245
11
+ academia_mcp/tools/__init__.py,sha256=9_fyy1OjMh8AAElBU-KF78rF6WPEJruqAxGZxbGfq6Q,1275
12
12
  academia_mcp/tools/anthology_search.py,sha256=rhFpJZqGLABgr0raDuH0CARBiAJNJtEI4dlMrKNHfDQ,7669
13
13
  academia_mcp/tools/arxiv_download.py,sha256=gBY0_Kz0yGtVkLMwn6GrAyfBjovZVgcSMuyy67p65Cw,10474
14
14
  academia_mcp/tools/arxiv_search.py,sha256=pzM18qrF3QL03A53w003kE7hQi3s3QKtjgw0m7K88UY,8355
15
15
  academia_mcp/tools/bitflip.py,sha256=eihmNk_C_8ZkBcjtJYH6MvZ0rItgIlvHHA0eGLxsvRs,12276
16
16
  academia_mcp/tools/document_qa.py,sha256=t9mygYQ7AFIAPiha1nZ-y043luQlkTCBdWb_SDnzEsE,2444
17
17
  academia_mcp/tools/hf_datasets_search.py,sha256=KiBkqT4rXjEN4oc1AWZOPnqN_Go90TQogY5-DUm3LQo,2854
18
- academia_mcp/tools/latex.py,sha256=llxxjBMHzDX4iNMeJSLuiP_sXT4umtYVyyhfZq2derM,5936
18
+ academia_mcp/tools/latex.py,sha256=YzXS1mWBWSLm0ta35z9r8IBw36MkDAhCZR73-yxBVL0,6384
19
19
  academia_mcp/tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- academia_mcp/tools/review.py,sha256=LbebOHGs76qoSgWvTQ9Uj1fvmjc2eSBudX6n_zCINYI,10247
20
+ academia_mcp/tools/review.py,sha256=9lMMELiRNVpiETqtFEHk551LaFuf1LYx0gXD5Sn7Ve0,10285
21
21
  academia_mcp/tools/s2_citations.py,sha256=XZ3a4rsovAiI_D_kIy0GddRHSjpC5Fa_CS8dmB9Qftg,4902
22
22
  academia_mcp/tools/visit_webpage.py,sha256=OZdqDkVPIbANyFw5o5jIjU5Rr_dolxrGDs63Ud-GmRM,1966
23
23
  academia_mcp/tools/web_search.py,sha256=mobKm4iqKppn8pduZYMzWRo1MQBjkAqmMtrFLI5XY2Y,6296
24
- academia_mcp-1.7.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
- academia_mcp-1.7.3.dist-info/METADATA,sha256=uSv_PP7sCjZUnLsGNBigsa0zd-SNkK3ohtsqCizdobg,3714
26
- academia_mcp-1.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- academia_mcp-1.7.3.dist-info/entry_points.txt,sha256=gxkiKJ74w2FwJpSECpjA3XtCfI5ZfrM6N8cqnwsq4yY,51
28
- academia_mcp-1.7.3.dist-info/top_level.txt,sha256=CzGpRFsRRJRqWEb1e3SUlcfGqRzOxevZGaJWrtGF8W0,13
29
- academia_mcp-1.7.3.dist-info/RECORD,,
24
+ academia_mcp-1.8.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
+ academia_mcp-1.8.0.dist-info/METADATA,sha256=JXEcHr35uJesDQKJ8mVRVRibsMoUAsL-DDozz-NJlAk,3714
26
+ academia_mcp-1.8.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ academia_mcp-1.8.0.dist-info/entry_points.txt,sha256=gxkiKJ74w2FwJpSECpjA3XtCfI5ZfrM6N8cqnwsq4yY,51
28
+ academia_mcp-1.8.0.dist-info/top_level.txt,sha256=CzGpRFsRRJRqWEb1e3SUlcfGqRzOxevZGaJWrtGF8W0,13
29
+ academia_mcp-1.8.0.dist-info/RECORD,,