|
| 1 | +# 🚀 Contributing to the Browserstack MCP Server |
| 2 | + |
| 3 | +This guide will help you set up your environment and contribute effectively to the MCP (Model Context Protocol) Server. |
| 4 | + |
| 5 | +## ✅ Prerequisites |
| 6 | + |
| 7 | +Make sure you have the following installed: |
| 8 | + |
| 9 | +- 🟢 [Node.js](https://nodejs.org/) (Recommended: LTS v22.15.0) |
| 10 | +- 🤖 GitHub Copilot (for VS Code or Cursor) |
| 11 | +- 🧠 Optionally, [Claude desktop app](https://www.anthropic.com/index/claude-desktop) for additional AI assistance |
| 12 | + |
| 13 | +## 🛠 Getting Started |
| 14 | + |
| 15 | +1. **Clone the repository:** |
| 16 | + |
| 17 | + ```bash |
| 18 | + git clone https://github.com/browserstack/mcp-server.git |
| 19 | + cd mcp-server |
| 20 | + ``` |
| 21 | + |
| 22 | +2. **Build the project:** |
| 23 | + |
| 24 | + ```bash |
| 25 | + npm run build |
| 26 | + ``` |
| 27 | + |
| 28 | + This compiles the TypeScript source code and generates `dist/index.js`. |
| 29 | + |
| 30 | +3. **Configure MCP for your editor:** |
| 31 | + |
| 32 | +### 💻 VS Code: `.vscode/mcp.json` |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "servers": { |
| 37 | + "browserstack": { |
| 38 | + "command": "node", |
| 39 | + "args": ["FULL PATH TO dist/index.js"], |
| 40 | + "env": { |
| 41 | + "BROWSERSTACK_USERNAME": "<your_username>", |
| 42 | + "BROWSERSTACK_ACCESS_KEY": "<your_access_key>" |
| 43 | + } |
| 44 | + } |
| 45 | + } |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### 🖱 Cursor: `.cursor/mcp.json` |
| 50 | + |
| 51 | +```json |
| 52 | +{ |
| 53 | + "mcpServers": { |
| 54 | + "browserstack": { |
| 55 | + "command": "node", |
| 56 | + "args": ["FULL PATH TO dist/index.js"], |
| 57 | + "env": { |
| 58 | + "BROWSERSTACK_USERNAME": "<your_username>", |
| 59 | + "BROWSERSTACK_ACCESS_KEY": "<your_access_key>" |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +### 🔨 Quick Start from VS Code or Cursor |
| 67 | + |
| 68 | +When you open your `.vscode/mcp.json` or `.cursor/mcp.json` file, |
| 69 | +you'll see a **"play" icon** (Start ▶️) next to the server configuration. |
| 70 | +**Click it to instantly start your MCP server!** |
| 71 | + |
| 72 | + |
| 73 | +## 🧪 How to Test with MCP Inspector |
| 74 | + |
| 75 | +**MCP Inspector** is a lightweight tool for launching, testing, and validating MCP server implementations easily. |
| 76 | + |
| 77 | +### 🔹 Run with Config |
| 78 | + |
| 79 | +If you've configured `.cursor/mcp.json` or `.vscode/mcp.json`, you can start testing by running: |
| 80 | + |
| 81 | +```bash |
| 82 | +npx @modelcontextprotocol/inspector --config /PATH_TO_CONFIG/.cursor/mcp.json --server browserstack |
| 83 | +``` |
| 84 | + |
| 85 | +This will spin up your MCP server and open the Inspector at: |
| 86 | +[http://127.0.0.1:6274](http://127.0.0.1:6274) |
| 87 | + |
| 88 | +<div align="center"> |
| 89 | +<img src="assets/mcp-inspector.png" alt="MCP Inspector UI" height="300"> |
| 90 | +</div> |
| 91 | + |
| 92 | +Inside the Inspector: |
| 93 | + |
| 94 | +- View and manage your server connection (restart, disconnect, etc.) |
| 95 | +- Validate your server credentials and environment variables |
| 96 | +- Access available tools under the **"Middle Tab"**, and run tests to see results in the **Right Panel** |
| 97 | +- Review past interactions easily via the **History Panel** |
| 98 | + |
| 99 | +Additionally, for every MCP server session, a log file is automatically generated at: |
| 100 | +`~/Library/Logs/Claude/` — you can check detailed logs there if needed. |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## ✨ Next Steps |
| 105 | + |
| 106 | +🌀 Fork the repository to your GitHub account |
| 107 | + |
| 108 | +🧩 Add tests to verify your contributions |
| 109 | + |
| 110 | +🤖 Explore and interact with the server using Copilot, Cursor, or Claude |
| 111 | + |
| 112 | +📬 Raise a pull request from your fork once you're ready! |
0 commit comments