How to Identify Bot Traffic with Copilot
Bot detection in your IDE with Copilot and ToolRouter. Classify visitor IPs from access logs.
ToolIP GeolocationCopilot helps you turn bot detection insights into working code. Bulk-resolve visitor IPs to identify hosting providers, then generate the firewall rules, rate-limiting middleware, or bot-detection functions your application needs -- building the IP classification and blocking logic directly in your codebase.
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 IP Geolocation tool:
- In Copilot Chat: "Bulk look up these IPs and flag hosting provider origins"
- Copilot classifies each IP by provider type
- Ask: "Generate a blocklist of data center IPs from this analysis"
- Apply the blocklist to your application firewall
Example Prompt
Try this with Copilot using the IP Geolocation tool
Parse the nginx access log, extract unique IPs, bulk look up their geolocation, and identify which are from cloud hosting providers.
Tips
- Copilot can generate firewall rules from the analysis results
- Integrate IP classification into your CI/CD pipeline for security testing
- Use to validate that your bot protection middleware is working correctly