-
Notifications
You must be signed in to change notification settings - Fork 75
[LG-5924] feat(lg-mcp): Creates @lg-mcp/* packages #3479
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
…nents and usage examples
|
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 introduces two new packages under the @lg-mcp scope to support MCP (Model Context Protocol) integrations. The changes create reusable presentational components and hooks for iframe-based UI components that communicate with MCP clients.
Changes:
- Creates
@lg-mcp/embeddable-uispackage with aListDatabasescomponent for displaying MongoDB database information - Creates
@lg-mcp/hookspackage with three React hooks:useDarkMode,useRenderData, anduseHostCommunication - Adds new
@lg-mcpworkspace scope to the monorepo configuration
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds mcp/* to workspace packages list |
| package.json | Registers @lg-mcp scope mapping to mcp directory |
| mcp/hooks/tsconfig.json | TypeScript configuration for hooks package |
| mcp/hooks/src/useRenderData/* | Hook for receiving render data via postMessage from parent window |
| mcp/hooks/src/useHostCommunication/* | Hook for sending UI actions to parent window via postMessage |
| mcp/hooks/src/useDarkMode/* | Hook for detecting system dark mode preference |
| mcp/hooks/src/index.ts | Main export file for hooks package |
| mcp/hooks/package.json | Package configuration for hooks |
| mcp/hooks/README.md | Documentation for hooks package |
| mcp/embeddable-uis/tsconfig.json | TypeScript configuration for embeddable-uis package |
| mcp/embeddable-uis/src/index.ts | Main export file for embeddable-uis package |
| mcp/embeddable-uis/src/ListDatabases/* | ListDatabases component implementation, tests, types, styles, and stories |
| mcp/embeddable-uis/package.json | Package configuration for embeddable-uis |
| mcp/embeddable-uis/README.md | Documentation for embeddable-uis package |
| README.md | Adds new packages to table of contents |
| const intent: typeof uiActionResultIntent = useCallback((...args) => { | ||
| const result = uiActionResultIntent(...args); | ||
| postUIActionResult(result); | ||
| return result; | ||
| }, []); |
Copilot
AI
Jan 22, 2026
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.
All five callback functions in this hook follow identical patterns with no dependencies. Consider extracting a helper function to reduce duplication and improve maintainability.
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.
++
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 is actually somewhat intentional, for now. Each one uses a different posting function, and the rest of the logic is structural boilerplate and not complex business logic. I feel like abstracting this out would force us to need to use generics and just make the code less easy to follow. If there were more cases or the duplicate code was more complex, I'd more strongly agree. But in this case I actually think the way it is much more readable with little current downside.
adamrasheed
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.
Solid! Just a couple of comments and I think you need to run lint or pnpm fix on your branch
| const intent: typeof uiActionResultIntent = useCallback((...args) => { | ||
| const result = uiActionResultIntent(...args); | ||
| postUIActionResult(result); | ||
| return result; | ||
| }, []); |
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.
++
…ry changes and improve type safety in tests
|
Size Change: +32 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
…dable-uis', and '@lg-mcp/hooks' to ALL_PACKAGES
|
Coverage after merging LG-5924/mcp-ui into main will be
Coverage Report for Changed Files
|
✍️ Proposed changes
@lg-mcp/embeddable-uispackage and moves server component to it. This converts the component to be presentational so it can be used in or out of and MCP server response@lg-mcp/hooksand and moves server hooks to it.🎟 Jira ticket: LG-5924
✅ Checklist
For new components
🧪 How to test changes