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 wh
Add this skill
npx mdskills install pythonanywhere/pythonanywhere-mcp-serverWell-documented MCP server for PythonAnywhere with comprehensive installation guides and clear security warnings
1# PythonAnywhere Model Context Protocol Server23A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)4server acts as a bridge between AI-powered tools and your5[PythonAnywhere](https://www.pythonanywhere.com/) account, enabling secure,6programmatic management of files, websites, webapps, and scheduled tasks. By7exposing a standardized interface, it allows language models and automation8clients to perform operations—such as editing files, deploying web apps, or9scheduling jobs -- on your behalf, all while maintaining fine-grained control10and auditability.1112## Features13- **File management**: Read, upload, delete files and list directory trees.14 _(also enables debugging with direct access to log files, which are just15 files on PythonAnywhere)_16- **ASGI Web app management**: Create, delete, reload, and list.17 _(as described in the [PythonAnywhere ASGI18 documentation](https://help.pythonanywhere.com/pages/ASGICommandLine))_19- **WSGI Web app management**: Reload only _(at the moment)_.20- **Scheduled task management**: List, create, update, and delete.21 _(Note that this enables LLMs to execute arbitrary commands if a task is22 scheduled too soon after creation and deleted after execution. For that we23 would suggest running it with [mcp-server-time](https://pypi.org/project/mcp-server-time/)24 as models easily get confused about time.)_2526## Installation27The MCP protocol is well-defined and supported by various clients, but28installation is different depending on the client you are using. We will29cover cases that we tried and tested.3031In all cases, you need to have `uv` installed and available in your `PATH`.3233Have your PythonAnywhere API token and username ready. You can find (or34generate) your API token in the [API section of your PythonAnywhere35account](https://www.pythonanywhere.com/account/#api_token).3637If your account is on `eu.pythonanywhere.com`, you also need to set38`PYTHONANYWHERE_SITE` to `eu.pythonanywhere.com` (it defaults to39`www.pythonanywhere.com`).4041### MCP Bundle - works with Claude Desktop42Probably the most straightforward way to install the MCP server is to use43the [MCP Bundle](https://github.com/modelcontextprotocol/mcpb) for Claude Desktop.44451. Open Claude Desktop.462. **[Download the latest .mcpb file](https://github.com/pythonanywhere/pythonanywhere-mcp-server/releases/latest/download/pythonanywhere-mcp-server.mcpb)**.473. Double-click on the downloaded .dxt file or drag the file into the window.484. Configure your PythonAnywhere API token and username.495. Restart Claude Desktop.5051### Claude Code52Run:53 ```bash54 claude mcp add pythonanywhere-mcp-server \55 -e API_TOKEN=yourpythonanywhereapitoken \56 -e PYTHONANYWHERE_USERNAME=yourpythonanywhereusername \57 -- uvx pythonanywhere-mcp-server58 ```5960### GitHub Copilot in PyCharm:61Add it to your `mcp.json`.6263```json64{65 "servers": {66 "pythonanywhere-mcp-server": {67 "type": "stdio",68 "command": "uvx",69 "args": ["pythonanywhere-mcp-server"],70 "env": {71 "API_TOKEN": "yourpythonanywhereapitoken",72 "PYTHONANYWHERE_USERNAME": "yourpythonanywhereusername"73 }74 }75 }76}77```7879### Claude Desktop (manual setup) and Cursor:80Add it to `claude_desktop_config.json` (for Claude Desktop) or (`mcp.json`81for Cursor).8283```json84{85 "mcpServers": {86 "pythonanywhere-mcp-server": {87 "type": "stdio",88 "command": "uvx",89 "args": ["pythonanywhere-mcp-server"],90 "env": {91 "API_TOKEN": "yourpythonanywhereapitoken",92 "PYTHONANYWHERE_USERNAME": "yourpythonanywhereusername"93 }94 }95 }96}97```9899## Caveats100101Direct integration of an LLM with your PythonAnywhere account offers102significant capabilities, but also introduces risks. We strongly advise103maintaining human oversight, especially for sensitive actions such as104modifying or deleting files.105106If you are running multiple MCP servers simultaneously, be107cautious -- particularly if any server can access external resources you do not108control, such as GitHub issues. These can become attack vectors. For more109details, see [this story](https://simonwillison.net/2025/Jul/6/supabase-mcp-lethal-trifecta/).110111## Implementation112113The server uses the [python mcp sdk](https://github.com/modelcontextprotocol/python-sdk)114in connection with the [pythonanywhere-core](https://github.com/pythonanywhere/pythonanywhere-core)115package ([docs](https://core.pythonanywhere.com/)), which wraps a subset of the [PythonAnywhere116API](https://help.pythonanywhere.com/pages/API/) and may be expanded in117the future as needed.118
Full transparency — inspect the skill content before installing.