pythonanywhere
MCP server from pythonanywhere/pythonanywhere-mcp-server
claude mcp add --transport stdio pythonanywhere-pythonanywhere-mcp-server uvx pythonanywhere-mcp-server \ --env API_TOKEN="yourpythonanywhereapitoken" \ --env PYTHONANYWHERE_USERNAME="yourpythonanywhereusername"
How to use
This MCP server provides a standardized interface to manage PythonAnywhere resources—files, ASGI/WSGI web apps, and scheduled tasks—via Model Context Protocol clients. It acts as a bridge between language models or automation tools and your PythonAnywhere account, enabling scripted file edits, deployments, and task scheduling with auditability. Clients can list directories, read and upload files, manage ASGI and WSGI apps, and create or modify scheduled tasks through the MCP API exposed by this server. The integration is designed to be safe and auditable, with access controlled by your PythonAnywhere API token and username.
To use it, configure your MCP client (e.g., Claude Code, Copilot in PyCharm, or Cursor) to launch the MCP server using uvx with the appropriate environment variables. Provide the API_TOKEN and PYTHONANYWHERE_USERNAME, then point the client at the pythonanywhere-mcp-server entry. Once connected, you can issue MCP commands like listing a directory, uploading a file, deploying/reloading an ASGI app, or scheduling a task, and the server will perform the actions against your PythonAnywhere account on your behalf.
How to install
Prerequisites:
- Python and uv installed and available in PATH
- Access to a PythonAnywhere account with an API token
- If using eu.pythonanywhere.com, set PYTHONANYWHERE_SITE=eu.pythonanywhere.com
Installation steps:
-
Install the UV client (uvx) if you don't have it yet. This typically comes from the MCP tooling ecosystem; ensure it is available in your PATH.
- Example (pip): python -m pip install uvx (adjust to your environment as needed)
-
Obtain your PythonAnywhere API token from the API section of your account and note your username.
-
Start using the MCP server by configuring the client to run uvx with the server module, providing the required environment variables:
- Set environment variables (example): API_TOKEN=yourpythonanywhereapitoken PYTHONANYWHERE_USERNAME=yourpythonanywhereusername
-
Add the server to your MCP client configuration. For example, in Claude Code or similar tool, refer to the following configuration snippet:
Claude Code / MCP client: claude mcp add pythonanywhere-mcp-server
-e API_TOKEN=yourpythonanywhereapitoken
-e PYTHONANYWHERE_USERNAME=yourpythonanywhereusername
-- uvx pythonanywhere-mcp-server -
In your editor or tooling, ensure the MCP config points to the server name and use the provided command/args to connect.
-
Test by listing a directory or performing a simple read operation to confirm connectivity and permissions.
Additional notes
Tips and caveats:
- Keep your API token secret and rotate it periodically; use environment variables to avoid embedding tokens in config files.
- If your PythonAnywhere account is on the EU site, export PYTHONANYWHERE_SITE=eu.pythonanywhere.com to ensure proper endpoint usage.
- The MCP server exposes operations like file management, ASGI/WSGI app management, and scheduled tasks. Be mindful of security implications when enabling tasks that execute commands; consider using mcp-server-time to throttle or delay actions.
- If you run multiple MCP servers, ensure separate API tokens and usernames per server to minimize risk.
- When debugging, you can directly inspect log files or output to diagnose permission issues or API limitations on PythonAnywhere.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP