mcp-configure by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill mcp-configure此技能使用您组织的环境 URL 为 GitHub Copilot 配置 Dataverse MCP 服务器。每个组织都使用基于组织标识符的唯一服务器名称进行注册(例如,DataverseMcporgbc9a965c)。如果用户提供了 URL,则为:$ARGUMENTS。
询问用户是希望全局配置 MCP 服务器还是仅为此项目配置:
您希望如何配置 Dataverse MCP 服务器:
- 全局(在所有项目中可用)
- 仅限项目(仅在此项目中可用)
根据他们的选择,设置 CONFIG_PATH 变量:
~/.copilot/mcp-config.json(使用用户的主目录).mcp/copilot/mcp.json(相对于当前工作目录)存储此路径以供步骤 1 和 6 使用。
读取 CONFIG_PATH(在步骤 0 中确定)处的 MCP 配置文件,以检查已配置的服务器。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
配置文件是一个具有以下结构的 JSON 文件:
{
"mcpServers": {
"ServerName1": {
"type": "http",
"url": "https://example.com/api/mcp"
}
}
}
或者它可能使用 "servers" 而不是 "mcpServers" 作为顶级键。
从已配置的服务器中提取所有 url 值,并将其存储为 CONFIGURED_URLS。例如:
["https://orgfbb52bb7.crm.dynamics.com/api/mcp"]
如果文件不存在或为空,则将 CONFIGURED_URLS 视为空([])。此步骤绝不能阻塞技能。
询问用户:
您希望如何提供您的 Dataverse 环境 URL?
- 自动发现 — 从您的 Azure 账户列出可用环境(需要 Azure CLI)
- 手动输入 — 直接输入 URL
根据他们的选择:
检查先决条件:
az) 是否已安装(在 Windows 上使用 which az 或 where az 检查)进行 API 调用:
检查用户是否已登录到 Azure CLI:
az account show
如果失败,提示用户登录:
az login
2. 获取 Power Apps API 的访问令牌:
az account get-access-token --resource https://service.powerapps.com/ --query accessToken --output tsv
3. 调用 Power Apps API 以列出环境:
GET https://api.powerapps.com/providers/Microsoft.PowerApps/environments?api-version=2016-11-01
Authorization: Bearer {token}
Accept: application/json
4. 解析 JSON 响应,并筛选出 properties?.linkedEnvironmentMetadata?.instanceUrl 不为 null 的环境。
对于每个匹配的环境,提取:
properties.displayName 作为 displayNameproperties.linkedEnvironmentMetadata.instanceUrl(移除尾部斜杠)作为 instanceUrl以此格式创建环境列表:
[ { "displayName": "My Org (default)", "instanceUrl": "https://orgfbb52bb7.crm.dynamics.com" }, { "displayName": "Another Env", "instanceUrl": "https://orgabc123.crm.dynamics.com" } ]
如果 API 调用成功,则继续步骤 3。
如果 API 调用失败(用户未登录、网络错误、未找到环境或任何其他错误),请告诉用户出了什么问题,并回退到步骤 2b。
请用户直接提供其环境 URL:
请输入您的 Dataverse 环境 URL。
示例:
https://myorg.crm10.dynamics.com您可以在 Power Platform 管理中心的环境下找到此信息。
然后跳转到步骤 4。
将环境以编号列表形式呈现。对于每个环境,检查 CONFIGURED_URLS 中的任何 URL 是否以该环境的 instanceUrl 开头——如果是,则在该行附加 (已配置)。
我在您的账户上找到了以下 Dataverse 环境。您想配置哪一个?
- My Org (default) —
https://orgfbb52bb7.crm.dynamics.com(已配置)- Another Env —
https://orgabc123.crm.dynamics.com
输入您选择的编号,或输入 "manual" 以自行输入 URL。
如果用户选择了一个已配置的环境,请在继续之前确认他们是否要重新注册它(例如,为了更改端点类型)。
如果用户输入 "manual",则回退到步骤 2b。
从所选环境(或手动输入的 URL)中获取 instanceUrl,并去除任何尾部斜杠。这是本技能后续步骤中的 USER_URL。
询问用户:
您希望使用哪个端点?
- 正式版 (GA) —
/api/mcp(推荐)- 预览版 —
/api/mcp_preview(最新功能,可能不稳定)
根据他们的选择:
MCP_URL 设置为 {USER_URL}/api/mcpMCP_URL 设置为 {USER_URL}/api/mcp_preview更新 CONFIG_PATH(在步骤 0 中确定)处的 MCP 配置文件,以添加新服务器。
从 USER_URL 生成唯一的服务器名称:
https://orgbc9a965c.crm10.dynamics.com → orgbc9a965cDataverseMcp 以创建服务器名称
DataverseMcporgbc9a965c这就是 SERVER_NAME。
更新配置文件:
如果 CONFIG_PATH 用于项目作用域的配置(.mcp/copilot/mcp.json),请首先确保目录存在:
mkdir -p .mcp/copilot
读取 CONFIG_PATH 处的现有配置文件,如果不存在则创建新的空配置:
{}
确定使用哪个顶级键:
"servers",则使用它"mcpServers"添加或更新服务器条目:
{ "mcpServers": { "{SERVER_NAME}": { "type": "http", "url": "{MCP_URL}" } } }
将更新后的配置以适当的 JSON 格式(2 空格缩进)写回 CONFIG_PATH。
重要注意事项:
SERVER_NAME 已存在,则使用新的 MCP_URL 更新它继续步骤 7。
告诉用户:
✅ Dataverse MCP 服务器已为 GitHub Copilot 配置,地址为
{MCP_URL}。配置已保存到:
{CONFIG_PATH}重要提示:您必须重启编辑器才能使更改生效。
重启您的编辑器或重新加载窗口,然后您将能够:
- 列出您的 Dataverse 环境中的所有表
- 从任何表查询记录
- 创建、更新或删除记录
- 探索您的架构和关系
如果出现问题,请帮助用户检查:
https://<org>.<region>.dynamics.com).mcp/copilot/mcp.json 文件已成功创建~/.copilot/ 目录的权限每周安装量
7.0K
仓库
GitHub 星标数
26.7K
首次出现
2026年2月26日
安全审计
安装于
codex6.9K
gemini-cli6.9K
opencode6.9K
cursor6.9K
github-copilot6.9K
amp6.9K
This skill configures the Dataverse MCP server for GitHub Copilot with your organization's environment URL. Each organization is registered with a unique server name based on the org identifier (e.g., DataverseMcporgbc9a965c). If the user provided a URL it is: $ARGUMENTS.
Ask the user whether they want to configure the MCP server globally or for this project only:
Would you like to configure the Dataverse MCP server:
- Globally (available in all projects)
- Project-only (available only in this project)
Based on their choice, set the CONFIG_PATH variable:
~/.copilot/mcp-config.json (use the user's home directory).mcp/copilot/mcp.json (relative to the current working directory)Store this path for use in steps 1 and 6.
Read the MCP configuration file at CONFIG_PATH (determined in step 0) to check for already-configured servers.
The configuration file is a JSON file with the following structure:
{
"mcpServers": {
"ServerName1": {
"type": "http",
"url": "https://example.com/api/mcp"
}
}
}
Or it may use "servers" instead of "mcpServers" as the top-level key.
Extract all url values from the configured servers and store them as CONFIGURED_URLS. For example:
["https://orgfbb52bb7.crm.dynamics.com/api/mcp"]
If the file doesn't exist or is empty, treat CONFIGURED_URLS as empty ([]). This step must never block the skill.
Ask the user:
How would you like to provide your Dataverse environment URL?
- Auto-discover — List available environments from your Azure account (requires Azure CLI)
- Manual entry — Enter the URL directly
Based on their choice:
Check prerequisites:
az) is installed (check with which az or where az on Windows)Make the API call:
Check if the user is logged into Azure CLI:
az account show
If this fails, prompt the user to log in:
az login
2. Get an access token for the Power Apps API:
az account get-access-token --resource https://service.powerapps.com/ --query accessToken --output tsv
3. Call the Power Apps API to list environments:
GET https://api.powerapps.com/providers/Microsoft.PowerApps/environments?api-version=2016-11-01
Authorization: Bearer {token}
Accept: application/json
4. Parse the JSON response and filter for environments where properties?.linkedEnvironmentMetadata?.instanceUrl is not null.
For each matching environment, extract:
properties.displayName as displayNameproperties.linkedEnvironmentMetadata.instanceUrl (remove trailing slash) as instanceUrlCreate a list of environments in this format:
[ { "displayName": "My Org (default)", "instanceUrl": "https://orgfbb52bb7.crm.dynamics.com" }, { "displayName": "Another Env", "instanceUrl": "https://orgabc123.crm.dynamics.com" } ]
If the API call succeeds , proceed to step 3.
If the API call fails (user not logged in, network error, no environments found, or any other error), tell the user what went wrong and fall back to step 2b.
Ask the user to provide their environment URL directly:
Please enter your Dataverse environment URL.
Example:
https://myorg.crm10.dynamics.comYou can find this in the Power Platform Admin Center under Environments.
Then skip to step 4.
Present the environments as a numbered list. For each environment, check whether any URL in CONFIGURED_URLS starts with that environment's instanceUrl — if so, append (already configured) to the line.
I found the following Dataverse environments on your account. Which one would you like to configure?
- My Org (default) —
https://orgfbb52bb7.crm.dynamics.com(already configured)- Another Env —
https://orgabc123.crm.dynamics.com
Enter the number of your choice, or type "manual" to enter a URL yourself.
If the user selects an already-configured environment, confirm that they want to re-register it (e.g. to change the endpoint type) before proceeding.
If the user types "manual", fall back to step 2b.
Take the instanceUrl from the chosen environment (or the manually entered URL) and strip any trailing slash. This is USER_URL for the remainder of the skill.
Ask the user:
Which endpoint would you like to use?
- Generally Available (GA) —
/api/mcp(recommended)- Preview —
/api/mcp_preview(latest features, may be unstable)
Based on their choice:
MCP_URL to {USER_URL}/api/mcpMCP_URL to {USER_URL}/api/mcp_previewUpdate the MCP configuration file at CONFIG_PATH (determined in step 0) to add the new server.
Generate a unique server name from the USER_URL:
https://orgbc9a965c.crm10.dynamics.com → orgbc9a965cDataverseMcp to create the server name
DataverseMcporgbc9a965cThis is the SERVER_NAME.
Update the configuration file:
If CONFIG_PATH is for a project-scoped configuration (.mcp/copilot/mcp.json), ensure the directory exists first:
mkdir -p .mcp/copilot
Read the existing configuration file at CONFIG_PATH, or create a new empty config if it doesn't exist:
{}
Determine which top-level key to use:
"servers", use that"mcpServers"Add or update the server entry:
{ "mcpServers": { "{SERVER_NAME}": { "type": "http", "url": "{MCP_URL}" } } }
Write the updated configuration back to CONFIG_PATH with proper JSON formatting (2-space indentation).
Important notes:
SERVER_NAME already exists, update it with the new MCP_URLProceed to step 7.
Tell the user:
✅ Dataverse MCP server configured for GitHub Copilot at
{MCP_URL}.Configuration saved to:
{CONFIG_PATH}IMPORTANT: You must restart your editor for the changes to take effect.
Restart your editor or reload the window, then you will be able to:
- List all tables in your Dataverse environment
- Query records from any table
- Create, update, or delete records
- Explore your schema and relationships
If something goes wrong, help the user check:
https://<org>.<region>.dynamics.com).mcp/copilot/mcp.json file was created successfully~/.copilot/ directoryWeekly Installs
7.0K
Repository
GitHub Stars
26.7K
First Seen
Feb 26, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
codex6.9K
gemini-cli6.9K
opencode6.9K
cursor6.9K
github-copilot6.9K
amp6.9K
97,600 周安装