home / mcp / mcp geo mcp server
This project demonstrates how to use EdgeOne Pages Functions to retrieve user geolocation information and integrate it with large language models through MCP (Model Context Protocol).
Configuration
View docs{
"mcpServers": {
"tencentedgeone-mcp-geo": {
"command": "tsx",
"args": [
"path/to/mcp-server/index.ts"
]
}
}
}You set up this MCP server to retrieve user geolocation data through EdgeOne Pages and expose it to large language models via the Model Context Protocol. It enables AI models to access location information fetched from EdgeOne Pages Functions, simplifying geolocation-aware responses and decisions.
You interact with the edgeone_geo MCP server by starting the local MCP service and then connecting your MCP client to the server to access the geolocation tool. The server provides a get_geolocation tool that returns location data fetched from EdgeOne Pages Functions. Use this tool within your AI workflow to enrich responses with user location context, such as country, region, city, or coordinates, depending on what EdgeOne provides.
Prerequisites you need before starting the MCP server are a Node.js runtime and a way to run TypeScript-based code. Ensure Node.js is installed on your system.
1. Create a project directory for the MCP server and navigate into it.
2. Prepare the MCP server configuration. Use the provided MCP configuration snippet to register the edgeone_geo MCP server.
3. Start the MCP server using the runtime and the specified entry file.
The MCP server is configured to load a local runtime that executes the server logic. The provided configuration registers a single MCP server able to fetch geolocation data via the EdgeOne Pages Function.
{
"mcpServers": {
"edgeone_geo": {
"command": "tsx",
"args": ["path/to/mcp-server/index.ts"]
}
}
}Tool that retrieves geolocation data through the EdgeOne Pages Function and makes it available to MCP-enabled AI models.