Microsoft Learn MCP
平台与服务编辑精选by microsoftdocs
Microsoft Learn MCP 是让 AI 助手直接查询微软官方文档和代码示例的服务器。
这工具解决了 AI 在微软技术栈上胡编乱造的问题,比如让 Claude 准确生成可运行的 Azure SDK 代码。最适合 .NET 或 Azure 开发者,能省去手动查文档的麻烦。不过,它目前只覆盖微软生态,对其他平台帮助有限。
什么是 Microsoft Learn MCP?
Microsoft Learn MCP 是让 AI 助手直接查询微软官方文档和代码示例的服务器。
README
🌟 Microsoft Learn MCP Server
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
IHttpClientFactoryin 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 Allowederror 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 Name | Description | Input Parameters |
|---|---|---|
microsoft_docs_search | Performs semantic search against Microsoft official technical documentation | query (string): The search query for retrieval |
microsoft_docs_fetch | Fetch and convert a Microsoft documentation page into markdown format | url (string): URL of the documentation page to read |
microsoft_code_sample_search | Search for official Microsoft/Azure code snippets and examples | query (string): Search query for Microsoft/Azure code snippets<br/>language (string, optional): Programming language filter. |
💻 Microsoft Learn CLI preview
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:
| Skill | Purpose | Best For |
|---|---|---|
microsoft-docs | Understanding concepts, tutorials, architecture, limits | "How does X work?", learning, configuration guides |
microsoft-code-reference | API lookups, code samples, verification, error fixing | Implementing code, finding correct methods, troubleshooting |
microsoft-skill-creator | Meta-skill that generates custom agent skills for any Microsoft technology | Creating 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:
- Install the MCP Server first — See Installation below
- Copy the skill folders to your project's
.github/skills/or.claude/skills/directory:microsoft-docs— for concepts, tutorials, and factual lookupsmicrosoft-code-reference— for API lookups, code samples, and troubleshootingmicrosoft-skill-creator— meta-skill for generating custom skills about Microsoft technologies
Supported Agents
Agent Skills work across multiple AI agents:
- VS Code (Insiders) — enable
chat.useAgentSkillssetting - 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 scenarios | All 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 technology | microsoft-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:
| Client | One-click Installation | MCP Guide |
|---|---|---|
| VS Code | VS Code MCP Official Guide | |
| GitHub Copilot CLI | /plugin install microsoftdocs/mcp | |
| Claude Desktop | Follow "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 Studio | Upgrade to latest VS 2022 or 2026, "Microsoft Learn" MCP is already built-in | Visual Studio MCP Official Guide |
| Cursor IDE | Cursor MCP Official Guide | |
| Codex | codex mcp add "microsoft-learn" --url "https://learn.microsoft.com/api/mcp" | Codex MCP documentation |
| Roo Code | Open Roo Code Marketplace, search for Microsoft Learn, and click Install | Roo Code MCP Official Guide |
| Cline | Manual configuration required<br/>Use "type": "streamableHttp" | Cline MCP Official Guide |
| Gemini CLI | Manual configuration required<br/> <details><summary>View Config</summary>Note: Add an mcpServer object to .gemini/settings.json file<br/><pre>{<br/> "Microsoft Learn MCP Server": {<br/> "httpUrl": "https://learn.microsoft.com/api/mcp" <br/> }<br/>}</pre></details> | How to set up your MCP server |
| Qwen Code | Manual configuration required<br/> <details><summary>View Config</summary>Note: Add an mcpServer object to .qwen/settings.json file<br/><pre>{<br/> "Microsoft Learn MCP Server": {<br/> "httpUrl": "https://learn.microsoft.com/api/mcp" <br/> }<br/>}</pre></details> | Configure the MCP server in settings.json |
| GitHub | Manual configuration required<br/> <details><summary>View Config</summary>Note: Navigate to Settings → Coding agent<br/><pre>{<br/> "mslearn": {<br/> "type": "http",<br/> "url": "https://learn.microsoft.com/api/mcp",<br/> "tools": [<br/> "*"<br/> ]<br/> }<br/>}</pre></details> | |
| ChatGPT | Manual configuration required<br/> <details><summary>View Instructions</summary>1. Open ChatGPT in the browser<br/>2. Go to Settings → Connectors → Advanced settings → Turn Developer mode on<br/>3. Go back to connectors and click create<br/>4. Give the connector a name, enter URL https://learn.microsoft.com/api/mcp, set authentication to No authentication and trust the application<br/>5. Click create<br/> </details> | ChatGPT Official Guide |
| Windsurf | Manual configuration required<br/> <details><summary>View Config</summary><pre>{<br/> "mcpServers": {<br/> "microsoft-learn": {<br/> "serverUrl": "https://learn.microsoft.com/api/mcp"<br/> }<br/> }<br/>}</pre></details> | Windsurf MCP Guide |
| Kiro | <details><summary>View Config</summary><pre>{<br/> "microsoft-learn": {<br/> "url": "https://learn.microsoft.com/api/mcp"<br/> }<br/>}</pre> </details> | 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:
- 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.- Refresh on Failure: Your client should handle errors during
tool/invokecalls. 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 callingtools/list.- 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
| Issue | Possible Solution |
|---|---|
| Connection errors | Verify your network connection and that the server URL is correctly entered |
| No results returned | Try rephrasing your query with more specific technical terms |
| Tool not appearing in VS Code | Restart VS Code or check that the MCP extension is properly installed |
| HTTP status 405 | Method 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
常见问题
Microsoft Learn MCP 是什么?
Official Microsoft Learn MCP Server – real-time, trusted docs & code samples for AI and LLMs.
相关 Skills
MCP构建
by anthropics
聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。
✎ 想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。
Slack动图
by anthropics
面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。
✎ 帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。
接口设计评审
by alirezarezvani
审查 REST API 设计是否符合行业规范,自动检查命名、HTTP 方法、状态码与文档覆盖,识别破坏性变更并给出设计评分,适合评审接口方案和版本迭代前把关。
✎ 做API和架构方案时,它能帮你提前揪出接口设计问题并对齐最佳实践,评审视角系统,团队协作更省心。
相关 MCP Server
Slack 消息
编辑精选by Anthropic
Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。
✎ 这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。
by netdata
io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。
✎ 这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。
by d4vinci
Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。
✎ 这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。