Skip to content

Add main docs MCP search#269

Merged
codebycarson merged 5 commits into
mainfrom
feature/main-docs-mcp
Jul 8, 2025
Merged

Add main docs MCP search#269
codebycarson merged 5 commits into
mainfrom
feature/main-docs-mcp

Conversation

@codebycarson

@codebycarson codebycarson commented Jul 8, 2025

Copy link
Copy Markdown
Collaborator
  • Added new tool to search the main sei docs for relevant context
  • Updated documentation

- Added new tool
- Updated documentation
@codebycarson
codebycarson requested a review from Copilot July 8, 2025 15:41
@changeset-bot

changeset-bot Bot commented Jul 8, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1f74a9d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sei-js/mcp-server Patch

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

This comment was marked as outdated.

@codecov-commenter

codecov-commenter commented Jul 8, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (29b8c15) to head (1f74a9d).
⚠️ Report is 37 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codebycarson
codebycarson requested review from besated and Copilot July 8, 2025 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SeiJSSearchResultSeiSearchResponse
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

Comment thread packages/mcp-server/src/tests/core/tools.test.ts

@kamwithak kamwithak left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done.


<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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would now make this 20+ until you add one more

);
};

const searchDocs = async (query: string): Promise<SeiSearchResponse[]> => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NodeJS-based

// Register documentation search tool
// Register documentation search tools
await createDocsSearchTool(server);
await createSeiJSDocsSearchTool(server);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, whats the diff between Docs and SeiJSDocs ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we do anything about the relative imports?

@codebycarson
codebycarson merged commit 96d3a73 into main Jul 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants