- Home
- MCP servers
- MCP Server Demo GitHub Login Automation
MCP Server Demo GitHub Login Automation
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"nikhil-kandekar-mcp-server-demo": {
"command": "python",
"args": [
"server.py"
],
"env": {
"GITHUB_PASSWORD": "your-password",
"GITHUB_USERNAME": "your-username"
}
}
}
}This MCP server enables automated GitHub login using Playwright. It exposes a local stdio-based server that you can trigger from an MCP client to perform browser automation tasks securely with credentials you provide via environment variables.
How to use
You run the MCP server locally and connect your MCP client to start the GitHub login automation. The server executes a Playwright script that navigates GitHub, signs you in using credentials you supply through environment variables, and completes the automation workflow.
To trigger the workflow from a client, start the server first and then invoke the corresponding MCP client endpoint or tool that targets this server. The server is designed to run as a local process, so you can manage it alongside your application stack and reuse the same credentials for automated sessions.
How to install
Prerequisites you need before starting:
-
Python 3.8+ installed on your system.
-
A virtual environment tool (recommended): you will create and activate a venv.
-
Access to a terminal or command prompt.
Install and run using these steps:
git clone https://example.org/your-org/mcp-server-demo.git
cd mcp-server-demo
python3 -m venv .venv
source .venv/bin/activate # On Linux/Mac
# .venv\Scripts\activate # On Windows
pip install -r requirements.txt
export GITHUB_USERNAME="your-username"
export GITHUB_PASSWORD="your-password"
# For Windows PowerShell use the following instead of export:
# setx GITHUB_USERNAME "your-username"
# setx GITHUB_PASSWORD "your-password"
Additional configuration and notes
Environment variables you supply are used by the MCP server to perform GitHub login automation. The following variables are recognized:
-
GITHUB_USERNAME: your GitHub username.
-
GITHUB_PASSWORD: your GitHub password.
If you are running in a headless environment, you may need to enable headless mode for Playwright. In environments without a display, you can run the client with xvfb to provide a virtual framebuffer.
# Headless Playwright (example configuration when needed)
# This is typically handled in your Playwright startup and can be set in code or config.
# No extra commands are required here unless you are troubleshooting visuals.
Running the MCP server
Start the server using the Python command shown in the example workflow. This runs the MCP server process locally and waits for client requests.
python server.py
Running the client example
Trigger the GitHub login automation from a client that speaks the MCP protocol. Use your client’s standard method to send a request to the server to initiate the login automation workflow.
python client.py
Development notes
If you run in a headless environment (for example, a CI server), ensure Playwright runs in headless mode. If the environment cannot render a browser at all, use xvfb-run to provide a virtual display when launching the client.
xvfb-run -a python client.py