-
Notifications
You must be signed in to change notification settings - Fork 49
Docker tool to start/stop Sei chains #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…g docker - Added environment variable requirement to turn it on
🦋 Changeset detectedLatest commit: de49cce 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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #292 +/- ##
===========================================
- Coverage 79.29% 64.93% -14.36%
===========================================
Files 82 87 +5
Lines 1280 1583 +303
Branches 212 249 +37
===========================================
+ Hits 1015 1028 +13
- Misses 259 555 +296
+ Partials 6 0 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Docker-based tools to the MCP server that enable users to spin up and manage local Sei blockchain containers. The implementation provides comprehensive container lifecycle management for local development and testing.
- Docker integration with environment variable gating (
SEI_DOCKER_ENABLED) - Six new tools for complete container management (get releases, start, stop, restart, delete, list)
- GitHub API integration to fetch official Sei chain releases
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mcp-server/src/server/server.ts | Registers Docker tools with the MCP server |
| packages/mcp-server/src/docker/tools.ts | Main Docker tool implementations with container management |
| packages/mcp-server/src/docker/releases.ts | GitHub API integration for fetching Sei releases |
| packages/mcp-server/src/docker/initialize.ts | Container creation and initialization logic |
| packages/mcp-server/src/docker/index.ts | Module exports |
| packages/mcp-server/src/core/services/chain.ts | Additional chain service utilities |
| packages/mcp-server/package.json | Added dockerode dependency |
| package.json | Added optional dependencies |
| docs/mcp-server/troubleshooting.mdx | Docker troubleshooting documentation |
| docs/mcp-server/tools.mdx | Documentation for new Docker tools |
| docs/mcp-server/quickstart.mdx | Updated quickstart with Docker setup |
| docs/mcp-server/introduction.mdx | Updated feature descriptions |
| docs/mcp-server/environment-variables.mdx | Docker configuration documentation |
| packages/mcp-server/.env.example | Added Docker environment variable |
| .changeset/cold-sites-hear.md | Changeset for the feature |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/mcp-server/src/docker/tools.ts:1
- This shell script embedded in the container command is very long and complex. Consider extracting it to a separate shell script file or breaking it into smaller, more maintainable functions. This would improve readability and make debugging easier.
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const seiContainers = containers.filter(container => | ||
| container.Names.some(name => name.includes('sei-chain')) || | ||
| container.Image.includes('sei-protocol/sei') || | ||
| container.Image.includes('ghcr.io/sei-protocol/sei') | ||
| ); |
Copilot
AI
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The container filtering logic is duplicated across multiple tools (lines 152-156, 278-283, 450-454, 584-589). Consider extracting this into a reusable helper function to reduce code duplication and ensure consistent filtering behavior.
| Cmd: [ | ||
| 'seid', 'start', | ||
| '--chain-id', chainId, | ||
| '--moniker', moniker, | ||
| '--rpc.laddr', 'tcp://0.0.0.0:26657', | ||
| '--api.enable', 'true', | ||
| '--api.address', 'tcp://0.0.0.0:1317', | ||
| '--grpc.address', '0.0.0.0:9090', | ||
| '--evm-rpc.address', '0.0.0.0:8545' | ||
| ], |
Copilot
AI
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file appears to duplicate functionality already implemented in the docker/tools.ts file but with different container initialization logic. Consider consolidating these implementations or clearly documenting the different use cases to avoid confusion.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
besated
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of this? is this for users to spin up a local node when vibe coding?
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@sei-js/mcp-server": minor | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this have to be minor or is patch fine? doesn't seem like it breaks existing integrations?
Add docker tool
This tool gives the MCP server the ability to spin up its own chain from the official releases when an environment variable is configured properly.