From 8f71ec38cb6a1e1064ae72a80e709829d4e7a107 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 29 Jul 2025 16:05:16 +0000 Subject: [PATCH 1/2] feat: add Microsoft Learn Docs Search MCP server to marketplace - Add marketplace item definition for Microsoft Learn Docs Search MCP server - Include comprehensive documentation for adding MCP servers to marketplace - Add test case to validate the MCP server format - Provide example YAML configuration for the server Resolves #6354 --- docs/MARKETPLACE_MCP_SERVERS.md | 148 ++++++++++++++++++ .../microsoft-learn-docs-mcp.yaml | 20 +++ .../__tests__/MarketplaceManager.spec.ts | 31 ++++ 3 files changed, 199 insertions(+) create mode 100644 docs/MARKETPLACE_MCP_SERVERS.md create mode 100644 marketplace-examples/microsoft-learn-docs-mcp.yaml diff --git a/docs/MARKETPLACE_MCP_SERVERS.md b/docs/MARKETPLACE_MCP_SERVERS.md new file mode 100644 index 0000000000..acd4661249 --- /dev/null +++ b/docs/MARKETPLACE_MCP_SERVERS.md @@ -0,0 +1,148 @@ +# Adding MCP Servers to the Roo Code Marketplace + +This document explains how to add new MCP (Model Context Protocol) servers to the Roo Code marketplace. + +## Overview + +The Roo Code marketplace allows users to discover and install MCP servers that extend the capabilities of the AI assistant. MCP servers provide additional tools and resources that can be used during conversations. + +## MCP Server Marketplace Item Format + +MCP servers in the marketplace follow a specific schema defined in `packages/types/src/marketplace.ts`. Here's the structure: + +### Required Fields + +- `id`: Unique identifier for the MCP server (kebab-case) +- `name`: Human-readable name +- `description`: Detailed description of what the server does +- `type`: Must be `"mcp"` +- `url`: GitHub repository URL or official documentation URL +- `content`: JSON string containing the MCP server configuration + +### Optional Fields + +- `author`: Author name +- `authorUrl`: Author's website or GitHub profile +- `tags`: Array of relevant tags for discovery +- `prerequisites`: Array of requirements (e.g., API keys, software) + +## Example: Microsoft Learn Docs Search MCP Server + +Here's a complete example of how to define the Microsoft Learn Docs Search MCP server: + +```yaml +items: + - id: "microsoft-learn-docs-search" + name: "Microsoft Learn Docs Search" + description: "Official Microsoft documentation search and retrieval server. Access trusted, up-to-date information from Microsoft Learn, Azure docs, Microsoft 365 docs, and other official Microsoft sources using semantic search." + author: "Microsoft" + authorUrl: "https://github.com/MicrosoftDocs" + url: "https://github.com/MicrosoftDocs/mcp" + tags: ["microsoft", "documentation", "search", "azure", "dotnet", "official"] + prerequisites: [] + content: | + { + "microsoft-learn-docs": { + "type": "streamable-http", + "url": "https://learn.microsoft.com/api/mcp" + } + } +``` + +## MCP Server Configuration Types + +The `content` field contains the actual MCP server configuration that will be added to the user's `.roo/mcp.json` file. Different types of MCP servers use different configuration formats: + +### Remote HTTP MCP Servers + +For cloud-hosted MCP servers that use HTTP: + +```json +{ + "server-name": { + "type": "streamable-http", + "url": "https://example.com/api/mcp" + } +} +``` + +### Local MCP Servers + +For locally installed MCP servers: + +```json +{ + "server-name": { + "command": "node", + "args": ["path/to/server.js"] + } +} +``` + +### NPM Package MCP Servers + +For MCP servers distributed as npm packages: + +```json +{ + "server-name": { + "command": "npx", + "args": ["-y", "package-name"] + } +} +``` + +## Key Features of the Microsoft Learn Docs MCP Server + +The Microsoft Learn Docs Search MCP server provides: + +- **Semantic Search**: Advanced vector search through Microsoft's official documentation +- **Comprehensive Coverage**: Access to Microsoft Learn, Azure docs, Microsoft 365 docs, and more +- **Real-time Updates**: Always up-to-date with the latest Microsoft documentation +- **High-Quality Results**: Returns up to 10 relevant content chunks with article titles and URLs +- **Official Source**: Maintained by Microsoft for accuracy and reliability + +### Available Tools + +- `microsoft_docs_search`: Performs semantic search against Microsoft official technical documentation + +### Example Usage + +Once installed, users can ask questions like: + +- "Give me the Azure CLI commands to create an Azure Container App with a managed identity. Search Microsoft docs" +- "Are you sure this is the right way to implement IHttpClientFactory in a .NET 8 minimal API? Search Microsoft docs" +- "Is gpt-4.1-mini available in EU regions? Search Microsoft docs" + +## Testing Your MCP Server Definition + +Before submitting a marketplace item, ensure it follows the correct format by: + +1. Validating against the TypeScript schema in `packages/types/src/marketplace.ts` +2. Adding a test case in `src/services/marketplace/__tests__/MarketplaceManager.spec.ts` +3. Running the marketplace tests: `cd src && npx vitest run services/marketplace/__tests__/MarketplaceManager.spec.ts` + +## Submission Process + +Since the marketplace data is served from an external API, new MCP servers need to be added through the appropriate channels: + +1. Create a properly formatted marketplace item definition +2. Test the format using the existing test infrastructure +3. Submit through the official Roo Code contribution process +4. The marketplace team will review and add approved servers to the external API + +## Best Practices + +1. **Clear Descriptions**: Provide detailed descriptions of what the MCP server does +2. **Relevant Tags**: Use appropriate tags for discoverability +3. **Prerequisites**: List any requirements (API keys, software dependencies) +4. **Official Sources**: Prefer official or well-maintained MCP servers +5. **Testing**: Thoroughly test the MCP server configuration before submission +6. **Documentation**: Include links to official documentation or setup guides + +## Related Files + +- `packages/types/src/marketplace.ts` - TypeScript schema definitions +- `src/services/marketplace/` - Marketplace service implementation +- `webview-ui/src/components/marketplace/` - UI components for marketplace +- `src/services/marketplace/__tests__/` - Test files for validation diff --git a/marketplace-examples/microsoft-learn-docs-mcp.yaml b/marketplace-examples/microsoft-learn-docs-mcp.yaml new file mode 100644 index 0000000000..41d9dd6758 --- /dev/null +++ b/marketplace-examples/microsoft-learn-docs-mcp.yaml @@ -0,0 +1,20 @@ +# Microsoft Learn Docs Search MCP Server +# Example marketplace item definition for the Microsoft Learn Docs Search MCP Server +# This demonstrates the proper format for adding MCP servers to the Roo Code marketplace + +items: + - id: "microsoft-learn-docs-search" + name: "Microsoft Learn Docs Search" + description: "Official Microsoft documentation search and retrieval server. Access trusted, up-to-date information from Microsoft Learn, Azure docs, Microsoft 365 docs, and other official Microsoft sources using semantic search." + author: "Microsoft" + authorUrl: "https://github.com/MicrosoftDocs" + url: "https://github.com/MicrosoftDocs/mcp" + tags: ["microsoft", "documentation", "search", "azure", "dotnet", "official"] + prerequisites: [] + content: | + { + "microsoft-learn-docs": { + "type": "streamable-http", + "url": "https://learn.microsoft.com/api/mcp" + } + } \ No newline at end of file diff --git a/src/services/marketplace/__tests__/MarketplaceManager.spec.ts b/src/services/marketplace/__tests__/MarketplaceManager.spec.ts index 8962f43c5f..236f7e7d8c 100644 --- a/src/services/marketplace/__tests__/MarketplaceManager.spec.ts +++ b/src/services/marketplace/__tests__/MarketplaceManager.spec.ts @@ -223,6 +223,37 @@ describe("MarketplaceManager", () => { expect(manager["installer"].installItem).toHaveBeenCalledWith(item, { target: "project" }) expect(result).toBe("/test/path/.roo/mcp.json") }) + + it("should install Microsoft Learn Docs MCP item", async () => { + const item: MarketplaceItem = { + id: "microsoft-learn-docs-search", + name: "Microsoft Learn Docs Search", + description: + "Official Microsoft documentation search and retrieval server. Access trusted, up-to-date information from Microsoft Learn, Azure docs, Microsoft 365 docs, and other official Microsoft sources using semantic search.", + type: "mcp", + author: "Microsoft", + authorUrl: "https://github.com/MicrosoftDocs", + url: "https://github.com/MicrosoftDocs/mcp", + tags: ["microsoft", "documentation", "search", "azure", "dotnet", "official"], + content: JSON.stringify({ + "microsoft-learn-docs": { + type: "streamable-http", + url: "https://learn.microsoft.com/api/mcp", + }, + }), + } + + // Mock the installer + vi.spyOn(manager["installer"], "installItem").mockResolvedValue({ + filePath: "/test/path/.roo/mcp.json", + line: 3, + }) + + const result = await manager.installMarketplaceItem(item) + + expect(manager["installer"].installItem).toHaveBeenCalledWith(item, { target: "project" }) + expect(result).toBe("/test/path/.roo/mcp.json") + }) }) describe("removeInstalledMarketplaceItem", () => { From 6bad7846d76c1d443330287d084d9de938df4e43 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 30 Jul 2025 02:28:35 +0000 Subject: [PATCH 2/2] feat: rename Microsoft Learn MCP server name - Update marketplace example from "Microsoft Learn Docs Search" to "Microsoft Learn MCP" - Update documentation to reflect the new name - Update test case to use the new name - All tests passing Addresses user request in issue #6354 to rename the MCP server name --- docs/MARKETPLACE_MCP_SERVERS.md | 10 +++++----- marketplace-examples/microsoft-learn-docs-mcp.yaml | 6 +++--- .../marketplace/__tests__/MarketplaceManager.spec.ts | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/MARKETPLACE_MCP_SERVERS.md b/docs/MARKETPLACE_MCP_SERVERS.md index acd4661249..9250562e28 100644 --- a/docs/MARKETPLACE_MCP_SERVERS.md +++ b/docs/MARKETPLACE_MCP_SERVERS.md @@ -26,14 +26,14 @@ MCP servers in the marketplace follow a specific schema defined in `packages/typ - `tags`: Array of relevant tags for discovery - `prerequisites`: Array of requirements (e.g., API keys, software) -## Example: Microsoft Learn Docs Search MCP Server +## Example: Microsoft Learn MCP Server -Here's a complete example of how to define the Microsoft Learn Docs Search MCP server: +Here's a complete example of how to define the Microsoft Learn MCP server: ```yaml items: - id: "microsoft-learn-docs-search" - name: "Microsoft Learn Docs Search" + name: "Microsoft Learn MCP" description: "Official Microsoft documentation search and retrieval server. Access trusted, up-to-date information from Microsoft Learn, Azure docs, Microsoft 365 docs, and other official Microsoft sources using semantic search." author: "Microsoft" authorUrl: "https://github.com/MicrosoftDocs" @@ -92,9 +92,9 @@ For MCP servers distributed as npm packages: } ``` -## Key Features of the Microsoft Learn Docs MCP Server +## Key Features of the Microsoft Learn MCP Server -The Microsoft Learn Docs Search MCP server provides: +The Microsoft Learn MCP server provides: - **Semantic Search**: Advanced vector search through Microsoft's official documentation - **Comprehensive Coverage**: Access to Microsoft Learn, Azure docs, Microsoft 365 docs, and more diff --git a/marketplace-examples/microsoft-learn-docs-mcp.yaml b/marketplace-examples/microsoft-learn-docs-mcp.yaml index 41d9dd6758..4236544be4 100644 --- a/marketplace-examples/microsoft-learn-docs-mcp.yaml +++ b/marketplace-examples/microsoft-learn-docs-mcp.yaml @@ -1,10 +1,10 @@ -# Microsoft Learn Docs Search MCP Server -# Example marketplace item definition for the Microsoft Learn Docs Search MCP Server +# Microsoft Learn MCP Server +# Example marketplace item definition for the Microsoft Learn MCP Server # This demonstrates the proper format for adding MCP servers to the Roo Code marketplace items: - id: "microsoft-learn-docs-search" - name: "Microsoft Learn Docs Search" + name: "Microsoft Learn MCP" description: "Official Microsoft documentation search and retrieval server. Access trusted, up-to-date information from Microsoft Learn, Azure docs, Microsoft 365 docs, and other official Microsoft sources using semantic search." author: "Microsoft" authorUrl: "https://github.com/MicrosoftDocs" diff --git a/src/services/marketplace/__tests__/MarketplaceManager.spec.ts b/src/services/marketplace/__tests__/MarketplaceManager.spec.ts index 236f7e7d8c..efdacf9131 100644 --- a/src/services/marketplace/__tests__/MarketplaceManager.spec.ts +++ b/src/services/marketplace/__tests__/MarketplaceManager.spec.ts @@ -224,10 +224,10 @@ describe("MarketplaceManager", () => { expect(result).toBe("/test/path/.roo/mcp.json") }) - it("should install Microsoft Learn Docs MCP item", async () => { + it("should install Microsoft Learn MCP item", async () => { const item: MarketplaceItem = { id: "microsoft-learn-docs-search", - name: "Microsoft Learn Docs Search", + name: "Microsoft Learn MCP", description: "Official Microsoft documentation search and retrieval server. Access trusted, up-to-date information from Microsoft Learn, Azure docs, Microsoft 365 docs, and other official Microsoft sources using semantic search.", type: "mcp",