mcp

作者 MicrosoftDocs已验证

Official Microsoft Learn MCP Server – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples.

1,463
Stars
173
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/MicrosoftDocs/mcp

快速入门

使用 mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

🌟 Microsoft Learn MCP Server

Install in VS Code Install in VS Code Insiders

Stop AI Hallucinations. Give your AI assistant (Claude, Cursor, Copilot, Codex, ...) direct access to the latest official Microsoft documentation.

✨ Free. One-click install. No key needed.

🎯 Why install this?

Stop relying on outdated training data or risky web searches. Learn MCP server provides secure, direct access to Microsoft official docs.

  • 🧠 Eliminate Hallucinations. Stop your AI from inventing non-existent Azure SDK methods or hallucinating library packages. Get code that actually compiles.

  • 🔌 Plug & Play (No Auth). No API keys, no logins, no sign-ups required. Just one-click install and start coding immediately.

  • 🛡️ 100% Trusted & Safe. Protect your supply chain. Unlike generic web searches that may scrape insecure blogs or malicious sites, this tool only accesses official 1st-party Microsoft documentation.

  • 💸 Completely Free. High search capacity tailored for seamless, heavy coding sessions.

✨ Example Prompts

"Give me the Azure CLI commands to create an Azure Container App with a managed identity."

"Is gpt-5.4 available in Azure EU regions?"

"Are you sure this is the right way to implement IHttpClientFactory in a .NET 8 minimal API?"

"Show me runnable Python code to do harms eval using the Azure AI Foundry evaluation SDK."

🌐 The Microsoft Learn MCP Server Endpoint

The Microsoft Learn MCP Server is accessible to any IDE, agent, or tool that supports the Model Context Protocol (MCP). Any compatible client can connect to the following remote MCP endpoint:

https://learn.microsoft.com/api/mcp

Note: This URL is intended for use within a compliant MCP client via Streamable HTTP, such as the recommended clients listed in our Getting Started section. It does not support direct access from a web browser and may return a 405 Method Not Allowed error if accessed manually. For developers who need to build their own solution, please follow the mandatory guidelines in the Building a Custom Client section to ensure your implementation is resilient and supported.

Standard config works in most clients:

{
  "servers": {
    "microsoft-learn": {
      "type": "http",
      "url": "https://learn.microsoft.com/api/mcp"
    }
  }
}

For experimental features, see the Experimental Features section below.

🧪 Experimental Features

The Microsoft Learn MCP Server offers experimental features that are under active development. These features may change or be refined based on user feedback and usage patterns.

OpenAI-Compatible Endpoint

For applications that require OpenAI Deep Research model compatibility, you can use the OpenAI-compatible endpoint:

https://learn.microsoft.com/api/mcp/openai-compatible

This endpoint supports OpenAI Deep Research models and follows the OpenAI MCP specification.

Token Budget Control

To manage token usage and control costs, you can append the maxTokenBudget query parameter to the MCP endpoint URL. This parameter limits the token count in search tool responses by truncating the content to meet your specified budget.

https://learn.microsoft.com/api/mcp?maxTokenBudget=2000

Note: These experimental features are subject to change. We welcome feedback through our GitHub Discussions.

🛠️ Currently Supported Tools

Tool NameDescriptionInput Parameters
microsoft_docs_searchPerforms semantic search against Microsoft official technical documentationquery (string): The search query for retrieval
microsoft_docs_fetchFetch and convert a Microsoft documentation page into markdown formaturl (string): URL of the documentation page to read
microsoft_code_sample_searchSearch for official Microsoft/Azure code snippets and examplesquery (string): Search query for Microsoft/Azure code snippets
language (string, optional): Programming language filter.

💻 Microsoft Learn CLI preview

npm version

The @microsoft/learn-cli package gives you terminal access to the same tools — search docs, fetch pages, and find code samples — without an MCP client.

# Run instantly (no install)
npx @microsoft/learn-cli search "azure functions timeout"

# Or install globally
npm install -g @microsoft/learn-cli
# then use `mslearn`
mslearn search "azure functions timeout"

Pass --json to get structured JSON output, useful for programmatic processing:

mslearn search "azure openai" --json | jq '.results[].title'

See cli/README.md for the full command reference.

🤖 Agent Skills

Agent Skills are portable instruction packages that help AI agents use tools more effectively. We provide three skills that guide agents on when and how to use the Microsoft Learn MCP tools:

SkillPurposeBest For
microsoft-docsUnderstanding concepts, tutorials, architecture, limits"How does X work?", learning, configuration guides
microsoft-code-referenceAPI lookups, code samples, verification, error fixingImplementing code, finding correct methods, troubleshooting
microsoft-skill-creatorMeta-skill that generates custom agent skills for any Microsoft technologyCreating a skill to teach agents about a new Azure library, .NET feature, or other Microsoft tech

Quick Setup

These agent skills are packed in a microsoft-docs plugin together with the Learn MCP server itself. If you use Claude Code, run the following command and restart Claude Code:

/plugin install microsoft-docs@claude-plugins-official

Or if you use GitHub Copilot CLI, run this command:

/plugin install microsoftdocs/mcp

Otherwise:

  1. Install the MCP Server first — See Installation below
  2. Copy the skill folders to your project's .github/skills/ or .claude/skills/ directory:

Supported Agents

Agent Skills work across multiple AI agents:

  • VS Code (Insiders) — enable chat.useAgentSkills setting
  • GitHub Copilot CLI & Copilot coding agent
  • Claude Code, Cursor, OpenAI Codex, and more

Which Skill Do I Need?

If you want to...Install
Cover all Microsoft docs scenariosAll three skills
Focus on coding (APIs, samples, errors)microsoft-code-reference only
Focus on facts & concepts (limits, config, tutorials)microsoft-docs only
Generate a custom skill for a specific Microsoft technologymicrosoft-skill-creator only

🔌 Installation & Getting Started

The Microsoft Learn MCP Server supports quick installation across multiple development environments. Choose your preferred client below for streamlined setup:

ClientOne-click InstallationMCP Guide
VS CodeInstall in VS Code
or search "@mcp learn" in Extensions to show "Microsoft Learn" MCP
VS Code MCP Official Guide
GitHub Copilot CLI/plugin install microsoftdocs/mcp
Claude DesktopFollow "Add custom connector" instructions in official guide.Claude Desktop Remote MCP Guide
Claude Code/plugin install microsoft-docs@claude-plugins-official (includes MCP server + skills)Claude Code Remote MCP Guide
Visual StudioUpgrade to latest VS 2022 or 2026, "Microsoft Learn" MCP is already built-inVisual Studio MCP Official Guide
Cursor IDEInstall in CursorCursor MCP Official Guide
Codexcodex mcp add "microsoft-learn" --url "https://learn.microsoft.com/api/mcp"Codex MCP documentation
Roo CodeOpen Roo Code Marketplace, search for Microsoft Learn, and click InstallRoo Code MCP Official Guide
ClineManual configuration required
Use "type": "streamableHttp"
Cline MCP Official Guide
Gemini CLIManual configuration required
View ConfigNote: Add an mcpServer object to .gemini/settings.json file
{
"Microsoft Learn MCP Server": {
"httpUrl": "https://learn.microsoft.com/api/mcp"
}
}
How to set up your MCP server
Qwen CodeManual configuration required
View ConfigNote: Add an mcpServer object to .qwen/settings.json file
{
"Microsoft Learn MCP Server": {
"httpUrl": "https://learn.microsoft.com/api/mcp"
}
}
Configure the MCP server in settings.json
GitHubManual configuration required
View ConfigNote: Navigate to Settings → Coding agent
{
"mslearn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp",
"tools": [
"*"
]
}
}
ChatGPTManual configuration required
View Instructions1. Open ChatGPT in the browser
2. Go to Settings → Connectors → Advanced settings → Turn Developer mode on
3. Go back to connectors and click create
4. Give the connector a name, enter URL https://learn.microsoft.com/api/mcp, set authentication to No authentication and trust the application
5. Click create
ChatGPT Official Guide
WindsurfManual configuration required
View Config
{
"mcpServers": {
"microsoft-learn": {
"serverUrl": "https://learn.microsoft.com/api/mcp"
}
}
}
Windsurf MCP Guide
Kiro
View Config
{
"microsoft-learn": {
"url": "https://learn.microsoft.com/api/mcp"
}
}
Kiro MCP Guide

⚠️ Building a Custom Client

If your use case requires a direct, programmatic integration, it is essential to understand that MCP is a dynamic protocol, not a static API. The available tools and their schemas will evolve.

To build a resilient client that will not break as the service is updated, you should adhere to the following principles:

  1. Discover Tools Dynamically: Your client should fetch current tool definitions from the server at runtime (e.g., using tools/list). Do not hard-code tool names or parameters.
  2. Refresh on Failure: Your client should handle errors during tool/invoke calls. If a tool call fails with an error indicating it is missing or its schema has changed (e.g., an HTTP 404 or 400 error), your client should assume its cache is stale and automatically trigger a refresh by calling tools/list.
  3. Handle Live Updates: Your client should listen for server notifications (e.g., listChanged) and refresh its tool cache accordingly.

❓ Troubleshooting

💻 System Prompt

Even tool-friendly models like Claude Sonnet 4 sometimes fail to call MCP tools by default; use system prompts to encourage usage.

Here's an example of a Cursor rule (a system prompt) that will cause the LLM to utilize microsoft-learn more frequently:

## Querying Microsoft Documentation

You have access to MCP tools called `microsoft_docs_search`, `microsoft_docs_fetch`, and `microsoft_code_sample_search` - these tools allow you to search through and fetch Microsoft's latest official documentation and code samples, and that information might be more detailed or newer than what's in your training data set.

When handling questions around how to work with native Microsoft technologies, such as C#, F#, ASP.NET Core, Microsoft.Extensions, NuGet, Entity Framework, the `dotnet` runtime - please use these tools for research purposes when dealing with specific / narrowly defined questions that may occur.

⚠️ Common Issues

IssuePossible Solution
Connection errorsVerify your network connection and that the server URL is correctly entered
No results returnedTry rephrasing your query with more specific technical terms
Tool not appearing in VS CodeRestart VS Code or check that the MCP extension is properly installed
HTTP status 405Method not allowed happens when a browser tries to connect to the endpoint. Try using the MCP Server through VS Code GitHub Copilot or MCP Inspector instead.

🆘 Getting Support

📚 Additional Resources

常见问题

What is mcp?

mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by MicrosoftDocs. Official Microsoft Learn MCP Server – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples. It has 1,463 GitHub stars.

Is mcp safe to use?

Yes. mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install mcp?

Clone the repository with "git clone https://github.com/MicrosoftDocs/mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is mcp written in?

mcp is primarily written in TypeScript. It is open-source under MicrosoftDocs on GitHub, so you can review or fork the full source.

Are there alternatives to mcp?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情