academia-mcp 1.9.1__tar.gz → 1.9.2__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.
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/PKG-INFO +1 -1
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/server.py +2 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/__init__.py +2 -0
- academia_mcp-1.9.2/academia_mcp/tools/show_image.py +41 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp.egg-info/PKG-INFO +1 -1
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp.egg-info/SOURCES.txt +2 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/pyproject.toml +1 -1
- academia_mcp-1.9.2/tests/test_show_image.py +25 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/LICENSE +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/README.md +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/__init__.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/__main__.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/files.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/latex_templates/agents4science_2025/agents4science_2025.sty +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/latex_templates/agents4science_2025/agents4science_2025.tex +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/llm.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/pdf.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/py.typed +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/settings.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/anthology_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/arxiv_download.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/arxiv_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/bitflip.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/document_qa.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/hf_datasets_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/latex.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/py.typed +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/review.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/s2.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/visit_webpage.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/tools/web_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp/utils.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp.egg-info/dependency_links.txt +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp.egg-info/entry_points.txt +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp.egg-info/requires.txt +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/academia_mcp.egg-info/top_level.txt +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/setup.cfg +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_anthology_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_arxiv_download.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_arxiv_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_bitflip.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_document_qa.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_extract_json.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_hf_dataset_search.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_latex.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_review.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_s2.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_visit_webpage.py +0 -0
- {academia_mcp-1.9.1 → academia_mcp-1.9.2}/tests/test_web_search.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: academia-mcp
|
3
|
-
Version: 1.9.
|
3
|
+
Version: 1.9.2
|
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
|
@@ -38,6 +38,7 @@ from academia_mcp.tools.bitflip import (
|
|
38
38
|
score_research_proposals,
|
39
39
|
)
|
40
40
|
from academia_mcp.tools.review import review_pdf_paper, download_pdf_paper
|
41
|
+
from academia_mcp.tools.show_image import show_image
|
41
42
|
|
42
43
|
|
43
44
|
def configure_uvicorn_style_logging(level: int = logging.INFO) -> None:
|
@@ -87,6 +88,7 @@ def run(
|
|
87
88
|
server.add_tool(get_latex_template)
|
88
89
|
server.add_tool(get_latex_templates_list)
|
89
90
|
server.add_tool(visit_webpage)
|
91
|
+
server.add_tool(show_image)
|
90
92
|
|
91
93
|
if settings.WORKSPACE_DIR:
|
92
94
|
server.add_tool(compile_latex)
|
@@ -14,6 +14,7 @@ from .web_search import web_search, tavily_web_search, exa_web_search, brave_web
|
|
14
14
|
from .visit_webpage import visit_webpage
|
15
15
|
from .bitflip import extract_bitflip_info, generate_research_proposals, score_research_proposals
|
16
16
|
from .review import review_pdf_paper, download_pdf_paper, review_pdf_paper_by_url
|
17
|
+
from .show_image import show_image
|
17
18
|
|
18
19
|
__all__ = [
|
19
20
|
"arxiv_search",
|
@@ -40,4 +41,5 @@ __all__ = [
|
|
40
41
|
"review_pdf_paper_by_url",
|
41
42
|
"download_pdf_paper",
|
42
43
|
"read_pdf",
|
44
|
+
"show_image",
|
43
45
|
]
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import base64
|
2
|
+
from pathlib import Path
|
3
|
+
from io import BytesIO
|
4
|
+
from typing import Dict
|
5
|
+
|
6
|
+
import httpx
|
7
|
+
from PIL import Image
|
8
|
+
|
9
|
+
from academia_mcp.files import get_workspace_dir
|
10
|
+
from academia_mcp.settings import settings
|
11
|
+
|
12
|
+
|
13
|
+
def show_image(path: str) -> Dict[str, str]:
|
14
|
+
"""
|
15
|
+
Reads an image from the specified URL or from the current work directory.
|
16
|
+
Always call this function at the end of the code block.
|
17
|
+
For instance:
|
18
|
+
```python
|
19
|
+
show_image("https://example.com/image.png")
|
20
|
+
```
|
21
|
+
Do not print it ever, just return as the last expression.
|
22
|
+
|
23
|
+
Returns an dictionary with a single "image" key.
|
24
|
+
Args:
|
25
|
+
url: Path to file inside current work directory or web URL
|
26
|
+
"""
|
27
|
+
if path.startswith("http"):
|
28
|
+
response = httpx.get(path, timeout=10)
|
29
|
+
response.raise_for_status()
|
30
|
+
image = Image.open(BytesIO(response.content))
|
31
|
+
else:
|
32
|
+
assert settings.WORKSPACE_DIR is not None, "WORKSPACE_DIR is not set"
|
33
|
+
full_path = Path(path)
|
34
|
+
if not full_path.exists():
|
35
|
+
full_path = Path(get_workspace_dir()) / path
|
36
|
+
assert full_path.exists(), f"Image file {path} does not exist"
|
37
|
+
image = Image.open(str(full_path))
|
38
|
+
buffer_io = BytesIO()
|
39
|
+
image.save(buffer_io, format="PNG")
|
40
|
+
img_bytes = buffer_io.getvalue()
|
41
|
+
return {"image_base64": base64.b64encode(img_bytes).decode("utf-8")}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: academia-mcp
|
3
|
-
Version: 1.9.
|
3
|
+
Version: 1.9.2
|
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
|
@@ -29,6 +29,7 @@ academia_mcp/tools/latex.py
|
|
29
29
|
academia_mcp/tools/py.typed
|
30
30
|
academia_mcp/tools/review.py
|
31
31
|
academia_mcp/tools/s2.py
|
32
|
+
academia_mcp/tools/show_image.py
|
32
33
|
academia_mcp/tools/visit_webpage.py
|
33
34
|
academia_mcp/tools/web_search.py
|
34
35
|
tests/test_anthology_search.py
|
@@ -41,5 +42,6 @@ tests/test_hf_dataset_search.py
|
|
41
42
|
tests/test_latex.py
|
42
43
|
tests/test_review.py
|
43
44
|
tests/test_s2.py
|
45
|
+
tests/test_show_image.py
|
44
46
|
tests/test_visit_webpage.py
|
45
47
|
tests/test_web_search.py
|
@@ -0,0 +1,25 @@
|
|
1
|
+
from io import BytesIO
|
2
|
+
|
3
|
+
import httpx
|
4
|
+
from PIL import Image
|
5
|
+
|
6
|
+
from academia_mcp.tools import show_image
|
7
|
+
from academia_mcp.files import get_workspace_dir
|
8
|
+
|
9
|
+
|
10
|
+
def test_show_image_base(test_image_url: str) -> None:
|
11
|
+
result = show_image(test_image_url)
|
12
|
+
assert result is not None
|
13
|
+
assert "image_base64" in result
|
14
|
+
assert result["image_base64"] is not None
|
15
|
+
|
16
|
+
|
17
|
+
def test_show_image_local(test_image_url: str) -> None:
|
18
|
+
response = httpx.get(test_image_url, timeout=10)
|
19
|
+
response.raise_for_status()
|
20
|
+
image = Image.open(BytesIO(response.content))
|
21
|
+
image.save(get_workspace_dir() / "test_image.png")
|
22
|
+
result = show_image("test_image.png")
|
23
|
+
assert result is not None
|
24
|
+
assert "image_base64" in result
|
25
|
+
assert result["image_base64"] is not None
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|