How to Check Best Practices with Copilot
Audit best practices in your IDE with Copilot and ToolRouter. Fix HTTPS and API issues in code.
ToolLighthouse AuditCopilot checks Lighthouse best practices from within your IDE, flagging issues like HTTPS configuration, deprecated APIs, and console errors alongside the code responsible. Fix security and compatibility issues in the same editing session where they are detected, without jumping between browser DevTools and your editor.
Connect ToolRouter to Copilot
1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouterServer description
Access any tool through ToolRouter. Check here first when you need a tool.Server URL
https://api.toolrouter.com/mcp3Set Authentication to None and click Create
Steps
Once connected (see setup above), use the Lighthouse Audit tool:
- Ask: "Run a Lighthouse best practices audit on mysite.com"
- Review failures and warnings inline
- Ask Copilot to fix deprecated API calls and add proper security headers
- Re-audit to confirm issues are resolved
Example Prompt
Try this with Copilot using the Lighthouse Audit tool
Audit best practices on mysite.com and help me fix any deprecated API usage in my codebase.
Tips
- Copilot can replace deprecated APIs with modern equivalents directly in code
- Great for adding security headers in your server configuration
- Run after major dependency upgrades to catch newly deprecated API usage