74 lines
1.6 KiB
Markdown
74 lines
1.6 KiB
Markdown
|
|
# Azure Maps MCP Server Setup
|
||
|
|
|
||
|
|
This MCP server provides access to Azure Maps static imagery.
|
||
|
|
|
||
|
|
## Prerequisites
|
||
|
|
|
||
|
|
- Python 3.10 or higher
|
||
|
|
- An Azure Maps Subscription Key
|
||
|
|
|
||
|
|
## 1. Get an Azure Maps Subscription Key
|
||
|
|
|
||
|
|
1. Go to the [Azure Portal](https://portal.azure.com/).
|
||
|
|
2. Create an **Azure Maps Account** resource.
|
||
|
|
3. Once created, go to **Authentication** in the left menu.
|
||
|
|
4. Copy the **Primary Key** (or Secondary Key). This is your Subscription Key.
|
||
|
|
|
||
|
|
## 2. Installation
|
||
|
|
|
||
|
|
1. Clone or navigate to this repository.
|
||
|
|
2. Install the required Python packages:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
pip install -r requirements.txt
|
||
|
|
# OR if using the provided pyproject.toml
|
||
|
|
pip install .
|
||
|
|
```
|
||
|
|
|
||
|
|
(Note: You may need to create a virtual environment first: `python -m venv venv && source venv/bin/activate`)
|
||
|
|
|
||
|
|
## 3. Configuration
|
||
|
|
|
||
|
|
Set your API key as an environment variable:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
export AZURE_MAPS_SUBSCRIPTION_KEY="your_subscription_key_here"
|
||
|
|
```
|
||
|
|
|
||
|
|
## 4. Running the Server
|
||
|
|
|
||
|
|
You can run the server directly (stdio mode):
|
||
|
|
|
||
|
|
```bash
|
||
|
|
python azure_maps_mcp.py
|
||
|
|
```
|
||
|
|
|
||
|
|
## 5. Using with MCP Clients
|
||
|
|
|
||
|
|
### Claude Desktop
|
||
|
|
|
||
|
|
Add the following to your `claude_desktop_config.json`:
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"mcpServers": {
|
||
|
|
"azure-maps": {
|
||
|
|
"command": "python",
|
||
|
|
"args": ["/absolute/path/to/azure_maps_mcp.py"],
|
||
|
|
"env": {
|
||
|
|
"AZURE_MAPS_SUBSCRIPTION_KEY": "your_subscription_key_here"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### Inspecting with MCP Inspector
|
||
|
|
|
||
|
|
To test the server interactively:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
npx @modelcontextprotocol/inspector python azure_maps_mcp.py
|
||
|
|
```
|
||
|
|
|
||
|
|
(Ensure you have `AZURE_MAPS_SUBSCRIPTION_KEY` set in your terminal session before running the inspector).
|