Skip to main content

Tencent Location Service MCP Access

In AI application scenarios, connecting with the real world to provide personalized recommendations (such as restaurants, hotels, events, attractions, etc.), plan itineraries, and obtain real-time travel information, thereby enabling AI to serve people's real lives, is what many enterprises and developers urgently hope to achieve.

Tencent Location Service introduces location service development interfaces based on the MCP protocol, helping developers quickly implement location-based AI services.

Go to CloudBase Platform to create MCP Server


Environment Variables

Create APIKey Tencent Location Service MCP relies on WebServiceAPI for its architecture. Therefore, you must first create an APIKey, enable the WebServiceAPI functionality, and obtain the relevant API call quota before it can be used.

For specific methods, refer to: https://lbs.qq.com/service/webService/webServiceGuide/overview

  • You need to set the API_KEY environment variable to the API Key you created in Tencent Location Service.
  • Configure JSON_FORMAT: Set to 1 if structured JSON data needs to be returned, otherwise set to 0 (returns formatted text segments).

Usage Instructions

Tencent Location Service MCP Server relies on the Map WebServiceAPI for its construction. Therefore, it is subject to the limitations of the WebServiceAPI interfaces themselves and requires call permissions and quotas for the corresponding interfaces to be used. Click to view: WebServiceAPI Call Limits, WebServiceAPI Getting Started Guide

During the conversation between the user and the AI agent, the AI agent determines whether it needs to invoke an external tool (MCPServer) to retrieve information for answering the user's question. The MCPServer then calls the corresponding WebServiceAPI interface based on the parameters provided by the AI agent to obtain results. The AI agent interprets the content, organizes it, and finally responds to the user.

The AI agent may invoke multiple tool interfaces in the MCPServer (which may correspond to multiple WebServiceAPI interfaces) during this process; therefore, all relevant interfaces require call permissions and quotas.

Application Example

City/Region Search Search for matching location information based on specified city/district scope (name or region codes) and location keywords. Application scenarios: such as searching for attractions, hotels, and shopping venues in Beijing, or finding detailed addresses of specific places.

(Note: Actual application effects may vary across different large models due to their varying reasoning and computational capabilities. This example is for reference only.)

🗺️ Feature List

Tool IdentifierFunction DescriptionCore Parameters
geocoderProvides the capability to convert text addresses into latitude and longitude coordinates, and returns structured province/city/district address informationaddress (required, formatted address containing province/city/district information or location keyword including city name)
placeSuggestionSearches for location information based on keywords and city, returning location name, address, latitude/longitude, category, etc.keyword (required, keyword or location name), region (optional, city to search in)
placeSearchNearbySearches for location information around a specified center point (latitude and longitude), returning location name, address, latitude/longitude, category, etc.location (required, latitude and longitude of the center point in lat,lng format), keyword (required, search keyword)
directionDrivingPlans driving routes with preferences like considering traffic conditions, minimizing tolls, and avoiding highways; returns estimated travel time, distance, toll fees, and other informationfrom (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format)
placeAlongbySearches for eligible locations along a route, returning location name, address, latitude/longitude, category, etc.polyline (required, route coordinate point string), keyword (required, search keyword)
placeDetailRetrieves POI details based on POI ID, including name, address, latitude/longitude, category, etc.id (required, POI ID)
matrixBatch calculates the road distance (navigation distance) between multiple origin-destination pairsfrom (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format), mode (required, travel mode: driving, walking, bicycling)
reverseGeocoderConverts latitude and longitude coordinates into a human-readable address, province/city/district information, etc.location (required, latitude and longitude coordinates in the format lat,lng)
ipLocationObtains the current province, city, and district information via an IP addressip (required, IP address, either IPv4 or IPv6)
weatherQuery real-time or forecast weather for a city based on its administrative division codeadcode (required, administrative division code), type (optional, query type: now or future, defaults to now)
directionWalkingPlans walking routes and returns total route distance, estimated travel time, and other informationfrom (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format)
directionBicyclingPlans bicycle riding routes and returns total route distance, estimated travel time, and other informationfrom (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format)
directionTransitPlans public transit routes and returns multiple sets of travel options with detailed informationfrom (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format)
futureDrivingDirectionPlans driving routes based on future departure time, considering predicted traffic conditions, and returns estimated travel time, total distance, and other informationdeparture_time (required, departure time in timestamp format), from (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format)
waypointOrderOptimally sorts waypoints and plans a driving route, supporting up to 16 waypointsfrom (required, origin coordinates in lat,lng format), to (required, destination coordinates in lat,lng format), waypoints (optional, waypoint coordinates, up to 16, in the format lat1,lng1;lat2,lng2...), need_waypoint_order (optional, whether to sort waypoints optimally, value true or false)

🔌 Usage

CloudBase MCP Console