11# PythonAnywhere Model Context Protocol Server
22
3- A [ Model Context Protocol (MCP)] ( https://modelcontextprotocol.io/introduction )
4- server acts as a bridge between AI-powered tools and your
5- [ PythonAnywhere] ( https://www.pythonanywhere.com/ ) account, enabling secure,
6- programmatic management of files, websites, webapps, and scheduled tasks. By
7- exposing a standardized interface, it allows language models and automation
8- clients to perform operations—such as editing files, deploying web apps, or
3+ A [ Model Context Protocol (MCP)] ( https://modelcontextprotocol.io/introduction )
4+ server acts as a bridge between AI-powered tools and your
5+ [ PythonAnywhere] ( https://www.pythonanywhere.com/ ) account, enabling secure,
6+ programmatic management of files, websites, webapps, and scheduled tasks. By
7+ exposing a standardized interface, it allows language models and automation
8+ clients to perform operations—such as editing files, deploying web apps, or
99scheduling jobs -- on your behalf, all while maintaining fine-grained control
1010and auditability.
1111
1212## Features
13- - ** File management** : Read, upload, delete files and list directory trees.
13+ - ** File management** : Read, upload, delete files and list directory trees.
1414 _ (also enables debugging with direct access to log files, which are just
1515 files on PythonAnywhere)_
1616- ** ASGI Web app management** : Create, delete, reload, and list.
17- _ (as described in the [ PythonAnywhere ASGI
17+ _ (as described in the [ PythonAnywhere ASGI
1818 documentation] ( https://help.pythonanywhere.com/pages/ASGICommandLine ) )_
1919- ** WSGI Web app management** : Reload only _ (at the moment)_ .
2020- ** Scheduled task management** : List, create, update, and delete.
21- _ (Note that this enables LLMs to execute arbitrary commands if a task is
22- scheduled to soon after creation and deleted after execution. For that we
21+ _ (Note that this enables LLMs to execute arbitrary commands if a task is
22+ scheduled too soon after creation and deleted after execution. For that we
2323 would suggest running it with [ mcp-server-time] ( https://pypi.org/project/mcp-server-time/ )
2424 as models easily get confused about time.)_
2525
2626## Installation
27- The MCP protocol is well-defined and supported by various clients, but
28- installation is different depending on the client you are using. We will
27+ The MCP protocol is well-defined and supported by various clients, but
28+ installation is different depending on the client you are using. We will
2929cover cases that we tried and tested.
3030
3131In all cases, you need to have ` uv ` installed and available in your ` PATH ` .
3232
33- Have your PythonAnywhere API token and username ready. You can find (or
34- generate) your API token in the [ API section of your PythonAnywhere
33+ Have your PythonAnywhere API token and username ready. You can find (or
34+ generate) your API token in the [ API section of your PythonAnywhere
3535account] ( https://www.pythonanywhere.com/account/#api_token ) .
3636
3737### Desktop Extension - works with Claude Desktop
38- Probably the most straightforward way to install the MCP server is to use
38+ Probably the most straightforward way to install the MCP server is to use
3939the [ desktop extension] ( https://github.com/anthropics/dxt/ ) for Claude Desktop.
4040
41411 . Open Claude Desktop.
@@ -73,7 +73,7 @@ Add it to your `mcp.json`.
7373```
7474
7575### Claude Desktop (manual setup) and Cursor:
76- Add it to ` claude_desktop_config.json ` (for Claude Desktop) or (` mcp.json `
76+ Add it to ` claude_desktop_config.json ` (for Claude Desktop) or (` mcp.json `
7777for Cursor).
7878
7979``` json
@@ -94,20 +94,20 @@ for Cursor).
9494
9595## Caveats
9696
97- Direct integration of an LLM with your PythonAnywhere account offers
98- significant capabilities, but also introduces risks. We strongly advise
99- maintaining human oversight, especially for sensitive actions such as
97+ Direct integration of an LLM with your PythonAnywhere account offers
98+ significant capabilities, but also introduces risks. We strongly advise
99+ maintaining human oversight, especially for sensitive actions such as
100100modifying or deleting files.
101101
102- If you are running multiple MCP servers simultaneously, be
102+ If you are running multiple MCP servers simultaneously, be
103103cautious -- particularly if any server can access external resources you do not
104- control, such as GitHub issues. These can become attack vectors. For more
104+ control, such as GitHub issues. These can become attack vectors. For more
105105details, see [ this story] ( https://simonwillison.net/2025/Jul/6/supabase-mcp-lethal-trifecta/ ) .
106106
107107## Implementation
108108
109- The server uses the [ python mcp sdk] ( https://github.com/modelcontextprotocol/python-sdk )
110- in connection with the [ pythonanywhere-core] ( https://github.com/pythonanywhere/pythonanywhere-core )
111- package ([ docs] ( https://core.pythonanywhere.com/ ) ), which wraps a subset of the [ PythonAnywhere
112- API] ( https://help.pythonanywhere.com/pages/API/ ) and may be expanded in
109+ The server uses the [ python mcp sdk] ( https://github.com/modelcontextprotocol/python-sdk )
110+ in connection with the [ pythonanywhere-core] ( https://github.com/pythonanywhere/pythonanywhere-core )
111+ package ([ docs] ( https://core.pythonanywhere.com/ ) ), which wraps a subset of the [ PythonAnywhere
112+ API] ( https://help.pythonanywhere.com/pages/API/ ) and may be expanded in
113113the future as needed.
0 commit comments