Skip to main content

microsoft-copilot-studio-metadata-mcp

microsoft-copilot-studio-metadata-mcp

Ask any question about your Microsoft Copilot Studio agents, in any MCP client.

CI CodeQL Fuzz OpenSSF Scorecard Ruff Python 3.10 to 3.13 MCP compatible MIT License Dataverse read only Minimal dependencies Alpha

Asking which agents need no sign in and reach SharePoint


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_model before 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_using joins agents to connectors, connections, flows, SharePoint sites, models, MCP servers and topic steps.
  • Governance built in. inventory_health runs nineteen rules for security, lifecycle, hygiene and quality, and returns the findings most serious first.
  • Change over time. save_snapshot and diff_snapshot show 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_model lists 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 describe_model
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 find_agents_using
Governance rules no inventory_health, nineteen rules
Change over time no save_snapshot and diff_snapshot
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

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.

There is nothing to install: uvx fetches the package from PyPI when your client starts the server. Sign in once:

az login

Find 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 \
  -- uvx microsoft-copilot-studio-metadata-mcp

Then start with: "Call server_info, then describe_model, then tell me what stands out in inventory_health."

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):

{
  "mcpServers": {
    "copilot-studio-metadata": {
      "command": "uvx",
      "args": ["microsoft-copilot-studio-metadata-mcp"],
      "env": { "DATAVERSE_URL": "https://yourorg.crm4.dynamics.com" }
    }
  }
}

Fully quit and reopen Claude Desktop, then check the tools menu.

Cursor · Cline · Windsurf · VS Code

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 is servers instead of mcpServers.

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
DATAVERSE_URL yes¹ n/a Your environment, for example https://yourorg.crm4.dynamics.com. Must be https on a Dataverse domain.
DATAVERSE_AUTH no auto azcli, client_secret or token. Left empty, it follows from the variables you set.
AZURE_TENANT_ID no² n/a Tenant of the app registration. With the Azure CLI: only for a guest tenant.
AZURE_CLIENT_ID no² n/a Client id of the app registration.
AZURE_CLIENT_SECRET no² n/a Client secret of the app registration.
DATAVERSE_ACCESS_TOKEN no n/a A token you already have. For short tests.
AGENT_SNAPSHOT_FILE no¹ n/a Answer from this export file instead of a live environment. No network, no credentials.
AGENT_SNAPSHOT_DIR no ~/.microsoft-copilot-studio-metadata/snapshots Where save_snapshot writes and diff_snapshot reads.
AGENT_INCLUDE_TRANSCRIPTS no 0 1 makes conversationtranscript readable. Personal data: decide on purpose.
AGENT_CACHE_SECONDS no 300 How long the decoded inventory is reused.
DATAVERSE_TIMEOUT no 60 Timeout per request, in seconds.
AGENT_LOG_LEVEL no INFO DEBUG logs each HTTP call (method and path only) to stderr.
DATAVERSE_ALLOW_ANY_HOST no 0 1 allows a host outside the known Dataverse domains.

¹ 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 az login once A consultant or maker on a laptop. You see what your own account may see
App registration AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET 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 DATAVERSE_ACCESS_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
server_info Confirms the connection: environment, mode, identity, agent and component counts. refresh
describe_model The whole model: tables, relationships, coded values, YAML kinds, a recipe per question type. section
describe_table Every readable column of one table, live from the environment, with meaning where known. table
verify_model Differences between the curated model and this environment. none
query Read only OData style query on any agent related table. table, select, filter, orderby, top
aggregate Counts grouped by one or two columns. table, by, filter, top
list_agents One decoded line per agent, with filters. name_contains, owner_contains, published, authentication, uses
get_agent One agent in full: settings, instructions, actions, knowledge, topics, dependencies. agent, detail
get_component One part in full: decoded reading plus the raw YAML. component_id, include_raw
search A word or phrase anywhere in names, descriptions, instructions and definitions. text, limit
find_agents_using Impact analysis by connector, connection, flow, site, model, step kind and more. what, kind
inventory_health Governance findings, most serious first. category, severity, agent, stale_days
compare_agents Two agents side by side. a, b
save_snapshot Saves the current definitions to a local file. label
diff_snapshot What changed since a snapshot, or between two. older, newer

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?" inventory_health (no_authentication)
"Which agents are open to any user?" inventory_health (open_to_any_user)
"Which actions run on the maker's own credentials for every user?" find_agents_using("Maker", kind="credential_mode")
"Which topics call HTTP endpoints directly, and which ones?" find_agents_using("", kind="http_url")
"Which agents have web browsing switched on or run with low content moderation?" inventory_health(category="security")
"Give me the five most urgent findings." inventory_health(severity="high")

Dependencies and impact

Ask Answered by
"What breaks if we retire the Office 365 Outlook connection?" find_agents_using("office365", kind="connector")
"What breaks when this flow is changed?" find_agents_using("<flow>", kind="flow")
"Which SharePoint sites feed which agents?" find_agents_using("", kind="knowledge_site")
"Which agents use MCP servers, and which ones?" find_agents_using("MCP", kind="action_kind")
"Which agents can send mail or post in Teams?" find_agents_using("SendEmail", kind="operation")
"Which agents point at a flow or connection that is gone?" inventory_health (unresolved_dependency)

Asking what breaks when a connection is retired

Inventory and ownership

Ask Answered by
"How many agents do we have, and who built what?" server_info, list_agents
"Which agents were never published, and who owns them?" list_agents(published=false)
"Which agents does a leaver own?" list_agents(owner_contains=...)
"Which agents have not been touched for six months?" inventory_health (stale, stale_days)
"How many agents per owner, language or template?" aggregate(table="bot", by=...)
"Which agents were created this quarter?" query(table="bot", filter="createdon gt ...")

Change over time

Ask Answered by
"Keep a record of today's state." save_snapshot
"What changed in our agents since last Monday?" diff_snapshot(older=...)
"Did anyone switch off authentication?" diff_snapshot (settings)
"Which topics of this agent were edited?" diff_snapshot (components_changed)

Asking what changed since the last snapshot

Content and logic

Ask Answered by
"Show me the instructions of the HR assistant." get_agent
"How does the HR assistant differ from the Finance one?" compare_agents
"Which agents mention the travel policy?" search
"Which topics are custom, and which came with the template?" get_agent(detail="full")
"What triggers this topic, and what steps does it take?" get_component
"Which agents are copies of each other?" inventory_health (duplicate_instructions)

Architecture

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:

  1. 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 through describe_model.
  2. Live verification. verify_model asks 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.
  3. Defensive decoders in decode.py. The YAML in botcomponent.data is not documented by Microsoft and it changes. A decoder never guesses: an unknown kind is returned raw and flagged, and shows up in verify_model and inventory_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. query and aggregate reach 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. conversationtranscript holds personal data and stays unreadable unless an administrator sets AGENT_INCLUDE_TRANSCRIPTS=1.
  • Tokens go to Dataverse hosts only. DATAVERSE_URL must 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.1, 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 $expand silently 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.py does 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.
spawn uv ENOENT Install uv, or use the absolute path to uv.
"Set DATAVERSE_URL ..." Set DATAVERSE_URL for live mode or AGENT_SNAPSHOT_FILE for snapshot mode.
"The Azure CLI ('az') is not installed" Install it and run az login, or sign in with an app registration.
The token was rejected (401) Run az login again. For a guest tenant add --tenant <id> and set AZURE_TENANT_ID.
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 verify_model.
"... is not a Dataverse host" Check the address. For a host outside the known Dataverse domains set DATAVERSE_ALLOW_ANY_HOST=1.

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-mcp

Development

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 types

The 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 uvx
  • Several environments in one server, with the default environment found for you
  • Sharing per agent from principalobjectaccess
  • Usage 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. The Copilot Studio and Dataverse icons in the diagrams are Microsoft's official Power Platform icons, shown unmodified to name the products this server works with.

Metadata

Release files for microsoft-copilot-studio-metadata-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microsoft-copilot-studio-metadata-mcp 0.1.1
File Size Uploaded Provenance Actions
microsoft_copilot_studio_metadata_mcp-0.1.1.tar.gz 939.6 kB With provenance Details for microsoft_copilot_studio_metadata_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for microsoft-copilot-studio-metadata-mcp 0.1.1
File Interpreter ABI Platform Actions
microsoft_copilot_studio_metadata_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for microsoft_copilot_studio_metadata_mcp-0.1.1-py3-none-any.whl

Total release size: 991.2 kB

Release files / microsoft_copilot_studio_metadata_mcp-0.1.1.tar.gz

Download URL microsoft_copilot_studio_metadata_mcp-0.1.1.tar.gz
Size 939.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9d4d0107e001d3662802cb9eb7c893350f664b07945ea1cc61450c3d36459cc3
BLAKE2b-256 checksum
How to use checksums
c8077d6892d2a30c32876f41908a1d49bde289a9d67482416abad486b268aa14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / microsoft_copilot_studio_metadata_mcp-0.1.1-py3-none-any.whl

Download URL microsoft_copilot_studio_metadata_mcp-0.1.1-py3-none-any.whl
Size 51.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73aefd9ff9985e2eb2d4a85ff4fb18c6fb7ea369eebc335f27b00cce0a9d8524
BLAKE2b-256 checksum
How to use checksums
d91003ae343f4d1c3c8899ee1f34726e3b94c81147d05209abdb7d016429d062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for microsoft-copilot-studio-metadata-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for microsoft_copilot_studio_metadata_mcp-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page