Sandbox
@nicogis/MCP-Server-ArcGIS-Pro-AddIn

MCP server for ArcGIS Pro add-in tools

This repo shows how to expose ArcGIS Pro actions as MCP tools. The add-in runs inside ArcGIS Pro and listens on a Named Pipe, while the .NET 8 MCP server forwards tool calls between Copilot and the add-in.

49 stars15 forksC#Updated 1mo ago
Who it's for

Builders who want Copilot or another MCP client to work with ArcGIS Pro maps and layers.

What it delivers

You can ask an agent to inspect maps, count features, and zoom to layers without leaving ArcGIS Pro.

What it does

ArcGIS Pro add-in bridge

Runs in-process in ArcGIS Pro and exposes GIS operations through a local Named Pipe server.

MCP tool server

Defines MCP tools in a .NET 8 console app and forwards calls to the add-in through a bridge client.

Copilot Agent Mode setup

Uses `.mcp.json` so Visual Studio Copilot can start and use the server.

GIS tool examples

Includes sample operations such as `pro.getActiveMapName`, `pro.listLayers`, `pro.countFeatures`, and `pro.zoomToLayer`.

README

MCP Server with ArcGIS Pro Add-In (C# .NET 8)

This repository demonstrates how to integrate a Model Context Protocol (MCP) server with an ArcGIS Pro Add-In. The goal is to expose ArcGIS Pro functionality as MCP tools so that GitHub Copilot (in Agent mode) or any MCP client can interact with your GIS environment.


Overview

  • ArcGIS Pro Add-In (C# with ArcGIS Pro SDK): runs in-process with ArcGIS Pro and exposes GIS operations through a local IPC channel (Named Pipes).
  • MCP Server (.NET 8 console app): defines MCP tools, communicates with the Add-In via Named Pipes, and is configured as an MCP server in Visual Studio through .mcp.json.

This can allow Copilot (Agent Mode) to query maps, list layers, count features, zoom to layers, and more — directly in ArcGIS Pro.


Prerequisites

  • Visual Studio 2022 17.14 or later (for MCP Agent Mode support)
  • ArcGIS Pro SDK for .NET
  • ArcGIS Pro installed (same machine)
  • .NET 8 SDK

Solution Structure

ArcGisProMcpSample/
+- ArcGisProBridgeAddIn/           # ArcGIS Pro Add-In project (in-process)
¦  +- Config.daml
¦  +- Module.cs
¦  +- ProBridgeService.cs          # Named Pipe server + command handler
¦  +- IpcModels.cs                 # IPC request/response DTOs
+- ArcGisMcpServer/                # MCP server project (.NET 8)
¦  +- Program.cs
¦  +- Tools/ProTools.cs            # MCP tool definitions (bridge client)
¦  +- Ipc/BridgeClient.cs          # Named Pipe client
¦  +- Ipc/IpcModels.cs             # Shared IPC DTOs
+- .mcp.json                       # MCP server manifest for VS Copilot

ArcGIS Pro Add-In

The Add-In starts a Named Pipe server on ArcGIS Pro launch. It handles operations like:

  • pro.getActiveMapName
  • pro.listLayers
  • pro.countFeatures
  • pro.zoomToLayer

Example: Module.cs (in sample is in a button)

protected override bool Initialize()
{
    _service = new ProBridgeService("ArcGisProBridgePipe");
    _service.Start();
    return true; // initialization successful
}

protected override bool CanUnload()
{
    _service?.Dispose();
    return true;
}

Example: ProBridgeService handler

case "pro.countFeatures":
{
    if (req.Args == null ||
        !req.Args.TryGetValue("layer", out string? layerName) ||
        string.IsNullOrWhiteSpace(layerName))
        return new(false, "arg 'layer' required", null);

    int count = await QueuedTask.Run(() =>
    {
        var fl = MapView.Active?.Map?.Layers
            .OfType<FeatureLayer>()
            .FirstOrDefault(l => l.Name.Equals(layerName, StringComparison.OrdinalIgnoreCase));
        if (fl == null) return 0;
        using var fc = fl.GetFeatureClass();
        return (int)fc.GetCount();
    });

    return new(true, null, new { count });
}

MCP Server (.NET 8)

The MCP server uses the official ModelContextProtocol NuGet package.

Program.cs

await Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.AddSingleton(new BridgeClient("ArcGisProBridgePipe"));
        services.AddMcpServer()
            .WithStdioServerTransport()
            .WithToolsFromAssembly(typeof(ProTools).Assembly);
    })
    .RunConsoleAsync();

Example tool

[McpServerToolType]
public static class ProTools
{
    private static BridgeClient _client;
    public static void Configure(BridgeClient client) => _client = client;

    [McpServerTool(Title = "Count features in a layer", Name = "pro.countFeatures")]
    public static async Task<object> CountFeatures(string layer)
    {
        var r = await _client.OpAsync("pro.countFeatures", new() { ["layer"] = layer });
        if (!r.Ok) throw new Exception(r.Error);
        var count = ((System.Text.Json.JsonElement)r.Data).GetProperty("count").GetInt32();
        return new { layer, count };
    }
}

.mcp.json Manifest

Place in solution root (.mcp.json):

{
  "servers": {
    "arcgis": {
      "type": "stdio",
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "McpServer/ArcGisMcpServer/ArcGisMcpServer.csproj"
      ]
    }
  }
}

Running in Visual Studio

  1. Open the solution in Visual Studio 2022 (=17.14).
  2. Ensure ArcGIS Pro is running with the Add-In loaded (so the Named Pipe exists).
  3. In VS, open Copilot Chat Agent Mode.
  4. Copilot reads .mcp.json and starts the MCP server.
  5. Type in chat:
    • pro.listLayers ? returns the layers in the active map
    • pro.countFeatures layer=Buildings ? returns the feature count

Next Steps

  • Extend tools with operations like pro.selectByAttribute, pro.getCurrentExtent, pro.exportLayer.
  • Add retry/timeout logic for IPC communication.
  • Containerize the MCP server for deployment. ...

MCP Server with ArcGIS Pro Add-In

Files in the repo

Repository payload9 top-level entries
  • AddIn
  • McpServer
  • .gitattributes
  • .gitignore
  • .mcp.json
  • LICENSE
  • MCPServer_ArcGISAddIn.gif
  • McpServer.sln
  • README.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k