odatav4-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@odatav4-mcplist all accounts with revenue over 1 million"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
odatav4-mcp
An MCP (Model Context Protocol) server for OData v4 endpoints, tuned for Microsoft Dataverse / Dynamics 365 but usable with any OData v4 service.
Zero-registration auth: signs in with Entra ID using the well-known Microsoft public client (
51f81489-12ee-4a9e-aac9-25749fb2a1de, the same app XrmToolBox and the Dataverse samples use). The default flow opens your browser with a localhost redirect (works where Conditional Access blocks device-code flow); device-code flow is available for headless/SSH sessions. MFA works; tokens are cached on disk so you sign in once, not per session.One config value: just the endpoint URL.
Full OData surface: metadata discovery, queries ($filter/$select/$expand/ $apply/$count), paging, CRUD, associations, functions/actions, and a raw request escape hatch.
Install
git clone <this-repo> odatav4-mcp
cd odatav4-mcp
npm install # also compiles TypeScript (prepare script)Optional but recommended — sign in once from a terminal so the MCP client never has to relay sign-in instructions:
ODATA_URL=https://yourorg.crm.dynamics.com npm run login
# headless / SSH (no local browser):
ODATA_URL=https://yourorg.crm.dynamics.com npm run login -- --devicecodeRelated MCP server: MCP Dataverse
Configuration
Env var | Required | Description |
| yes | Service root. A bare Dataverse org URL ( |
| no | Tenant id or domain (default |
| no | Override the Entra app id (default: the well-known Dataverse dev-tools client). |
| no |
|
| no | Set to |
| no | Where tokens and $metadata are cached (default |
Hook up to your client
Use the absolute path to dist/index.js in all cases.
GitHub Copilot (VS Code)
Create .vscode/mcp.json in your workspace (or add via MCP: Add Server):
{
"servers": {
"dataverse": {
"type": "stdio",
"command": "node",
"args": ["/path/to/odatav4-mcp/dist/index.js"],
"env": { "ODATA_URL": "https://yourorg.crm.dynamics.com" }
}
}
}Claude Code
claude mcp add dataverse --env ODATA_URL=https://yourorg.crm.dynamics.com -- node /path/to/odatav4-mcp/dist/index.jsCodex CLI
In ~/.codex/config.toml:
[mcp_servers.dataverse]
command = "node"
args = ["/path/to/odatav4-mcp/dist/index.js"]
env = { ODATA_URL = "https://yourorg.crm.dynamics.com" }Tools
Tool | Purpose |
| Device-code sign-in and token management |
| Connection status; Dataverse WhoAmI |
| Schema discovery from |
| Reads with full OData query options and paging |
| CRUD (update sends |
| N:N / collection navigation |
| OData functions (GET) and actions (POST), bound or unbound — covers Dataverse messages and custom APIs |
| Any other request, restricted to the configured host |
Notes
Auth flow: silent token refresh from the on-disk MSAL cache first; if that fails, tools return an instruction to run the
logintool. By default that opens your system browser (on WSL it launches the Windows browser viawslvieworrundll32.exe) and completes through a localhost redirect; MSAL runs the loopback listener automatically. Thelogintool accepts{"flow": "devicecode"}to switch flows per call. Both flows are attempted against the same well-known client id, which hashttp://localhostregistered as a redirect URI.The token cache (
msal-cache.json) contains refresh tokens; it is written with mode 600 into your home config directory. Delete it (or uselogout) to revoke local access.Dataverse
$metadatais large (10 MB+); it is cached on disk for 6 hours. Passrefresh: truetolist_entity_setsto force a re-download.
Related MCP Connectors
Official Microsoft MCP Server to query Microsoft Entra data using natural language
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables interaction with Microsoft Dynamics 365 CRM from Claude Desktop, allowing users to retrieve, create, and update CRM data through natural language.521MIT
- AlicenseNot gradedqualityCmaintenanceThe most complete MCP server for Microsoft Dataverse.96 npm14MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables CRUD operations and querying on Microsoft Dataverse through natural language.11 npmMIT
- FlicenseAqualityCmaintenanceMCP server that exposes the Timetta OData API as a universal query gateway, allowing users to list, describe, and query OData entities through natural language.32-