|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +We'd love to accept your patches and contributions to this project. |
| 4 | + |
| 5 | +## Before you begin |
| 6 | + |
| 7 | +### Sign our Contributor License Agreement |
| 8 | + |
| 9 | +Contributions to this project must be accompanied by a |
| 10 | +[Contributor License Agreement](https://cla.developers.google.com/about) (CLA). |
| 11 | +You (or your employer) retain the copyright to your contribution; this simply |
| 12 | +gives us permission to use and redistribute your contributions as part of the |
| 13 | +project. |
| 14 | + |
| 15 | +If you or your current employer have already signed the Google CLA (even if it |
| 16 | +was for a different project), you probably don't need to do it again. |
| 17 | + |
| 18 | +Visit <https://cla.developers.google.com/> to see your current agreements or to |
| 19 | +sign a new one. |
| 20 | + |
| 21 | +### Review our community guidelines |
| 22 | + |
| 23 | +This project follows |
| 24 | +[Google's Open Source Community Guidelines](https://opensource.google/conduct/). |
| 25 | + |
| 26 | +## Contribution process |
| 27 | + |
| 28 | +### Code reviews |
| 29 | + |
| 30 | +All submissions, including submissions by project members, require review. We |
| 31 | +use GitHub pull requests for this purpose. Consult |
| 32 | +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more |
| 33 | +information on using pull requests. |
| 34 | + |
| 35 | +## Installation |
| 36 | + |
| 37 | +```sh |
| 38 | +git clone https://github.com/ChromeDevTools/chrome-devtools-mcp.git |
| 39 | +cd chrome-devtools-mcp |
| 40 | +npm ci |
| 41 | +npm run build |
| 42 | +``` |
| 43 | + |
| 44 | +### Testing with @modelcontextprotocol/inspector |
| 45 | + |
| 46 | +```sh |
| 47 | +npx @modelcontextprotocol/inspector node build/src/index.js |
| 48 | +``` |
| 49 | + |
| 50 | +### Testing with an MCP client |
| 51 | + |
| 52 | +Add the MCP server to your client's config. |
| 53 | + |
| 54 | +``` |
| 55 | +{ |
| 56 | + "mcpServers": { |
| 57 | + "chrome-devtools": { |
| 58 | + "command": "node", |
| 59 | + "args": ["/path-to/build/src/index.js"], |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +#### Using with VS Code SSH |
| 66 | + |
| 67 | +When running the `@modelcontextprotocol/inspector` it spawns 2 services - one on port `6274` and one on `6277`. |
| 68 | +Usually VS Code automatically detects and forwards `6274` but fails to detect `6277` so you need to manually forward it. |
| 69 | + |
| 70 | +### Debugging |
| 71 | + |
| 72 | +To write debug logs to `log.txt` in the working directory, run with the following commands: |
| 73 | + |
| 74 | +```sh |
| 75 | +npx @modelcontextprotocol/inspector node build/src/index.js --log-file=/your/desired/path/log.txt |
| 76 | +``` |
| 77 | + |
| 78 | +You can use the `DEBUG` environment variable as usual to control categories that are logged. |
0 commit comments