Skip to content

Commit 6b73667

Browse files
committed
Initial commit.
0 parents  commit 6b73667

29 files changed

+39915
-0
lines changed

.dxtignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Virtual environment
2+
.venv/
3+
__pycache__/
4+
*.pyc
5+
*.pyo
6+
*.pyd
7+
8+
# Build artifacts
9+
.egg-info/
10+
chrome_devtools_mcp.egg-info/
11+
build/
12+
dist/
13+
14+
# Cache directories
15+
.ruff_cache/
16+
.mypy_cache/
17+
.pytest_cache/
18+
19+
# IDE and editor files
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
*~
25+
26+
# OS files
27+
.DS_Store
28+
Thumbs.db
29+
30+
# Test files
31+
test_*.py
32+
*_test.py
33+
run_tests.py
34+
test_requirements.txt
35+
36+
# Development files
37+
.env
38+
.env.example
39+
.env.local
40+
mcp.json
41+
.claude/
42+
43+
# Documentation
44+
docs/
45+
README.md
46+
47+
# Git
48+
.git/
49+
.gitignore
50+
51+
# UV lock file (too large for distribution)
52+
uv.lock
53+
54+
# Development icons
55+
icon.svg

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Chrome DevTools MCP Configuration
2+
CHROME_DEBUG_PORT=9222
3+
4+
# Optional: Set log level for debugging
5+
# LOG_LEVEL=INFO
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Build Chrome DevTools Extension
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.10'
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '18'
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v3
30+
31+
- name: Install Python dependencies
32+
run: uv sync
33+
34+
- name: Install DXT packaging tools
35+
run: npm install -g @anthropic-ai/dxt
36+
37+
- name: Run linting
38+
run: uv run ruff check .
39+
40+
- name: Run type checking
41+
run: uv run mypy src/
42+
43+
- name: Run tests
44+
run: uv run python -m pytest test_devtools_server.py -v
45+
46+
- name: Package extension
47+
run: npx @anthropic-ai/dxt pack
48+
49+
- name: Upload extension artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: chrome-devtools-protocol-extension
53+
path: chrome-devtools-protocol-*.dxt
54+
retention-days: 30
55+
56+
release:
57+
if: startsWith(github.ref, 'refs/tags/v')
58+
needs: build
59+
runs-on: ubuntu-latest
60+
permissions:
61+
contents: write
62+
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v4
66+
67+
- name: Set up Node.js
68+
uses: actions/setup-node@v4
69+
with:
70+
node-version: '18'
71+
72+
- name: Install DXT packaging tools
73+
run: npm install -g @anthropic-ai/dxt
74+
75+
- name: Package extension for release
76+
run: npx @anthropic-ai/dxt pack
77+
78+
- name: Create Release
79+
uses: softprops/action-gh-release@v1
80+
with:
81+
files: chrome-devtools-protocol-*.dxt
82+
draft: false
83+
prerelease: false
84+
generate_release_notes: true
85+
body: |
86+
## Chrome DevTools Protocol Extension v${{ github.ref_name }}
87+
88+
### Installation
89+
1. Download the `.dxt` file from this release
90+
2. Open Claude Desktop
91+
3. Go to Extensions and install the downloaded file
92+
93+
### Features
94+
- Start Chrome with debugging enabled
95+
- Monitor network requests and responses
96+
- Inspect console logs and errors
97+
- Analyze page performance metrics
98+
- Execute JavaScript in browser context
99+
- Navigate and control browser programmatically
100+
101+
### Usage
102+
After installation, you can use commands like:
103+
- `start_chrome_and_connect("localhost:3000")` - Connect to your web app
104+
- `get_network_requests()` - View HTTP traffic
105+
- `get_console_error_summary()` - Analyze JavaScript errors
106+
107+
For full documentation, see the repository README.
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
env/
8+
venv/
9+
.venv/
10+
ENV/
11+
env.bak/
12+
venv.bak/
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
*.manifest
35+
*.spec
36+
37+
# Testing
38+
.coverage
39+
.pytest_cache/
40+
.tox/
41+
htmlcov/
42+
43+
# IDE
44+
.vscode/
45+
.idea/
46+
*.swp
47+
*.swo
48+
*~
49+
50+
# OS
51+
.DS_Store
52+
.DS_Store?
53+
._*
54+
.Spotlight-V100
55+
.Trashes
56+
ehthumbs.db
57+
Thumbs.db
58+
59+
# UV
60+
# uv.lock
61+
62+
# Cache directories
63+
.mypy_cache/
64+
.ruff_cache/
65+
66+
# Temporary files
67+
*.tmp
68+
*.temp
69+
temp_*
70+
test_*.html
71+
72+
# Logs
73+
*.log
74+
logs/
75+
76+
# Chrome debugging
77+
chrome-debug-*

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

Makefile

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Chrome DevTools MCP - Build Automation
2+
3+
.PHONY: install test lint format clean build package check dev help
4+
5+
# Default target
6+
help:
7+
@echo "Chrome DevTools MCP - Build Commands"
8+
@echo ""
9+
@echo "Development:"
10+
@echo " install Install dependencies with uv"
11+
@echo " dev Install in development mode"
12+
@echo " test Run test suite"
13+
@echo " lint Run linting checks"
14+
@echo " format Format code with ruff"
15+
@echo " check Run all checks (lint + type check + test)"
16+
@echo ""
17+
@echo "Distribution:"
18+
@echo " package Build DXT extension package"
19+
@echo " clean Remove build artifacts"
20+
@echo ""
21+
@echo "CI/CD:"
22+
@echo " ci-test Run full CI test suite"
23+
24+
# Development setup
25+
install:
26+
uv sync
27+
28+
dev: install
29+
uv run mcp install devtools_server.py -n "Chrome DevTools MCP" --with-editable .
30+
31+
# Code quality
32+
lint:
33+
uv run ruff check .
34+
35+
format:
36+
uv run ruff format .
37+
38+
typecheck:
39+
uv run mypy src/
40+
41+
# Testing
42+
test:
43+
uv run python test_devtools_server.py
44+
45+
test-individual:
46+
uv run python run_tests.py start_and_connect
47+
48+
# All checks
49+
check: lint typecheck test
50+
51+
# CI test suite
52+
ci-test: install check
53+
54+
# Packaging
55+
package: clean
56+
@echo "Building DXT extension package..."
57+
npx @anthropic-ai/dxt pack
58+
@echo "✅ Extension packaged: chrome-devtools-protocol-*.dxt"
59+
60+
# Cleanup
61+
clean:
62+
rm -f chrome-devtools-protocol-*.dxt
63+
rm -rf .ruff_cache/
64+
rm -rf __pycache__/
65+
rm -rf src/__pycache__/
66+
rm -rf src/tools/__pycache__/
67+
rm -rf .pytest_cache/
68+
rm -rf chrome_devtools_mcp.egg-info/
69+
70+
# Installation helpers
71+
install-tools:
72+
npm install -g @anthropic-ai/dxt
73+
pip install uv
74+
75+
# Development server (for testing)
76+
dev-server:
77+
uv run python devtools_server.py
78+
79+
# Version management
80+
version-patch:
81+
@echo "Current version: $$(jq -r '.version' manifest.json)"
82+
@echo "Bumping patch version..."
83+
@jq '.version = (.version | split(".") | .[0] + "." + .[1] + "." + (.[2] | tonumber + 1 | tostring))' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
84+
@echo "New version: $$(jq -r '.version' manifest.json)"
85+
86+
version-minor:
87+
@echo "Current version: $$(jq -r '.version' manifest.json)"
88+
@echo "Bumping minor version..."
89+
@jq '.version = (.version | split(".") | .[0] + "." + (.[1] | tonumber + 1 | tostring) + ".0")' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
90+
@echo "New version: $$(jq -r '.version' manifest.json)"
91+
92+
# Quick development workflow
93+
quick-build: format lint package
94+
@echo "✅ Quick build complete!"
95+
96+
# Full release workflow
97+
release: clean check package
98+
@echo "✅ Release build complete!"
99+
@echo "📦 Extension: chrome-devtools-protocol-*.dxt"
100+
@echo ""
101+
@echo "To release:"
102+
@echo "1. git tag v$$(jq -r '.version' manifest.json)"
103+
@echo "2. git push origin v$$(jq -r '.version' manifest.json)"

0 commit comments

Comments
 (0)