microsoft-copilot-studio-metadata-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., "@microsoft-copilot-studio-metadata-mcp Which agents can be used without signing in and reach SharePoint?"
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.
Everything you build in Copilot Studio is stored as rows in Dataverse: one row per agent in bot, one row
per topic, action, knowledge source and instruction set in botcomponent, with the definition as YAML in a
data column. microsoft-copilot-studio-metadata-mcp turns those tables into MCP tools, so an AI
assistant (Claude, Cursor, VS Code and others) can answer questions in plain language:
"Which agents can be used without signing in, and which of those reach SharePoint?"
"Which actions run on the maker's own credentials for every user?"
"What breaks if we retire the Office 365 Outlook connection?"
"Which agents were never published, and who owns them?"
"Show me the instructions of the HR assistant and how it differs from the Finance one."
"What changed in our agents since last Monday?"
It ships fifteen tools: a description of the data model, a check of that model against your environment, a safe query and count surface over the agent tables, a decoded inventory of every agent, impact analysis, nineteen governance rules, a side by side comparison and snapshots for change over time. Together they let the model answer any question about your agents, not a fixed menu.
Why it is different
It knows the model. Which tables hold agent data, how they relate and what every coded column means. The assistant reads it through
describe_modelbefore it writes a query.It reads the YAML. Topics, actions, knowledge sources, instructions and agent settings are decoded, so the answer says "sends mail on the maker's credentials", not "componenttype 9 with a YAML blob".
Impact analysis across agents.
find_agents_usingjoins agents to connectors, connections, flows, SharePoint sites, models, MCP servers and topic steps.Governance built in.
inventory_healthruns nineteen rules for security, lifecycle, hygiene and quality, and returns the findings most serious first.Change over time.
save_snapshotanddiff_snapshotshow which agents were added, removed or changed, down to the setting and the topic.Honest about gaps. A decoder never guesses. An unknown shape is returned raw and flagged, and
describe_modellists what these tables cannot answer.Small and safe. Read only, stdio only, secrets from the environment, and two dependencies: the MCP SDK and PyYAML. HTTP runs on the Python standard library.
Why not the generic Dataverse MCP server?
Microsoft's own Dataverse MCP server can run a query against any table, these included. It hands the
assistant raw rows: a componenttype number and a YAML blob. This server adds what is missing between
those rows and an answer:
Generic Dataverse MCP | This server | |
Knows which tables hold agent data and how they relate | no | yes, and shares it through |
Reads the YAML (topics, actions, knowledge, instructions) | no | yes, with a decoder per kind |
Joins agents to connections, flows, sites and models | you write the joins |
|
Governance rules | no |
|
Change over time | no |
|
Can read your business data | yes | no: a fixed allow list of agent tables |
Can write | yes | no: GET requests only |
Labels | caller's language | stable English meaning next to the local label |
Related MCP server: io.github.mischuh/canonic
Quickstart
You need Python 3.10 or later, uv (curl -LsSf https://astral.sh/uv/install.sh | sh)
and, for the default way of signing in, the Azure CLI.
The package is not on PyPI yet, so you run it from a clone:
git clone https://github.com/tdries/microsoft-copilot-studio-metadata-mcp
cd microsoft-copilot-studio-metadata-mcp
uv sync
az loginFind your environment's address in Power Apps under Settings, then Session details, then Instance url.
Claude Code, one line:
claude mcp add copilot-studio-metadata \
-e DATAVERSE_URL=https://yourorg.crm4.dynamics.com \
-- uv run --directory /path/to/microsoft-copilot-studio-metadata-mcp microsoft-copilot-studio-metadata-mcpThen start with: "Call server_info, then describe_model, then tell me what stands out in inventory_health."
Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"copilot-studio-metadata": {
"command": "uv",
"args": ["run", "--directory", "/path/to/microsoft-copilot-studio-metadata-mcp", "microsoft-copilot-studio-metadata-mcp"],
"env": { "DATAVERSE_URL": "https://yourorg.crm4.dynamics.com" }
}
}
}Fully quit and reopen Claude Desktop, then check the tools menu.
These clients use the same mcpServers block shown above. Add it to:
Cursor:
~/.cursor/mcp.json(global) or.cursor/mcp.json(project).Cline: the MCP Servers panel, then Configure, into
cline_mcp_settings.json.Windsurf:
~/.codeium/windsurf/mcp_config.json.VS Code:
.vscode/mcp.json, where the top level key isserversinstead ofmcpServers.
On Windows, if uv is not found by the app, use its absolute path (for example %USERPROFILE%\.local\bin\uv.exe).
Configuration
All configuration is through environment variables. Set them in your client's env block, never on the
command line. .env.example holds the same list.
Env var | Required | Default | Description |
| yes¹ | n/a | Your environment, for example |
| no | auto |
|
| no² | n/a | Tenant of the app registration. With the Azure CLI: only for a guest tenant. |
| no² | n/a | Client id of the app registration. |
| no² | n/a | Client secret of the app registration. |
| no | n/a | A token you already have. For short tests. |
| no¹ | n/a | Answer from this export file instead of a live environment. No network, no credentials. |
| no |
| Where |
| no |
|
|
| no |
| How long the decoded inventory is reused. |
| no |
| Timeout per request, in seconds. |
| no |
|
|
| no |
|
|
¹ Set DATAVERSE_URL for live mode or AGENT_SNAPSHOT_FILE for snapshot mode.
² All three are needed when you sign in with an app registration.
Signing in: three ways
Way | Set | Best for |
Azure CLI (default) | nothing more: run | A consultant or maker on a laptop. You see what your own account may see |
App registration |
| A view across all makers. Add the app to the environment as an application user with a read only role on the agent tables |
Ready token |
| Short tests |
Snapshot mode: no credentials at all
Point the server at an export file and it answers every question from that file, with no network:
"env": { "AGENT_SNAPSHOT_FILE": "/path/to/agents-20261127T090000Z.json" }A snapshot is what save_snapshot writes: {"exportedAt", "instance", "tables": {"bot": [...], "botcomponent": [...], ...}}.
This is how you review a customer's agents offline, and how the history for diff_snapshot is built.
Tools
Tool | What it does | Key args |
| Confirms the connection: environment, mode, identity, agent and component counts. |
|
| The whole model: tables, relationships, coded values, YAML kinds, a recipe per question type. |
|
| Every readable column of one table, live from the environment, with meaning where known. |
|
| Differences between the curated model and this environment. | none |
| Read only OData style query on any agent related table. |
|
| Counts grouped by one or two columns. |
|
| One decoded line per agent, with filters. |
|
| One agent in full: settings, instructions, actions, knowledge, topics, dependencies. |
|
| One part in full: decoded reading plus the raw YAML. |
|
| A word or phrase anywhere in names, descriptions, instructions and definitions. |
|
| Impact analysis by connector, connection, flow, site, model, step kind and more. |
|
| Governance findings, most serious first. |
|
| Two agents side by side. |
|
| Saves the current definitions to a local file. |
|
| What changed since a snapshot, or between two. |
|
The first fourteen never change anything. save_snapshot writes one file on the machine where the server
runs and nothing else. Nothing is ever written to Dataverse.
Example questions
Ask in your own words. The assistant picks the tool. docs/QUESTIONS.md lists some seventy questions with the tool that answers each one, and says plainly which questions these tables cannot answer.
Security and governance
Ask | Answered by |
"Which agents require no sign in, and which of those can reach knowledge or actions?" |
|
"Which agents are open to any user?" |
|
"Which actions run on the maker's own credentials for every user?" |
|
"Which topics call HTTP endpoints directly, and which ones?" |
|
"Which agents have web browsing switched on or run with low content moderation?" |
|
"Give me the five most urgent findings." |
|
Dependencies and impact
Ask | Answered by |
"What breaks if we retire the Office 365 Outlook connection?" |
|
"What breaks when this flow is changed?" |
|
"Which SharePoint sites feed which agents?" |
|
"Which agents use MCP servers, and which ones?" |
|
"Which agents can send mail or post in Teams?" |
|
"Which agents point at a flow or connection that is gone?" |
|
Inventory and ownership
Ask | Answered by |
"How many agents do we have, and who built what?" |
|
"Which agents were never published, and who owns them?" |
|
"Which agents does a leaver own?" |
|
"Which agents have not been touched for six months?" |
|
"How many agents per owner, language or template?" |
|
"Which agents were created this quarter?" |
|
Change over time
Ask | Answered by |
"Keep a record of today's state." |
|
"What changed in our agents since last Monday?" |
|
"Did anyone switch off authentication?" |
|
"Which topics of this agent were edited?" |
|
Content and logic
Ask | Answered by |
"Show me the instructions of the HR assistant." |
|
"How does the HR assistant differ from the Finance one?" |
|
"Which agents mention the travel policy?" |
|
"Which topics are custom, and which came with the template?" |
|
"What triggers this topic, and what steps does it take?" |
|
"Which agents are copies of each other?" |
|
Architecture
The server speaks MCP over stdio to the client and HTTPS to Dataverse. It gets a token from the Azure CLI, an app registration or the environment, loads the agent tables with GET requests, decodes them into one inventory and answers from that. The inventory is reused for five minutes. In snapshot mode it reads one file and opens no connection at all.
How it knows the model
Three layers, checked against each other:
A curated model in
model.py: five core tables, eleven link tables, the referenced tables, every relationship, the meaning of each coded column and the YAML kinds. The assistant reads it throughdescribe_model.Live verification.
verify_modelasks the environment which tables, option values and YAML kinds really exist and reports every difference. Environments differ: one of ours held a table Microsoft's reference pages do not mention.Defensive decoders in
decode.py. The YAML inbotcomponent.datais not documented by Microsoft and it changes. A decoder never guesses: an unknown kind is returned raw and flagged, and shows up inverify_modelandinventory_health.
Security
Read only by construction. The Dataverse client can only issue GET requests. A test asserts it.
Declared read only. Every tool carries MCP annotations, so a client can tell reads from the one tool that writes a local file without reading the code.
Fixed allow list.
queryandaggregatereach agent related tables only. Your accounts, contacts and other business data are out of reach, whatever the assistant asks.Names only from referenced tables. For flows, connections and users the server reads the name and state columns, never the definition.
Transcripts are off.
conversationtranscriptholds personal data and stays unreadable unless an administrator setsAGENT_INCLUDE_TRANSCRIPTS=1.Tokens go to Dataverse hosts only.
DATAVERSE_URLmust be https on a Dataverse domain. The client refuses to follow a link out of that environment and follows no redirects.Local, over stdio. No inbound port. Logs go to stderr and never contain tokens or row contents.
Agent content is data. Instructions and topic texts were written by makers. The server tells the assistant to treat them as data, never as instructions.
Snapshots are sensitive. They contain agent definitions. Files are written with owner only permissions. Keep them out of version control.
See SECURITY.md for how to report a problem.
Status and what is verified
This is version 0.1.0, alpha.
Verified offline: all fifteen tools against a real export of 21 agents and 322 components, the unit tests on a synthetic environment, the live client against a local stand in for the Dataverse Web API, and a full MCP session over stdio.
Verified against a real environment, read only: every request the server issues (some seventy GET requests: agents, components, eleven link tables, referenced tables, table and option set metadata) was sent to a live Dataverse environment from a signed in browser session. All answered as the client expects. The one refusal (
botcontentpack, 403 for a maker role) is the documented case and is reported as a warning. All 21 component type values and all option sets matched the curated model.That run changed the design: link tables are now read from the intersect entity set, because an
$expandsilently drops links to flows the caller cannot read. It surfaced one such link in the test environment.Not yet verified: the Python client itself signing in to a real environment (Azure CLI or app registration).
tests/test_live.pydoes that check on your machine in one command.One environment per server instance. Run one instance per environment for now.
What it cannot tell you
Usage, sessions, cost, credits and licences are not in these tables: they live in Agent 365 and the Power
Platform admin center. Neither are the documents behind a knowledge source, the Entra identity of an agent,
or agents built outside Copilot Studio. describe_model gives the assistant the same list, so it says so
instead of guessing.
Troubleshooting
Symptom | Fix |
Server does not appear | Fully quit and relaunch the client. Check the config path and that the JSON is valid. |
| Install |
"Set DATAVERSE_URL ..." | Set |
"The Azure CLI ('az') is not installed" | Install it and run |
The token was rejected (401) | Run |
A table is refused (403) | Your role cannot read it. A maker sees own agents only. Transcripts and content packs usually need an admin or a dedicated read role. |
An agent count looks low | You see what the signed in identity may read. Use an app registration for a view across all makers. |
A table or column does not exist (404) | Environments differ. Run |
"... is not a Dataverse host" | Check the address. For a host outside the known Dataverse domains set |
Inspect the server directly with the MCP Inspector:
npx @modelcontextprotocol/inspector uv run --directory /path/to/microsoft-copilot-studio-metadata-mcp microsoft-copilot-studio-metadata-mcpDevelopment
git clone https://github.com/tdries/microsoft-copilot-studio-metadata-mcp && cd microsoft-copilot-studio-metadata-mcp
uv sync --all-extras
uv run microsoft-copilot-studio-metadata-mcp # run from source
uv run pytest --cov # tests and coverage, offline, no Dataverse needed
uv run ruff check . # lint
uv run ruff format --check . # format
uv run mypy # strict typesThe same gates run in CI on Linux, macOS and Windows with Python 3.10 to 3.13: ruff check,
ruff format --check, mypy --strict and pytest with a coverage floor. The package ships a PEP 561
py.typed marker. CodeQL scans every push, and a fuzzing job (fuzz/) attacks the parsers that meet
untrusted input.
The test fixture is invented. Never add a real export to the repository. The demo GIFs are rendered by
docs/images/render_demo_gifs.py from invented data as well.
Contributions welcome: see CONTRIBUTING.md and the Code of Conduct.
Roadmap
Publish on PyPI, for a one line install with
uvxSeveral environments in one server, with the default environment found for you
Sharing per agent from
principalobjectaccessUsage and cost from the Power Platform and Agent 365 APIs, where the licence allows
Foundry agents through the Foundry Agent Service API
A Power BI template on top of the snapshot files
License
MIT © Tim Dries.
Not affiliated with or endorsed by Microsoft. Microsoft, Copilot Studio, Dataverse and Power Platform are trademarks of the Microsoft group of companies.
Available Tools
15 toolsaggregateAggregateARead-onlyIdempotent
Count rows of an agent related table, grouped by one or two columns.
by: one or two comma separated columns, e.g. "componenttype", "_ownerid_value",
"authenticationmode,accesscontrolpolicy". filter: same syntax as query.
Answers "how many per ..." questions without returning the rows. Groups carry the English
meaning of coded values when the model knows it, else the label Dataverse returned.
Inputs: by (required), table (required), top, filter. Returns: result
compare_agentsCompare agentsARead-onlyIdempotent
Compare two agents: settings that differ, how similar the instructions are, and which parts differ.
a, b: id, schema name or (part of) the name. Returns the differing settings, an instruction
similarity between 0 and 1 with a short diff, components only in one of them and components that
exist in both with a different definition. Use it to spot copies and drift between variants.
Inputs: a (required), b (required). Returns: result
describe_modelDescribe modelARead-onlyIdempotent
The data model behind Copilot Studio agents, as this server knows it. Read it before querying.
Sections: tables (purpose, key and important columns per table), relationships, option_sets (what
the coded columns mean, in English), yaml_kinds (how to read botcomponent.data), recipes (which tool
answers which question), not_in_these_tables (what you must get elsewhere), notes.
Pass a section name to get only that part; leave empty for everything.
Inputs: section. Returns: result
describe_tableDescribe tableARead-onlyIdempotent
Every readable column of one agent related table, from the environment itself.
Combines the live column list with what the curated model says about the table and its coded columns. Use it when a query fails on a column name or when you need a column the model does not list.
Inputs: table (required). Returns: result
diff_snapshotDiff snapshotARead-onlyIdempotent
What changed in the agents between an earlier snapshot and now, or between two snapshots.
older: file name of a snapshot in the snapshot folder. Leave empty to list the available files.
newer: another snapshot file name; empty compares against the current state.
Returns agents added and removed, and per changed agent the settings that moved and the
components added, removed or changed.
Inputs: newer, older. Returns: result
find_agents_usingFind agents usingARead-onlyIdempotent
Impact analysis: which agents depend on a connector, connection, flow, site, model or step kind.
what: text to match (part of a name, URL or id). Empty lists everything of the given kind.
kind (optional) narrows the match: connector, connection_reference, operation, action_kind
(connector, cloud flow, MCP server, connected agent ...), credential_mode (Invoker or Maker), flow,
knowledge_type, knowledge_site, file, topic_step (e.g. HttpRequestAction, SearchAndSummarizeContent),
http_url, model, dataverse_search, environment_variable, ai_plugin_operation, ai_model.
Returns the distinct values with the number of agents per value, then the agents with the
component each match came from. Example: find_agents_using("office365", kind="connector").
Inputs: kind, what. Returns: result
get_agentGet agentARead-onlyIdempotent
Everything about one agent, decoded: settings, instructions, actions, knowledge, topics, dependencies.
agent: id, schema name or (part of) the name. detail: "summary" (topics counted by origin, custom
topic names listed) or "full" (every topic with trigger, origin and step count).
Topic origin is system (fired by the platform), template (shipped with every new agent) or custom.
For an action, credential_mode Maker means every user acts with the maker's own credentials.
Use get_component with an id from this answer to read one part in full.
Inputs: agent (required), detail. Returns: result
get_componentGet componentARead-onlyIdempotent
One part of an agent in full: the decoded reading and the raw YAML definition.
component_id: a botcomponentid from get_agent, search or find_agents_using.
For a topic you get the trigger, trigger phrases, every step kind, flows and connections called,
HTTP endpoints and variables. For an action you get what it calls, with which credentials, and its
inputs and outputs. Set include_raw=false to leave the YAML out.
Inputs: component_id (required), include_raw. Returns: result
inventory_healthInventory healthARead-onlyIdempotent
Run the governance rules over every agent and return the findings, most serious first.
Rules by category. security: no_authentication, open_to_any_user, maker_credentials, raw_http_calls,
web_browsing, low_content_moderation. lifecycle: never_published, unpublished_changes, stale,
not_provisioned (failed or missing licence), last_publish_failed, unresolved_dependency. hygiene: default_name, empty_agent, duplicate_instructions.
quality: thin_instructions, action_without_description, model_knowledge_fallback.
model: undecoded_components.
Filters: category, severity (high, medium, low, info), agent (id or name). stale_days sets the
threshold for the stale rule. The answer starts with counts per rule and per severity.
Inputs: agent, category, severity, stale_days. Returns: result
list_agentsList agentsARead-onlyIdempotent
One decoded line per agent: who owns it, how it is secured and what it is made of.
Each line has owner, dates, authentication, access, orchestration, model_knowledge, web_browsing,
channels, and topic_count, custom_topic_count, action_count, knowledge_source_count and file_count, plus the
connectors it uses. Filters (all optional, combined with AND):
name_contains, owner_contains, published (true or false), authentication (e.g. "none"),
uses (text matched against connectors, sites, flows, operations and other dependencies).
Inputs: uses, limit, published, name_contains, +2 more. Returns: result
queryQueryARead-onlyIdempotent
Read rows from one agent related table with an OData style query. Read only.
table: a table from describe_model (bot, botcomponent, a link table, a referenced table).
select: comma separated columns. Empty returns the key and the columns the model documents, without
the large ones (data, configuration and the other JSON columns): name those when you need them.
filter: OData filter, e.g. "componenttype eq 16", "publishedon eq null",
"contains(name,'hr') and modifiedon gt 2026-01-01T00:00:00Z", "_parentbotid_value eq <guid>".
Lookup columns are written _<name>_value.
orderby: e.g. "modifiedon desc". top: rows to return, 1 to 500 (default 50).
Coded values come back with a <column>_label in the caller's language; describe_model has the
stable English meaning. For counts use aggregate; for one decoded agent use get_agent.
Inputs: table (required), top, filter, select, +1 more. Returns: result
save_snapshotSave snapshotA
Save the current agent definitions to a local JSON file, to compare against later.
Writes one file into the server's snapshot folder on the machine where the server runs
(AGENT_SNAPSHOT_DIR). Nothing is written to Dataverse. The file holds agent definitions, including
instructions, so treat it like the environment itself. label (optional) is added to the file name.
Run it on a schedule to build a history; diff_snapshot shows what changed since any earlier file.
Inputs: label. Returns: result
searchSearchARead-onlyIdempotent
Find a word or phrase anywhere in the agents: names, descriptions, instructions and YAML definitions.
Case insensitive substring match across every component of every visible agent. Each hit says
which agent and component, where it matched and shows a short snippet. Use it for questions like
"which agents mention the travel policy" or "where is this URL or variable used".
Inputs: text (required), limit. Returns: result
server_infoServer infoARead-onlyIdempotent
Confirm the connection and give the lay of the land. Call this first.
Returns the environment, the mode (live or snapshot), who you are signed in as, how many agents and components are visible, a breakdown by component kind and any tables that could not be read. Set refresh=true to reload the inventory instead of using the cached copy.
Inputs: refresh. Returns: result
verify_modelVerify modelARead-onlyIdempotent
Check the curated model against this environment and report every difference.
Looks for model tables that are missing here, bot* tables that exist here but are unknown to the
model, option set values the model does not know, and YAML kinds in botcomponent.data that this
server version does not decode. Run it once per environment and after platform updates.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct role: model documentation, live schema inspection, row querying, aggregation, agent listing, agent detail, component detail, search, dependency impact, governance, comparison, and snapshot operations. Overlaps such as query vs. aggregate and search vs. find_agents_using are resolved by explicit scope differences in the descriptions.
All names use snake_case and are readable, but the set mixes verb_noun names (verify_model, get_agent, save_snapshot) with bare verbs (query, aggregate, search) and noun phrases (server_info, inventory_health). The pattern is mostly consistent with minor deviations rather than fully uniform.
Fifteen tools is within the well-scoped range and matches the breadth of the domain: model discovery, querying, agent inspection, search, impact analysis, governance, comparison, and snapshots. Each tool appears to earn its place without redundant surface area.
For a read-only metadata and governance server, the surface is comprehensive: it covers model documentation, live schema checks, table querying and aggregation, agent and component inspection, search, dependency analysis, health rules, agent comparison, and snapshot/diff workflows. There are no obvious dead ends for the stated read-only purpose.
Maintenance
Related MCP Connectors
Governed app access for AI agents: 1,000+ apps & 12,000+ tools via Code Mode MCP.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Governed AI agent skills — one library, distributed to devs and exposed to remote agents over MCP.
Turn your offers into an AI agent. Set it up from your MCP assistant, answer customer questions, collect enquiries and connect with other agents via A2A. OAuth sign-in; free plan available.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides intelligent access to PowerPlatform/Dataverse entities and records, enabling entity metadata exploration, OData querying, relationship mapping, and AI-assisted query building through MCP.8MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to query databases correctly by serving governed context over MCP, including canonical metric definitions, relationships, business meaning, and guardrails, so answers come back with resolved definitions, fired filters, freshness, and a trust score instead of guesses.3-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to query and maintain Microsoft Dataverse and Dynamics 365 Customer Engagement environments via MCP, with 84 tools for records, metadata, web resources, plugin registration, data model management, diagnostics/audit, solutions, and classic Ribbon customization.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search an organization's data ecosystem, explore table- and column-level lineage, retrieve usage queries, manage metadata such as tags, owners, domains, and terms, and work with knowledge documents through MCP tools.Apache 2.0