Add main docs MCP search#269
Conversation
- Added new tool - Updated documentation
🦋 Changeset detectedLatest commit: 1f74a9d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 71 73 +2
Lines 827 855 +28
Branches 135 139 +4
=========================================
+ Hits 827 855 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Adds a new “search_docs” tool that lets the server query the main Sei documentation via HTTP, complete with type updates, server registration, unit tests, and updated docs.
- Implemented
createDocsSearchTool(main docs search) and registered it in startup - Added comprehensive Jest tests simulating successful responses, HTTP errors, parsing errors, and non-Error exceptions
- Renamed types, updated MDX docs to list the new tool, and bumped tool counts
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/mcp-server/src/tests/core/tools.test.ts | Imported createDocsSearchTool, mocked fetch, and added tests for search_docs |
| packages/mcp-server/src/tests/core/services/balance.test.ts | Added a test verifying isNFTOwner returns false on non-Error throws |
| packages/mcp-server/src/server/server.ts | Registered createDocsSearchTool alongside existing tools |
| packages/mcp-server/src/mintlify/types.ts | Renamed interface SeiJSSearchResult → SeiSearchResponse |
| packages/mcp-server/src/mintlify/search.ts | Updated imports and return types in searchSeiJSDocs to use SeiSearchResponse |
| packages/mcp-server/src/docs/server.ts | New HTTP-based search_docs tool with error handling |
| packages/mcp-server/src/docs/index.ts | Exported createDocsSearchTool |
| docs/mcp-server/tools.mdx | Increased tool count to 29 and added search_docs entry |
| docs/mcp-server/introduction.mdx | Updated introduction to include documentation search capabilities |
| docs/mcp-server/context.mdx | Added separate sections for main docs and @sei-js package docs |
| .changeset/sixty-regions-tickle.md | Documented the addition of the main docs search tool |
|
|
||
| <Accordion title="Comprehensive Toolkit" icon="toolbox"> | ||
| Access 16+ blockchain tools covering token management, NFT operations, smart contract interactions, and network monitoring. | ||
| Access 29 blockchain tools covering token management, NFT operations, smart contract interactions, network monitoring, and documentation search. |
There was a problem hiding this comment.
I would now make this 20+ until you add one more
| ); | ||
| }; | ||
|
|
||
| const searchDocs = async (query: string): Promise<SeiSearchResponse[]> => { |
There was a problem hiding this comment.
this isn't necessarily a search - would call this fetchDocs or something else
| server.tool( | ||
| 'search_sei_js_docs', | ||
| 'Search all @sei-js libraries documentation for blockchain development, EVM/Ethereum integration, global wallet connections, React next.js and vite boilerplates, ledger integration, and the Sei chain registry', | ||
| 'Search all @sei-js libraries documentation for blockchain development, EVM/Ethereum integration, global wallet connections, React Next.js and Vite boilerplates, ledger integration, and the Sei chain registry. Useful for NodeJS based integrations with Sei.', |
| // Register documentation search tool | ||
| // Register documentation search tools | ||
| await createDocsSearchTool(server); | ||
| await createSeiJSDocsSearchTool(server); |
There was a problem hiding this comment.
Now, whats the diff between Docs and SeiJSDocs ?
There was a problem hiding this comment.
Docs come from a different source since the main docs don't use mintlify
| test('should return false if there is a non-Error object thrown', async () => { | ||
| // Import mocked modules | ||
| const { readContract } = await import('../../../core/services/contracts.js'); | ||
| const { utils } = await import('../../../core/services/utils.js'); |
There was a problem hiding this comment.
nit: can we do anything about the relative imports?
Uh oh!
There was an error while loading. Please reload this page.