dynamics-365-entity-explorer-mcp
A specialized Model Context Protocol (MCP) intermediary for accessing Microsoft Dataverse/PowerPlatform schema and record sets. It furnishes deep introspection capabilities, facilitates sophisticated OData retrieval operations, and visualizes data linkages. Supports proactive, AI-driven query construction and schema navigation for superior application development velocity.
Author

michsob
Quick Info
Actions
Tags
Dataverse Schema and Query Facilitator (MCP Service)
This Model Context Protocol (MCP) gateway furnishes intelligent connectivity to underlying Dataverse and PowerPlatform structural definitions and live records. It is engineered to provide contextual awareness, comprehensive metadata access, and schema exploration services.
Core Capabilities
- Schema Introspection: Detailed, formatted exposure of entity metadata via context-aware outputs.
- Advanced Querying: Full support for complex OData filtering syntax, enhanced by intelligent query structure assistance.
- Linkage Visualization: Mapping and presentation of entity interdependencies.
- Development Acceleration: AI-assisted query formulation and data structure design through guided prompts.
- Complete Data Access: Utility functions for retrieving attributes, relationships, and global enumeration definitions.
Deployment
Deployment can be achieved via two primary methods:
Method A: Global Installation
Install the utility globally on your development machine:
bash npm install -g dynamics-365-entity-explorer-mcp
Execute the service:
bash dynamics-365-entity-explorer-mcp
Method B: Direct Execution (npx)
Run immediately without a persistent local installation:
bash npx dynamics-365-entity-explorer-mcp
Configuration Prerequisites
Operation requires setting the following environment variables to establish a secure connection to the target PowerPlatform tenant:
bash
PowerPlatform/Dataverse Connection Parameters
CDS_ENDPOINT_URL=https://yourorginstance.crm.dynamics.com CLIENT_APPLICATION_ID=your-app-registration-id CLIENT_SECRET_KEY=your-secret-credential TENANT_IDENTIFIER=your-azure-tenant-guid
Operational Context
This service operates as an MCP backend, designed for consumption by MCP-aware clients such as IDE extensions (e.g., Cursor, specialized Copilot integrations). Upon activation, it exposes defined functions for fetching schema artifacts and data records.
Exposed Interface Functions
fetch-entity-schema: Retrieves structural metadata for a specified Dataverse entity.list-entity-fields: Gathers all fields/attributes belonging to an entity.get-single-attribute-def: Fetches the definition for one specific attribute.map-entity-links: Returns a map detailing inter-entity linkages.retrieve-global-picklist: Fetches a definition for a system-wide option set.fetch-single-record: Retrieves a specific data instance via entity name and unique identifier.execute-odata-filter: Runs queries against record sets using OData query syntax.apply-contextual-prompt: Invokes pre-built, context-rich prompt templates for entity operations.
Contextual Prompt Templates
The system features a templated prompting mechanism to deliver rich contextual data efficiently.
Supported Prompt Invocation Types
The apply-contextual-prompt function accepts the following parameters:
- ENTITY_SUMMARY: Broad overview and critical details of an entity.
- FIELD_SPECIFICATION: In-depth characteristics of an individual attribute.
- QUERY_BLUEPRINT: A template OData string with placeholder filters for an entity.
- RELATIONSHIP_GRAPH: A structured representation of entity associations.
Usage Examples (Client-Side Invocation)
Entity Summary Invocation
javascript // Example invoking the overview prompt await mcpClient.invoke("apply-contextual-prompt", { promptType: "ENTITY_SUMMARY", entityName: "opportunity" });
Expected Output Snippet (Conceptual):
Dataverse Entity Profile: opportunity
This profile details the 'opportunity' entity within the environment:
Metadata
- Logical Name: opportunity
- Primary Identifier: opportunityid
- Primary Field: name
Core Fields
- statecode: Status (Status Reason)
- revenue: Money (Estimated Revenue)
- closeprobability: Integer (Probability %)
Linkages
- Parent Entity Relations: 15
- Child Entity Relations: 22
Query Blueprint Invocation
javascript await mcpClient.invoke("apply-contextual-prompt", { promptType: "QUERY_BLUEPRINT", entityName: "contact" });
Expected Output Snippet (Conceptual):
OData Query Template for contacts endpoint
Template structure for querying contact records: opportunities?$select=name,revenue,statecode&$filter=statecode eq 0 and revenue gt 50000&$orderby=revenue desc&$top=100
Common Filter Operators: - Equality: name eq 'Smith' - Text Search: contains(description, 'Service') - Date Range: createdon gt 2024-06-01T00:00:00Z
Interaction Scenarios (AI Assistant Workflow)
This section illustrates how an integrated AI agent utilizes the tool outputs:
Scenario A: Requirement Translation
User Query: "I need to see all active client accounts whose annual turnover exceeds two million USD, sorted descending."
Assistant Action: [Invokes QUERY_BLUEPRINT for 'account' entity]
Assistant Response: I have constructed the necessary OData expression based on your criteria. Assuming 'statecode=0' denotes active status and 'revenue' holds the turnover value:
odata accounts?$select=name,revenue,accountnumber&$filter=statecode eq 0 and revenue gt 2000000&$orderby=revenue desc
Scenario B: Schema Validation
User Query: "When I try to filter on the status field for the 'systemuser' entity, I get an error. What are the valid integer codes for that field?"
Assistant Action: [Invokes FIELD_SPECIFICATION for systemuser.statecode]
Assistant Response: That attribute is likely the 'statecode' field. It's an integer-based status code, not a string. The valid mappings are:
- 0: Active (Enabled)
- 1: Inactive (Disabled)
If you see an error, ensure you are filtering by the numeric code (statecode eq 0) rather than the text label.
Licensing
Distributed under the MIT License.
Related Context (Business Management Tools)
Business management solutions encompass methodologies, applications, and control mechanisms leveraged by enterprises to maintain market competitiveness and optimize operational effectiveness against evolving market dynamics. These tools span functional areas such as strategic forecasting, process orchestration, resource management (CRM/ERP), and performance measurement (e.g., Balanced Scorecard).
Modern software solutions, evolving from early Management Information Systems (MIS) to contemporary Cloud Business Management suites, emphasize the criticality of correct tool selection and rigorous implementation tailored to specific organizational needs to maximize realized IT investment value.
