Use ai-sdk/mcp package for new mint doc endpoint#1749
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Pull request overview
This PR migrates the documentation MCP (Model Context Protocol) server integration from a local stdio-based transport to an HTTP-based transport using the new @ai-sdk/mcp package. The change updates the connection method from executing a local Node.js process to making HTTP requests to a hosted MCP endpoint.
Key changes:
- Updated the docs MCP server configuration from a local file path to an HTTPS URL
- Migrated from stdio transport to HTTP transport using the
@ai-sdk/mcppackage - Improved tool discovery logic to handle both Map and Object return types from the MCP client
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/server/shared/src/lib/system/system.ts | Changed default DOCS_MCP_SERVER_PATH from local path to HTTPS URL |
| packages/server/api/src/app/ai/mcp/docs-tools.ts | Refactored to use HTTP transport with @ai-sdk/mcp package and improved tool discovery |
| package.json | Added @ai-sdk/mcp@0.0.11 dependency |
| THIRD_PARTY_LICENSES.txt | Added license information for new dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| transport: { | ||
| type: 'http', | ||
| url: mcpServerUrl, | ||
| } as Parameters<typeof createMCPClient>[0]['transport'], |
There was a problem hiding this comment.
The type assertion as Parameters<typeof createMCPClient>[0]['transport'] suggests a type mismatch. Consider defining a proper type for the HTTP transport configuration or verifying that the @ai-sdk/mcp package correctly types the HTTP transport option.
|
|
||
| const tools = await client.tools(); | ||
| const searchTool = tools['search']; | ||
| const toolsObject = tools instanceof Map ? Object.fromEntries(tools) : tools; |
There was a problem hiding this comment.
the changes here are needed because the new package could return it as a map, so we cast it to an object
| 'https://raw.githubusercontent.com/openops-cloud/openops/main/ai-prompts', | ||
| [AppSystemProp.SUPERSET_MCP_SERVER_PATH]: '/root/.mcp/superset', | ||
| [AppSystemProp.DOCS_MCP_SERVER_PATH]: '/root/.mcp/docs.openops.com', | ||
| [AppSystemProp.DOCS_MCP_SERVER_PATH]: 'https://docs.openops.com/mcp', |
There was a problem hiding this comment.
https://www.mintlify.com/docs/ai/model-context-protocol#about-mcp-servers
this is the new way of using it
|



Fixes OPS-2911