JX

jukkan/xrm-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 1 forks 质量 73 趋势 24

一个为Dataverse用户准备的MCP服务器,适合知道这东西来源的人。

概览

这是一个最小的MCP服务器,通过Dataverse Web API v9.2,为AI编码代理(Claude Code、GitHub Copilot、Codex CLI、Cursor、Gemini CLI)提供对Microsoft Dataverse / XRM环境的干净读取+谨慎写入权限。 : Microsoft自带 Dataverse MCP 服务器,但需要 Power Platform 管理员设置、托管环境和每次通话的 Copilot 信用点数。XRM-MCP 是一种可直接使用的替代方案,适用于使用您现有的 Azure CLI 或 Microsoft 账户的任何 Dataverse 环境。阅读更多→ - — 直接调用 Dataverse Web API,不消耗 Copilot Credits - — 可与任何你可以登录的 Dataverse 环境兼容 - 标准环境运行良好 - — org_url 是每次工具调用的参数 — — 在同一会话中连接多个组织,每个环境有身份缓存,这样切换租户时无需每次重新认证 — 先尝试 az,然后退回到交互式设备流程 — ping 、查找/列表表、描述模式、查询、创建、更新,...

概述(AI 翻译)

这是一个最小的MCP服务器,通过Dataverse Web API v9.2,为AI编码代理(Claude Code、GitHub Copilot、Codex CLI、Cursor、Gemini CLI)提供对Microsoft Dataverse / XRM环境的干净读取+谨慎写入权限。

为什么存在:Microsoft自带 Dataverse MCP 服务器,但需要 Power Platform 管理员设置、托管环境和每次通话的 Copilot 信用点。xrm-mcp 是一种可直接使用的替代方案,适用于任何使用您现有 Azure CLI 或 Microsoft 账户的 Dataverse 环境。阅读更多→

特色

  • 无Microsoft MCP计费 — 直接调用Dataverse Web API,不消耗Copilot积分
  • 无管理员切换 — 适用于任何可登录的Dataverse环境
  • 无需托管环境 — 标准环境运行良好
  • 无每个环境设置 — org_url 是每次工具调用的参数
  • 设计上的多租户 — 在同一会话中连接多个组织,采用每个环境的身份缓存,因此每次切换租户时无需重新认证
  • Azure CLI + MSAL auth — 先尝试 az,退回到交互式设备流

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

xrm-mcp

A minimal MCP server that gives AI coding agents (Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI) clean read + careful write access to Microsoft Dataverse / XRM environments via the Dataverse Web API v9.2.

Why this exists: Microsoft ships its own Dataverse MCP server, but it requires Power Platform admin setup, Managed Environments, and Copilot Credits per call. xrm-mcp is a drop-in alternative that works with any Dataverse environment using your existing Azure CLI or Microsoft account. Read more →

Features

  • No Microsoft MCP billing — calls the Dataverse Web API directly, no Copilot Credits consumed
  • No admin toggles — works with any Dataverse environment you can log into
  • No Managed Environment required — standard environments work fine
  • No per-environment setup — org_url is a parameter on every tool call
  • Multi-tenant by design — connect to multiple orgs in the same session, with per-environment identity caching so switching between tenants doesn’t require re-authenticating each time
  • Azure CLI + MSAL auth — tries az first, falls back to interactive device flow
  • 8 MCP tools — ping, find/list tables, describe schema, query, create, update, upsert

Installation

For uv, pipx, virtual environments, pinned tags, and client setup, see the installation guide.

Install via pipx (recommended):

pipx install git+https://github.com/jukkan/xrm-mcp.git

Or via pip:

pip install git+https://github.com/jukkan/xrm-mcp.git

Usage

Configuring your AI agent

Add xrm-mcp to your agent’s MCP configuration.

Claude Desktop / Claude Code (~/.claude/claude_desktop_config.json or .mcp.json):

{
  "mcpServers": {
    "xrm-mcp": {
      "command": "xrm-mcp"
    }
  }
}

GitHub Copilot (VS Code) — add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "xrm-mcp": {
      "type": "stdio",
      "command": "xrm-mcp"
    }
  }
}

Once configured, pass your environment URL with every request and the agent takes it from there:

“Show me all project records from https://myorg.crm4.dynamics.com created in the last 30 days”

Running the server manually

xrm-mcp

The server uses FastMCP and communicates over stdin/stdout (stdio transport).

Authentication

XRM MCP attempts authentication in the following order:

  1. Azure CLI — if az is available and logged in
  2. MSAL device flow — interactive browser-based login

Tokens are cached at ~/.xrm-mcp/cache.json.

If you work across multiple tenants (e.g. your own production environment, demo environments, and customer tenants), XRM MCP remembers which identity last worked for each org_url in ~/.xrm-mcp/identity_cache.json and prefers it on

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "xrm-mcp": { "command": "xrm-mcp" } } }