-
Notifications
You must be signed in to change notification settings - Fork 160
add find-tool embeddings #258
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
024ab72 to
71105ed
Compare
| tarReader := tar.NewReader(rc) | ||
|
|
||
| for { | ||
| header, err := tarReader.Next() |
Check failure
Code scanning / CodeQL
Arbitrary file access during archive extraction ("Zip Slip") High
file system operation
Unsanitized archive entry, which may contain '..', is used in a
file system operation
Unsanitized archive entry, which may contain '..', is used in a
file system operation
| return fmt.Errorf("failed to read tar header: %w", err) | ||
| } | ||
|
|
||
| target := filepath.Join(destDir, header.Name) |
Check failure
Code scanning / CodeQL
Arbitrary file write extracting an archive containing symbolic links High
symlink creation
|
|
||
| case tar.TypeSymlink: | ||
| // Handle symlinks | ||
| if err := os.Symlink(header.Linkname, target); err != nil { |
Check failure
Code scanning / CodeQL
Arbitrary file write extracting an archive containing symbolic links High
symlink creation
71105ed to
7d62beb
Compare
7d62beb to
5097bc0
Compare
This PR introduces several improvements to the embeddings feature and adds new profile management capabilities to the MCP Gateway.
Embeddings Infrastructure Improvements
Container Lifecycle Management: Fixed a critical resource leak where Docker containers spawned by the embeddings client were not being
properly cleaned up on shutdown. The VectorDBClient.Close() method now uses docker stop to gracefully terminate containers and properly
reaps processes, preventing orphaned containers from accumulating. Added comprehensive tests to verify container cleanup behavior.
Configurable Vector Dimensions: Added a dimension parameter to NewVectorDBClient() with a default value of 1536, allowing future
flexibility for different embedding models. Updated all callers and added test coverage for various dimension values including edge
cases.
Conditional Tool Registration: The find-tools dynamic tool (AI-powered tool recommendation) is now only registered when the embeddings
client is successfully configured, preventing confusing errors when embeddings support is unavailable.
Configuration Validation Enhancement
Refactored the mcp-config-set tool to accept and validate complete configuration objects instead of individual key-value pairs. The
tool now validates the entire config object against the server's JSON schema and returns detailed validation errors with the full
schema when validation fails, enabling agents to self-correct configuration mistakes.
Profile Management
Added a new mcp-create-profile dynamic tool that captures the current gateway state (all enabled servers, their configurations, and
tool selections) into a reusable profile. Profiles can be created or updated, providing a snapshot mechanism for quickly restoring or
sharing gateway configurations. The implementation integrates with the existing working set/profile database infrastructure and
includes full validation.