-
Notifications
You must be signed in to change notification settings - Fork 66
feat: Add Support for vet MCP Server #502
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
Conversation
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 support for a new MCP server used to vet packages, including new tools for package registry, malware analysis, and package insights, as well as integration tests and updated documentation.
- Introduces new MCP server commands with both stdio and SSE transports.
- Implements new MCP tools (package registry, malware, insights) with corresponding driver methods.
- Updates dependencies, adds documentation, and improves end-to-end testing.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/utils.go | Added a helper function to enable E2E testing. |
pkg/common/logger/logger.go | Updated log level retrieval logic with fallback to a new environment variable. |
mcp/tools/*.go | Added new MCP tools for package registry, malware scanning, and insights. |
mcp/server/*.go | Created server implementations for stdio and SSE transports. |
mcp/driver.go | Integrated new driver methods to support package operations. |
main.go | Added logic to conditionally register the server command. |
internal/auth/grpc.go | Added a new function for creating InsightsV2 gRPC client connections. |
go.mod | Updated several dependency versions. |
docs/mcp.md | Added documentation covering MCP server usage. |
cmd/server/* | Introduced new server command and related tests for the MCP server functionality. |
Comments suppressed due to low confidence (1)
mcp/tools/common.go:9
- [nitpick] The variable name 'json' shadows the package name 'json'. Consider renaming it (e.g., 'jsonData') to avoid potential confusion.
json, err := json.Marshal(msg)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #502 +/- ##
==========================================
+ Coverage 16.40% 17.31% +0.91%
==========================================
Files 162 175 +13
Lines 16294 16790 +496
==========================================
+ Hits 2673 2908 +235
- Misses 13417 13659 +242
- Partials 204 223 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vet Summary ReportThis report is generated by vet Policy Checks
Malicious Package AnalysisMalicious package analysis was performed using SafeDep Cloud API Malicious Package Analysis Report
Changed PackagesChanged Packages
Policy ViolationsPackages Violating Policy[Go]
|
@KunalSin9h @OmkarPh Please do a review |
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 support for running vet
as a Model Context Protocol (MCP) server, including new server transports, tools, commands, tests, docs, and dependency bumps.
- Add MCP server components (
stdio
/sse
transports, config, commands) - Implement package registry, malware scanning, and insights tools via
mcp-go
- Update tests, utilities, documentation, and bump related dependencies
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
test/utils.go | Wrapper function EnsureEndToEndTestIsEnabled for E2E tests |
pkg/common/logger/logger.go | Fallback to VET_LOG_LEVEL env var in getLogLevelFromEnv |
mcp/tools/tools.go | Added RegisterAll helper for bulk tool registration |
mcp/tools/package_registry.go | Implemented package registry MCP tool |
mcp/tools/package_malware.go | Implemented package malware scanning MCP tool |
mcp/tools/package_insights.go | Implemented package insights MCP tool (vulns , popularity , license ) |
mcp/tools/common.go | Added serializeForLlm JSON helper |
mcp/tool.go | Defined McpTool interface |
mcp/server/stdio.go | Added stdio transport server constructor |
mcp/server/sse.go | Added SSE transport server constructor |
mcp/server/server.go | Added MCP server interface, config, and wiring |
mcp/driver.go | Extended default driver to support MCP operations |
main.go | Imported and enabled server command |
internal/auth/grpc.go | Added InsightsV2CommunityClientConnection |
go.mod | Updated dependencies for MCP features and others |
docs/mcp.md | New documentation for MCP server usage |
cmd/server/mcp_test.go | Added E2E tests for MCP driver |
cmd/server/mcp.go | New mcp server cobra command with flags |
cmd/server/main.go | Added server command grouping |
README.md | Updated README with MCP server section |
Comments suppressed due to low confidence (3)
test/utils.go:16
- [nitpick] The function name EnsureEndToEndTestIsEnabled is verbose and may mislead about its behavior; consider renaming to SkipIfE2EDisabled for clarity.
func EnsureEndToEndTestIsEnabled(t *testing.T) {
cmd/server/mcp.go:20
- [nitpick] Consider renaming mcpServerServerType to mcpServerType to avoid redundant 'Server' and improve readability.
mcpServerServerType string
mcp/tools/tools.go:8
- The RegisterAll function is not invoked anywhere; consider removing it or integrating it into the server registration workflow to avoid dead code.
func RegisterAll(server server.McpServer, driver mcp.Driver) error {
No description provided.