
一个模型背景协议(MCP)服务器充当了AI驱动工具与您 PythonAnywhere 账户之间的桥梁,使文件,网站,网络应用程序和排程得以安全,程序管理. .
概览
一个模型背景协议服务器充当了AI驱动工具与您 PythonAnywhere 账户之间的桥梁,能够对文件、网站、网络应用程序和预定任务进行安全、程序管理。 通过曝光一个标准化的界面,它允许语言模型和自动化客户端代表您执行操作——例如编辑文件,部署网络应用程序,或安排工作,同时保持精细的控制和可审计性. - :读取,上传,删除文件和列表目录树. (也允许直接访问日志文件进行调试,这些文件只是PythonAnywhere上的文件) -:创建,删除,再装入,和列表. (如PythonAnywhere ASGI文档所描述) - :创建,删除,再装入,补丁,列表,并获取信息. - 列出、创建、更新和删除。 (注意, 如果任务在创建后排得太快, 并且执行后删除, 这使得 LLMs 能够执行任意命令 .
概述(AI 翻译)
示范背景协议 服务器充当 AI 驱动工具与您的 任何账户,安全, 对文件、网站、网络应用程序和计划任务进行程序管理。 以 曝光标准化接口,它允许语言模型和自动化 执行操作的客户端——如编辑文件、部署网络应用程序,或 工作日程安排 – – 代表您,同时保持精细控制 和可审计性。
□ 特性
- ** 财务管理**: 读取,上传,删除文件和列表目录树. (还允许直接访问日志文件进行调试,这些文件只是 Python 任何地方的文件)
- ASGI网络应用管理: 创建、删除、重新装入和列表。 (如Python中描述的,无论哪里有ASGI) 页:1
- WSGI网络应用程序管理: 创建、删除、重新装入、补丁、列表并获取 信息输入。
- ** 排定的任务管理**: 列出、创建、更新和删除。 (注意如果一个任务是 LLMs , 它可以执行任意命令) 设定后安排得太快,执行后删除。 为此,我们 提议用Mcp服务器时间运行 作为模型很容易对时间产生混淆. )
□ 安装
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
PythonAnywhere Model Context Protocol Server
A Model Context Protocol (MCP) server acts as a bridge between AI-powered tools and your PythonAnywhere account, enabling secure, programmatic management of files, websites, webapps, and scheduled tasks. By exposing a standardized interface, it allows language models and automation clients to perform operations—such as editing files, deploying web apps, or scheduling jobs – on your behalf, all while maintaining fine-grained control and auditability.
Features
- File management: Read, upload, delete files and list directory trees. (also enables debugging with direct access to log files, which are just files on PythonAnywhere)
- ASGI Web app management: Create, delete, reload, and list. (as described in the PythonAnywhere ASGI documentation)
- WSGI Web app management: Create, delete, reload, patch, list, and get info.
- Scheduled task management: List, create, update, and delete. (Note that this enables LLMs to execute arbitrary commands if a task is scheduled too soon after creation and deleted after execution. For that we would suggest running it with mcp-server-time as models easily get confused about time.)
Installation
The MCP protocol is well-defined and supported by various clients, but installation is different depending on the client you are using. We will cover cases that we tried and tested.
In all cases, you need to have uv installed and available in your PATH.
Have your PythonAnywhere API token and username ready. You can find (or generate) your API token in the API section of your PythonAnywhere account.
If your account is on eu.pythonanywhere.com, you also need to set
PYTHONANYWHERE_SITE to eu.pythonanywhere.com (it defaults to
www.pythonanywhere.com).
MCP Bundle - works with Claude Desktop
Probably the most straightforward way to install the MCP server is to use the MCP Bundle for Claude Desktop.
- Open Claude Desktop.
- Download the latest .mcpb file.
- Double-click on the downloaded .dxt file or drag the file into the window.
- Configure your PythonAnywhere API token and username.
- Restart Claude Desktop.
Claude Code
Run:
claude mcp add pythonanywhere-mcp-server \
-e API_TOKEN=yourpythonanywhereapitoken \
-e PYTHONANYWHERE_USERNAME=yourpythonanywhereusername \
-- uvx pythonanywhere-mcp-server
GitHub Copilot in PyCharm:
Add it to your mcp.json.
{
"servers": {
"pythonanywhere-mcp-server": {
"type": "stdio",
"command": "uvx",
安装
uvx pythonanywhere-mcp-server配置
{
"mcpServers": {
"pythonanywhere-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": ["pythonanywhere-mcp-server"],
"env": {
"API_TOKEN": "yourpythonanywhereapitoken",
"PYTHONANYWHERE_USERNAME": "yourpythonanywhereusername"
}
}
}
}