Develop a server connecting Google Places API to fetch location images for real-time display in prototypes
The Place ID MCP Server is a specialized server that connects to the Google Places API to dynamically retrieve images of places and integrates these into Cursor using Smithery. This server allows AI applications such as Claude Desktop, Continue, and Cursor to access real-time image data for enhanced user experiences in AI workflows.
The Place ID MCP Server leverages advanced technologies like Node.js and Express.js, providing powerful APIs for fetching Google Places images directly from the platform. These features are crucial for maintaining a seamless and efficient workflow:
At the heart of this server lies a robust architecture built to comply with the Model Context Protocol (MCP), which is akin to USB-C in versatility and utility. Compliance includes:
The flow diagram illustrates how the protocol functions from an AI application perspective, demonstrating the interactions seamlessly:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
This matrix outlines the compatibility of the Place ID MCP Server with various MCP clients:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
To get the Place ID MCP Server up and running, follow these steps:
Clone the Repository:
git clone https://github.com/TimHub88/place-id-mcp-server.git
cd place-id-mcp-server
Install Dependencies:
npm install
Configure Environment Variables:
Create a .env
file at the root of your project and add your Google Places API key along with any other necessary settings, such as port specifications.
Start the Server:
npm start
AI applications can use this server to fetch images of places dynamically during the prototyping phase, ensuring that designs and models remain up-to-date with real-world locations.
Example Scenario: A UX designer using Cursor can request image data from Google Places directly, integrating these into their wireframes in real-time. This enhances visibility and realism in design decisions.
In applications where user experience is paramount, having access to the latest imagery ensures a more engaging interaction with AI tools.
Example Scenario: In an augmented reality application, users can view up-to-date images of places within their virtual environment, improving navigation and interaction scenarios.
Place Search Endpoint:
{
"success": true,
"data": {
"places": [
{
"name": "Tour Eiffel",
"address": "Champ de Mars, 5 Av. Anatole France, 75007 Paris, France",
"place_id": "ChIJLU7jZClu5kcR4PcOOO6p3I0",
"photos": [
{
"photo_reference": "AUjq9jlXyV5A3sadj...",
"width": 4000,
"height": 6000,
"html_attributions": ["..."]
}
]
}
]
}
}
Photo Retrieval Endpoint:
{
"success": true,
"data": {
"photoUrl": "https://url_de_la_photo.jpg"
}
}
The server also supports the MCP JSON-RPC protocol, ensuring full compatibility with advanced AI tools:
Initialize Endpoint:
{
"jsonrpc": "2.0",
"method": "initialize",
"params": {},
"id": 1
}
Tools List and Execution:
{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 2
}
{
"jsonrpc": "2.0",
"method": "tools/execute",
"params": {
"tool": "searchPlaces",
"params": {
"query": "Eiffel Tower"
}
},
"id": 3
}
The Place ID MCP Server performs well across multiple environments and is designed to work seamlessly with a variety of AI clients. Here’s a compatibility matrix:
Client | Compatible Tools |
---|---|
Claude Desktop | ✅ All tools |
Continue | ✅ All tools |
Cursor | ✅ Core tools, no prompts |
The .env
file serves as the core configuration point for your environment variables. Ensure you have set up these variables correctly:
GOOGLE_PLACES_API_KEY=votre_clé_api
PORT=3000
Q: How does the integration work for Cursor tools?
A: The Place ID MCP Server supports core tools in Cursor but does not provide prompts or enhanced functionalities beyond basic interaction.
Q: Is there a need to restrict API use by domain or IP address?
A: Yes, apply restrictions on your Google API key to control how and where it's used, ensuring security.
Q: Can I change the port from 3000 dynamically?
A: Yes, modify the PORT
variable in the .env
file as needed.
Q: How often should I expect updated images via this API?
A: Images are refreshed based on Google Places updates and can be cached to reduce load times.
Q: Can I integrate this endpoint into my own AI application?
A: Absolutely, follow the provided examples and adapt them to your specific requirements.
Contributions to enhance or improve the Place ID MCP Server are welcomed by the community:
The Place ID MCP Server is a powerful and versatile solution for connecting AI applications to dynamic image data sources directly from Google Places. By adhering to MCP protocols and leveraging robust integration capabilities, this server ensures seamless operations and enhanced user experiences across various applications.
For more information or to contribute, visit the GitHub repository or reach out to the community for support.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration