Skip to main content
Glama
dhippley

Azure Topology Graph MCP Server

by dhippley

Azure Topology Graph MCP Server

A Model Context Protocol (MCP) server that queries Azure Resource Graph, ARM, and Network Watcher to create topology maps that Cursor can explore.

Features

  • Resource Inventory: Query resources across multiple subscriptions using Azure Resource Graph

  • Detailed Configuration: Pull detailed configuration for specific resources using ARM APIs

  • Network Topology: Build network topology using Azure Network Watcher

  • Graph Representation: Represent infrastructure as nodes and edges

  • MCP Tools: Expose powerful tools for searching, exploring, and analyzing Azure infrastructure

Related MCP server: Azure Resource MCP Server

Available Tools

  • search_resources: Search Azure resources by name, type, or other properties

  • get_resource: Get detailed information about a specific Azure resource

  • get_neighbors: Get resources connected to a specific resource

  • find_path: Find connection paths between two Azure resources

  • export_topology: Export the complete topology graph (JSON or summary)

  • refresh_topology: Refresh the topology cache by re-querying Azure

Prerequisites

  1. Azure Service Principal: You need an Azure service principal with appropriate permissions

  2. Azure Permissions: The service principal needs at least Reader access to the subscriptions and resource groups you want to query

  3. Node.js: Version 16 or later

Setup

1. Clone and Install Dependencies

git clone <your-repo-url>
cd azure_mcp_graph
npm install

2. Configure Azure Credentials

Create a .env file in the project root:

AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZURE_CLIENT_SECRET=your-service-principal-secret
SUBSCRIPTION_IDS=sub-id-1,sub-id-2,sub-id-3
DEFAULT_RG=MyWorkloadRG
DEFAULT_REGION=eastus
NETWORK_WATCHER_NAME=NetworkWatcher_eastus

3. Build the Server

npm run build

4. Configure Cursor MCP

Add the following to your Cursor MCP configuration file (usually ~/.cursor/config.json):

{
  "mcpServers": {
    "azure-graph": {
      "command": "node",
      "args": ["/path/to/azure_mcp_graph/dist/server.js"],
      "env": {
        "AZURE_TENANT_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "AZURE_CLIENT_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "AZURE_CLIENT_SECRET": "your-service-principal-secret",
        "SUBSCRIPTION_IDS": "sub-id-1,sub-id-2,sub-id-3",
        "DEFAULT_RG": "MyWorkloadRG",
        "DEFAULT_REGION": "eastus",
        "NETWORK_WATCHER_NAME": "NetworkWatcher_eastus"
      }
    }
  }
}

Usage Examples

Once configured, you can use the following commands in Cursor:

Search for Resources

Search for all virtual machines in my infrastructure

Explore Resource Relationships

Show me all resources connected to my VM named "web-server-01"

Find Connectivity Paths

Find the network path between my application gateway and backend VMs

Export Topology

Export a summary of my entire Azure topology

Development

Run in Development Mode

npm run dev

Build

npm run build

Clean Build Output

npm run clean

Architecture

The server consists of several key components:

  • Azure Clients: Interfaces with Azure Resource Graph, ARM, and Network Watcher APIs

  • Graph Builder: Constructs topology graphs from Azure resource data

  • Relationship Analyzer: Identifies and builds relationships between resources

  • MCP Tools: Exposes functionality through the Model Context Protocol

  • Caching: Intelligent caching with configurable TTL for performance

Troubleshooting

Authentication Issues

  • Ensure your service principal has the correct permissions

  • Verify your Azure credentials are correctly configured

  • Check that your subscription IDs are valid and accessible

Performance Issues

  • The server caches topology data for 5 minutes by default

  • Use refresh_topology tool to force a cache refresh

  • Consider filtering by resource type for large subscriptions

Network Issues

  • Ensure your environment has access to Azure APIs

  • Check firewall and proxy settings if running behind corporate networks

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Test thoroughly

  5. Submit a pull request

License

This project is licensed under the ISC License - see the package.json file for details.

Available Tools

6 tools
export_topologyC

Export the complete topology graph

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNoExport formatsummary

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Export' implies a read operation that generates output, but it doesn't specify whether this is a heavy operation, whether it requires specific permissions, what the output format entails beyond the parameter options, or if there are rate limits. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource. However, it could be slightly more informative without sacrificing conciseness, such as hinting at the output's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the exported topology graph contains, how it's structured, or what 'complete' means. Given the complexity implied by 'topology graph' and lack of structured data, more context is needed for the agent to use this effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'format' clearly documented with enum values and default. The description doesn't add any parameter semantics beyond what the schema provides, such as explaining what 'json' versus 'summary' formats entail. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Export the complete topology graph' clearly states the action (export) and resource (topology graph), but it's somewhat vague about what 'complete' means in this context. It distinguishes from siblings like 'find_path' or 'get_neighbors' by focusing on export rather than querying, but doesn't explicitly differentiate from 'refresh_topology' which might also involve topology operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'refresh_topology' or 'search_resources'. There's no mention of prerequisites, use cases, or exclusions. The agent must infer usage from the tool name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

find_pathC

Find connection path between two Azure resources

ParametersJSON Schema
NameRequiredDescriptionDefault
sourceIdYesSource resource ID
targetIdYesTarget resource ID

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool finds a 'connection path,' but doesn't explain what constitutes a connection (e.g., network links, dependencies), whether it returns multiple paths or just one, performance characteristics, or error conditions. For a path-finding tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Find connection path between two Azure resources.' It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a tool with two straightforward parameters. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of path-finding in Azure resources, no annotations, and no output schema, the description is incomplete. It doesn't explain what a 'connection path' entails, the return format, or behavioral aspects like whether it's a read-only operation. For a tool that likely involves graph traversal or dependency analysis, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('sourceId' and 'targetId') clearly documented in the schema as 'Source resource ID' and 'Target resource ID.' The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Find connection path between two Azure resources.' It specifies the verb ('Find'), resource type ('Azure resources'), and scope ('connection path between two'). However, it doesn't explicitly differentiate from sibling tools like 'get_neighbors' or 'export_topology' which might also involve resource relationships.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for when path-finding is needed, or comparisons to siblings like 'get_neighbors' (which might show direct connections) or 'search_resources' (which might help identify resources). Usage is implied but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_neighborsC

Get resources connected to a specific resource

ParametersJSON Schema
NameRequiredDescriptionDefault
resourceIdYesFull Azure resource ID

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Get resources connected' but doesn't disclose behavioral traits like whether this is a read-only operation, what types of connections are considered, if there are rate limits, or how results are returned (e.g., list format). The description is minimal and leaves key behaviors unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get resources connected to a specific resource'. It's front-loaded with the core action and target, with zero wasted words. Every part earns its place by conveying the essential purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a tool that retrieves connected resources, with no annotations, no output schema, and minimal description, this is incomplete. The description lacks details on what 'connected' means, the return format, or any behavioral context, making it inadequate for an agent to use effectively without guesswork.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'resourceId' documented as 'Full Azure resource ID'. The description adds no meaning beyond this, as it doesn't explain what a 'resource' entails or how connections are defined. With high schema coverage, the baseline is 3, but the description doesn't compensate with additional context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get resources connected to a specific resource' clearly states the action (get) and target (connected resources), but it's vague about what 'connected' means and doesn't distinguish from siblings like 'find_path' (which might find connection paths) or 'search_resources' (which might search broadly). It avoids tautology but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention siblings like 'find_path' for pathfinding or 'get_resource' for single-resource details, nor does it specify prerequisites or exclusions. Usage is implied by the action but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_resourceB

Get detailed information about a specific Azure resource

ParametersJSON Schema
NameRequiredDescriptionDefault
resourceIdYesFull Azure resource ID

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves 'detailed information,' implying a read-only operation, but doesn't specify authentication needs, rate limits, error conditions, or what 'detailed' entails (e.g., metadata, configuration, status). This leaves significant gaps for a tool interacting with Azure resources.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose ('Get detailed information about a specific Azure resource'), making it easy to parse quickly. Every word earns its place, achieving optimal conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (interacting with Azure resources), lack of annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, usage context, and output format. This leaves the agent with gaps, especially for error handling or result interpretation, making it just viable but not fully informative.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'resourceId' documented as 'Full Azure resource ID.' The description adds minimal value beyond this, only implying the parameter identifies a 'specific Azure resource.' Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't provide additional syntax or format details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('Azure resource'), and specifies it retrieves 'detailed information' rather than just basic data. However, it doesn't differentiate from sibling tools like 'search_resources' or 'get_neighbors' that might also retrieve Azure resource information, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_resources' (which might list multiple resources) or 'get_neighbors' (which might retrieve related resources). It mentions 'specific Azure resource' but doesn't clarify prerequisites, such as needing a full resource ID versus a name, or when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

refresh_topologyB

Refresh the topology cache by re-querying Azure

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is a read/write operation, its impact (e.g., performance, data freshness), rate limits, or permissions required, leaving significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—it directly states the purpose without redundancy. It's appropriately sized for a no-parameter tool and front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 0 parameters and no output schema, the description is minimally adequate but lacks completeness. It doesn't explain what 'topology cache' entails, the outcome of refreshing, or error handling, leaving the agent with insufficient context for optimal use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema coverage, so no parameter documentation is needed. The description adds value by explaining the action involves 're-querying Azure', which provides context beyond the empty schema, justifying a baseline above 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('refresh') and the resource ('topology cache'), specifying it's done by 're-querying Azure'. This distinguishes it from siblings like 'export_topology' or 'search_resources', though it doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_resource' or 'search_resources'. It implies usage when the cache needs updating but offers no explicit context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_resourcesC

Search Azure resources by name, type, or other properties

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (searches name, type, resource group, location, tags)
resourceTypeNoOptional filter by resource type

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions searching by properties but doesn't describe key behaviors like pagination, rate limits, authentication needs, error handling, or what the output looks like (e.g., list of resources with fields). For a search tool with no annotation coverage, this leaves significant gaps in understanding how it operates.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to understanding the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a search operation, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, result format, limitations (e.g., search scope), or behavioral aspects like performance or constraints. For a tool with 2 parameters and no structured support, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('query' and 'resourceType') with clear descriptions. The description adds minimal value by implying search across multiple properties, but doesn't provide additional syntax, format details, or examples beyond what the schema specifies. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'search' and the resource 'Azure resources', specifying searchable properties (name, type, or other properties). It distinguishes from siblings like 'get_resource' by indicating a broader search capability rather than retrieving a specific resource. However, it doesn't explicitly differentiate from all siblings (e.g., 'find_path' might also involve searching).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer 'search_resources' over 'get_resource' for specific resource retrieval, or how it differs from 'find_path' or other siblings. There are no explicit usage contexts, exclusions, or prerequisites stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: export_topology for full graph export, find_path for pathfinding between resources, get_neighbors for adjacency queries, get_resource for detailed resource info, refresh_topology for cache updates, and search_resources for filtering. No ambiguity exists as they target different operations on Azure topology data.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with clear, descriptive names (e.g., export_topology, find_path, get_neighbors). The naming is uniform across all six tools, using lowercase with underscores, making them predictable and easy to understand.

Tool Count5/5

With 6 tools, the server is well-scoped for managing Azure topology graphs. Each tool serves a specific, non-redundant function, covering key operations like querying, searching, pathfinding, and cache management without being overly sparse or bloated.

Completeness4/5

The toolset provides strong coverage for querying and analyzing Azure topology, including CRUD-like operations (get, search, refresh) and graph-specific functions (export, find_path, get_neighbors). A minor gap might be the lack of tools for modifying or annotating the topology, but core workflows are well-supported.

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dhippley/azure_mcp_graph'

If you have feedback or need assistance with the MCP directory API, please join our Discord server