# D365FO MCP Server

Connects Microsoft Dynamics 365 Finance & Operations to AI coding assistants via MCP. Useful for running ERP integration workflows directly from your editor.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 39
- Author: mafzaal
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mafzaal/d365fo-client
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/d365fo-mcp-server

## What it does

This MCP server bridges Microsoft Dynamics 365 Finance & Operations with AI agents over the Model Context Protocol. You can run it locally with `uvx` or package it in Docker using the `ghcr.io/mafzaal/d365fo-client:latest` container image.

Connection requires Azure Active Directory credentials: `D365FO_CLIENT_ID`, `D365FO_CLIENT_SECRET`, and `D365FO_TENANT_ID`, alongside your instance address in `D365FO_BASE_URL`. Without an active Azure AD app registration, requests fail immediately at the authorization stage.

For remote access, you can deploy the server as an HTTP endpoint to Azure Container Apps using the `deploy-aca.sh` script. That deployment model supports authentication through OAuth or an API key.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `D365FO_CLIENT_ID`, `D365FO_CLIENT_SECRET`, `D365FO_TENANT_ID`, `D365FO_BASE_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env D365FO_CLIENT_ID=<D365FO_CLIENT_ID> --env D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> --env D365FO_TENANT_ID=<D365FO_TENANT_ID> --env D365FO_BASE_URL=<D365FO_BASE_URL> --transport stdio d365fo-mcp-server -- uvx d365fo-client
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>

### Codex

**Platform CLI**
```bash
codex mcp add d365fo-mcp-server --env D365FO_CLIENT_ID=<D365FO_CLIENT_ID> --env D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> --env D365FO_TENANT_ID=<D365FO_TENANT_ID> --env D365FO_BASE_URL=<D365FO_BASE_URL> -- uvx d365fo-client
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "d365fo-mcp-server": {
            "command": "uvx",
            "args": [
                "d365fo-client"
            ],
            "env": {
                "D365FO_CLIENT_ID": "<D365FO_CLIENT_ID>",
                "D365FO_CLIENT_SECRET": "<D365FO_CLIENT_SECRET>",
                "D365FO_TENANT_ID": "<D365FO_TENANT_ID>",
                "D365FO_BASE_URL": "<D365FO_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "d365fo-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "d365fo-client"
            ],
            "env": {
                "D365FO_CLIENT_ID": "<D365FO_CLIENT_ID>",
                "D365FO_CLIENT_SECRET": "<D365FO_CLIENT_SECRET>",
                "D365FO_TENANT_ID": "<D365FO_TENANT_ID>",
                "D365FO_BASE_URL": "<D365FO_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e D365FO_CLIENT_ID=<D365FO_CLIENT_ID> -e D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> -e D365FO_TENANT_ID=<D365FO_TENANT_ID> -e D365FO_BASE_URL=<D365FO_BASE_URL> d365fo-mcp-server uvx d365fo-client
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>

## When to use it
- connect AI assistants to Dynamics 365 Finance & Operations
- host an ERP MCP server on Azure Container Apps
- authenticate MCP requests using Azure Active Directory credentials

## Example prompts
- Verify the connection to our Dynamics 365 F&O instance
- Query D365FO records through the configured MCP server

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
