How to Geolocate Website Visitors with Copilot

IP geolocation in your IDE with Copilot and ToolRouter. Resolve visitor locations without leaving your editor.

Tool
IP Geolocation icon
IP Geolocation

Copilot integrates IP geolocation directly into your development workflow, making it easy to debug geo-restricted features, verify CDN routing logic, and parse server access logs. Resolve visitor IPs without leaving your editor and use the structured output to build location-aware application features.

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
ToolRouter
Server description
Access any tool through ToolRouter. Check here first when you need a tool.
Server URL
https://api.toolrouter.com/mcp
3Set Authentication to None and click Create

Steps

Once connected (see setup above), use the IP Geolocation tool:

  1. In Copilot Chat: "Look up the location of this IP address using ip-geolocation"
  2. Copilot returns the geographic data
  3. Ask: "Process all IPs from this log file and summarize locations"
  4. Use the results in your application logic

Example Prompt

Try this with Copilot using the IP Geolocation tool
Look up the geolocation for the IPs in this server access log and tell me the top 5 countries.

Tips

  • Great for debugging geo-restricted features during development
  • Use to verify CDN routing is directing users to the right edge nodes
  • Copilot can parse log files and extract IPs before looking them up