Skip to content

Conversation

@slimslenderslacks
Copy link
Collaborator

@slimslenderslacks slimslenderslacks commented Nov 21, 2025

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.

@slimslenderslacks slimslenderslacks force-pushed the slim/embeddings branch 3 times, most recently from 024ab72 to 71105ed Compare November 22, 2025 06:39
tarReader := tar.NewReader(rc)

for {
header, err := tarReader.Next()

Check failure

Code scanning / CodeQL

Arbitrary file access during archive extraction ("Zip Slip") High

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

Unresolved path from an archive header, which may point outside the archive root, is used in
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

Unresolved path from an archive header, which may point outside the archive root, is used in
symlink creation
.
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.

2 participants