by MicrosoftDocs
Provides semantic search and fetch capabilities for Microsoft official documentation, returning content in markdown format via a lightweight streamable HTTP transport for AI agents and development tools.
The Microsoft Learn MCP Server enables AI‑powered tools and IDE extensions to retrieve up‑to‑date Microsoft documentation programmatically. It exposes two core tools – microsoft_docs_search for semantic search and microsoft_docs_fetch for downloading a doc page as markdown – through a remote Model Context Protocol (MCP) endpoint.
https://learn.microsoft.com/api/mcp.search Microsoft docs or fetch full doc.Q: Do I need an API key? A: No, the endpoint is publicly accessible for supported MCP clients.
Q: Can I call the endpoint from a web browser?
A: No, it only works via the MCP protocol; browsers will return a 405 Method Not Allowed.
Q: What if a tool definition changes?
A: Clients should dynamically refresh tool lists (tools/list) on errors or listChanged notifications.
Q: How do I install the server locally? A: The server is hosted by Microsoft; only client configuration is required.
The Microsoft Learn MCP Server is a remote MCP Server that enables clients like GitHub Copilot and other AI agents to bring trusted and up-to-date information directly from Microsoft's official documentation. It supports streamable http transport, which is lightweight for clients to use.
Please note that this project is in Public Preview and implementation may significantly change prior to our General Availability.
Your AI assistant should automatically use these tools for Microsoft-related topics. With both search and fetch capabilities, you can get quick answers or comprehensive deep dives. To ensure that it always consults the official documentation, you can add phrases like search Microsoft docs, deep dive, fetch full doc.
"Give me the Azure CLI commands to create an Azure Container App with a managed identity. search Microsoft docs"
"Is gpt-4.1-mini available in EU regions? fetch full doc"
"Are you sure this is the right way to implement
IHttpClientFactoryin a .NET 8 minimal API? search Microsoft docs and fetch full doc"
"Show me the complete guide for implementing authentication in ASP.NET Core. fetch full doc"
"I need to understand Azure Functions end-to-end. search Microsoft docs and deep dive"
"Get me the full step-by-step tutorial for deploying a .NET application to Azure App Service. search Microsoft docs and deep dive"
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.
Example JSON configuration:
{
"microsoft.docs.mcp": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
| 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 |
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 | |
| Claude Desktop | View Instructions1. Open Claude Desktop2. Go to Settings → Integrations3. Click Add Integration4. Enter URL: https://learn.microsoft.com/api/mcp5. Click Connect |
Claude Desktop Remote MCP Guide |
| Claude Code | View Instructions1. Open a CLI2. Type claude mcp add --transport http microsoft_docs_mcp https://learn.microsoft.com/api/mcp and press enter3. (optional) Type --scope user directly after claude mcp add to make this MCP server available in Claude Code for all of your projects |
Claude Code Remote MCP Guide |
| Visual Studio | Manual configuration requiredUse "type": "http" |
Visual Studio MCP Official Guide |
| Cursor IDE | Cursor MCP Official Guide | |
| Roo Code | Manual configuration requiredUse "type": "streamable-http" |
Roo Code MCP Official Guide |
| Cline | Manual configuration requiredUse "type": "streamableHttp" |
Cline MCP Official Guide |
| Gemini CLI | Manual 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 Code | Manual 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 |
| GitHub | Manual configuration required View ConfigNote: Navigate to Settings → Coding agent{ "mslearn": { "command": "npx", "args": [ "-y", "mcp-remote", "https://learn.microsoft.com/api/mcp" ], "tools":["*"] }} |
For clients that don't support native remote MCP servers or if you prefer local configuration, you can use mcp-remote as a proxy:
| Client | Manual Configuration | MCP Guide |
|---|---|---|
| Claude Desktop (legacy config) | View ConfigNote: Only use this if Settings → Integrations doesn't work{ "microsoft.docs.mcp": { "command": "npx", "args": [ "-y", "mcp-remote", "https://learn.microsoft.com/api/mcp" ] }}Add to claude_desktop_config.json |
Claude Desktop MCP Guide |
| Windsurf | View Config{ "microsoft.docs.mcp": { "command": "npx", "args": [ "-y", "mcp-remote", "https://learn.microsoft.com/api/mcp" ] }} | Windsurf MCP Guide |
| Kiro | View Config{ "microsoft.docs.mcp": { "command": "npx", "args": [ "-y", "mcp-remote", "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:
- 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.
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.docs.mcp more frequently:
## Querying Microsoft Documentation
You have access to MCP tools called `microsoft_docs_search` and `microsoft_docs_fetch` - these tools allow you to search through and fetch Microsoft's latest official documentation, 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 this tool for research purposes when dealing with specific / narrowly defined questions that may occur.
| 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. |
The Microsoft Learn MCP Server team is working on several enhancements:
Please log in to share your review and rating for this MCP.
{
"mcpServers": {
"microsoft-docs-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://learn.microsoft.com/api/mcp"
],
"env": {}
}
}
}claude mcp add microsoft-docs-mcp npx -y mcp-remote https://learn.microsoft.com/api/mcpExplore related MCPs that share similar capabilities and solve comparable challenges
by exa-labs
Provides real-time web search capabilities to AI assistants via a Model Context Protocol server, enabling safe and controlled access to the Exa AI Search API.
by perplexityai
Enables Claude and other MCP‑compatible applications to perform real‑time web searches through the Perplexity (Sonar) API without leaving the MCP ecosystem.
by elastic
Enables natural‑language interaction with Elasticsearch indices via the Model Context Protocol, exposing tools for listing indices, fetching mappings, performing searches, running ES|QL queries, and retrieving shard information.
by graphlit
Enables integration between MCP clients and the Graphlit platform, providing ingestion, extraction, retrieval, and RAG capabilities across a wide range of data sources and connectors.
by mamertofabian
Fast cross‑platform file searching leveraging the Everything SDK on Windows, Spotlight on macOS, and locate/plocate on Linux.
by cr7258
Provides Elasticsearch and OpenSearch interaction via Model Context Protocol, enabling document search, index management, cluster monitoring, and alias operations.
by kagisearch
Provides web search and video summarization capabilities through the Model Context Protocol, enabling AI assistants like Claude to perform queries and summarizations.
by liuyoshio
Provides natural‑language search and recommendation for Model Context Protocol servers, delivering rich metadata and real‑time updates.
by ihor-sokoliuk
Provides web search capabilities via the SearXNG API, exposing them through an MCP server for seamless integration with AI agents and tools.