pythonanywhere-mcp-server 0.0.6__tar.gz → 0.0.8__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.
- {pythonanywhere_mcp_server-0.0.6/src/pythonanywhere_mcp_server.egg-info → pythonanywhere_mcp_server-0.0.8}/PKG-INFO +2 -2
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/pyproject.toml +2 -2
- pythonanywhere_mcp_server-0.0.8/src/pythonanywhere_mcp_server/__init__.py +1 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/server.py +4 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/tools/webapp.py +3 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8/src/pythonanywhere_mcp_server.egg-info}/PKG-INFO +2 -2
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server.egg-info/requires.txt +1 -1
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_webapp_tools.py +11 -0
- pythonanywhere_mcp_server-0.0.6/src/pythonanywhere_mcp_server/__init__.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/LICENSE +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/README.md +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/setup.cfg +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/__main__.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/tools/__init__.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/tools/file.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/tools/schedule.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server/tools/website.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server.egg-info/SOURCES.txt +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server.egg-info/dependency_links.txt +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server.egg-info/entry_points.txt +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/src/pythonanywhere_mcp_server.egg-info/top_level.txt +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_file_tools.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_schedule_tools.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_server.py +0 -0
- {pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_website_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonanywhere-mcp-server
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: PythonAnywhere Model Context Protocol Server
|
|
5
5
|
Author-email: PythonAnywhere Developers <developers@pythonanywhere.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Classifier: Topic :: Utilities
|
|
|
17
17
|
Requires-Python: >=3.13
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: pythonanywhere-core
|
|
20
|
+
Requires-Dist: pythonanywhere-core>=0.2.9
|
|
21
21
|
Requires-Dist: mcp[cli]
|
|
22
22
|
Provides-Extra: test
|
|
23
23
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonanywhere-mcp-server"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.8"
|
|
8
8
|
description = "PythonAnywhere Model Context Protocol Server"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "PythonAnywhere Developers", email = "developers@pythonanywhere.com"}
|
|
@@ -12,7 +12,7 @@ authors = [
|
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.13"
|
|
14
14
|
dependencies = [
|
|
15
|
-
"pythonanywhere-core",
|
|
15
|
+
"pythonanywhere-core>=0.2.9",
|
|
16
16
|
"mcp[cli]",
|
|
17
17
|
]
|
|
18
18
|
classifiers = [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.8"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
3
|
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
from . import __version__
|
|
4
5
|
from .tools.file import register_file_tools
|
|
5
6
|
from .tools.webapp import register_webapp_tools
|
|
6
7
|
from .tools.website import register_website_tools
|
|
@@ -9,6 +10,9 @@ from .tools.schedule import register_schedule_tools
|
|
|
9
10
|
|
|
10
11
|
def create_server():
|
|
11
12
|
"""Create the MCP server."""
|
|
13
|
+
# Set client identifier for API analytics
|
|
14
|
+
os.environ["PYTHONANYWHERE_CLIENT"] = f"mcp-server/{__version__}"
|
|
15
|
+
|
|
12
16
|
API_TOKEN = os.getenv("API_TOKEN")
|
|
13
17
|
if not API_TOKEN:
|
|
14
18
|
raise RuntimeError("API_TOKEN environment variable must be set.")
|
|
@@ -4,6 +4,7 @@ from mcp.server.fastmcp import FastMCP
|
|
|
4
4
|
|
|
5
5
|
from pythonanywhere_core.webapp import Webapp
|
|
6
6
|
from pythonanywhere_core.base import AuthenticationError, NoTokenError
|
|
7
|
+
from pythonanywhere_core.exceptions import MissingCNAMEException
|
|
7
8
|
|
|
8
9
|
# ToDo: Add the log file functions once pythonanywhere-core webapp log file functions
|
|
9
10
|
# have been improved
|
|
@@ -28,6 +29,8 @@ def register_webapp_tools(mcp: FastMCP) -> None:
|
|
|
28
29
|
try:
|
|
29
30
|
Webapp(domain).reload()
|
|
30
31
|
return f"Webapp '{domain}' reloaded."
|
|
32
|
+
except MissingCNAMEException as exc:
|
|
33
|
+
return f"Webapp '{domain}' reloaded. Note: {str(exc)}"
|
|
31
34
|
except (AuthenticationError, NoTokenError):
|
|
32
35
|
raise RuntimeError("Authentication failed — check API_TOKEN and domain.")
|
|
33
36
|
except Exception as exc:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonanywhere-mcp-server
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: PythonAnywhere Model Context Protocol Server
|
|
5
5
|
Author-email: PythonAnywhere Developers <developers@pythonanywhere.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Classifier: Topic :: Utilities
|
|
|
17
17
|
Requires-Python: >=3.13
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: pythonanywhere-core
|
|
20
|
+
Requires-Dist: pythonanywhere-core>=0.2.9
|
|
21
21
|
Requires-Dist: mcp[cli]
|
|
22
22
|
Provides-Extra: test
|
|
23
23
|
Requires-Dist: pytest; extra == "test"
|
{pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_webapp_tools.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
from pythonanywhere_core.base import AuthenticationError
|
|
4
|
+
from pythonanywhere_core.exceptions import MissingCNAMEException
|
|
4
5
|
|
|
5
6
|
import tools.webapp as webapp_tools
|
|
6
7
|
|
|
@@ -118,3 +119,13 @@ def test_list_webapps(setup_webapp_tools, mocker):
|
|
|
118
119
|
mocker.patch("tools.webapp.Webapp.list_webapps", return_value=expected)
|
|
119
120
|
result = setup_webapp_tools.call_tool("list_webapps", {})
|
|
120
121
|
assert result == expected
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def test_reload_webapp_handles_missing_cname_exception(setup_webapp_tools, mocker):
|
|
125
|
+
mock_webapp = mocker.patch("tools.webapp.Webapp", autospec=True)
|
|
126
|
+
mock_webapp.return_value.reload.side_effect = MissingCNAMEException()
|
|
127
|
+
|
|
128
|
+
result = setup_webapp_tools.call_tool("reload_webapp", {"domain": "test.com"})
|
|
129
|
+
|
|
130
|
+
assert "Webapp 'test.com' reloaded" in result
|
|
131
|
+
assert "CNAME" in result or "cname" in result
|
|
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
|
{pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_file_tools.py
RENAMED
|
File without changes
|
{pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_schedule_tools.py
RENAMED
|
File without changes
|
|
File without changes
|
{pythonanywhere_mcp_server-0.0.6 → pythonanywhere_mcp_server-0.0.8}/tests/test_website_tools.py
RENAMED
|
File without changes
|