A Model Context Protocol (MCP) server for map and location information, designed for extensibility and easy integration with MCP-compatible clients and tools like Cursor.
├── data/
│ ├── nearby.ts # Data for nearby places
│ └── places.ts # Data for known locations
├── lib/
│ └── mcpServer.ts # Core MCP server class and types
├── server/
│ └── mapMcpServer.ts # MCP server instance and tool registration
├── tools/
│ ├── getCoordinates.ts # Tool: get_coordinates handler
│ └── getNearbyPlaces.ts# Tool: get_nearby_places handler
├── main.ts # Entry point (exports MCP server fetch handler)
├── README.md # Project documentation
Deploy or Run the Server
main.ts which exports the MCP server's fetch handler.Test the API
Integrate with Cursor
Start the MCP Server
Configure Cursor
~/.cursor/mcp.json:
{ "mcpServers": { "dt-mcp": { "url": "https://your-mcp-server-url" } } }
Access in Cursor
For more, see Cursor MCP documentation.
Create a Tool Handler
tools/ (e.g., tools/myNewTool.ts).export function myNewTool(args: {
param1: string;
}): string | Promise<string> {
// Your logic here
return "result";
}
Register the Tool
server/mapMcpServer.ts, import your handler:
mapMcpServer.registerTool({
name: "my_new_tool",
description: "Describe what your tool does",
inputSchema: {
type: "object",
properties: {
param1: { type: "string", description: "Description of param1" },
},
required: ["param1"],
},
handler: myNewTool,
});
(Optional) Add Data
data/ and import as needed.Test
Returns a random place from the available locations.
Parameters:
Example Request:
{ "name": "random_place", "input": {} }
Example Response:
{ "output": { "name": "Eiffel Tower", "lat": 48.8584, "lng": 2.2945 } }
tools/).