The useful part is not geolocation, it is the shape: the edge function does the work near the user, the MCP server is a thin adapter, and the model sees one tool. If you are wondering how to put an existing edge function in front of an assistant, this is the smallest complete answer.
A demonstration of pairing EdgeOne Pages Functions with MCP. An edge function reads geolocation from the request context and returns JSON; a small MCP server calls that function and exposes the result as a tool a model can use.
- `get_geolocation` returns the caller's location to the model
- The edge side in `functions/get_geo.ts`, reading location off the EdgeOne request context
- The server side in `mcp-server/index.ts`, a short file showing how the two connect
- A one-click deploy template, so the function is live before you write anything
`tsx` to run `mcp-server/index.ts`, and an EdgeOne Pages deployment to provide the function the server calls. No account key in the config. Version 0.1.0.
Build from source — clone the repository and build it, then point your client at the binary
