Skip to content

Expose semantic search via MCP (search_containers method) - #322

Merged
malibio merged 3 commits into
mainfrom
feature/issue-321-expose-semantic-search-via-mcp
Oct 21, 2025
Merged

malibio merged 3 commits into
mainfrom
feature/issue-321-expose-semantic-search-via-mcp

Conversation

@malibio

@malibio malibio commented Oct 21, 2025

Copy link
Copy Markdown
Collaborator

Closes #321

malibio and others added 3 commits October 21, 2025 12:59
- Add search_containers MCP handler for AI agent semantic search access
- Create combined McpServices struct for multi-service coordination
- Update MCP server to support embedding-based search operations
- Integrate NodeEmbeddingService with MCP protocol layer
- Add search_containers to MCP capabilities schema for client discovery
- Wire up embedding service from Tauri state to MCP server
- Implement parameter validation (threshold range, query non-empty)
- Provides 6 unit tests for search handler validation
- Enables AI agents to find relevant content using natural language

Supports parameters:
- query (required): Natural language search query
- threshold (default: 0.7): Similarity threshold 0.0-1.0
- limit (default: 20): Maximum results
- exact (default: false): Use exact cosine distance instead of DiskANN

This completes the AI agent workflow: search → read → understand → modify

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
Based on comprehensive pragmatic code review feedback:

**Security & Validation Improvements:**
- Fix whitespace-only query validation using .trim()
- Add upper bound validation for limit parameter (max 1000)
- Improve error handling granularity with specific error messages

**Code Quality:**
- Add authoritative defaults comment (schema vs code)
- Enhance JSON schema description with usage examples
- Fix clippy warnings (bool comparison, constant assertions)

**Testing:**
- Replace placeholder tests with 16 comprehensive validation tests
- Add parameter parsing, boundary, and response structure tests
- Test coverage: empty/whitespace queries, threshold validation,
  limit boundaries, defaults matching, parameter combinations

All tests pass, quality checks pass, no lint suppressions.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
Resolved conflicts by keeping both features:
- get_markdown_from_node_id (from main)
- search_containers (from feature branch)

Both methods now registered in MCP server with proper service routing.
@malibio
malibio merged commit 838b376 into main Oct 21, 2025
@malibio
malibio deleted the feature/issue-321-expose-semantic-search-via-mcp branch October 21, 2025 11:49
malibio added a commit that referenced this pull request Feb 4, 2026
* feat: Expose semantic search via MCP (search_containers method) (#321)

- Add search_containers MCP handler for AI agent semantic search access
- Create combined McpServices struct for multi-service coordination
- Update MCP server to support embedding-based search operations
- Integrate NodeEmbeddingService with MCP protocol layer
- Add search_containers to MCP capabilities schema for client discovery
- Wire up embedding service from Tauri state to MCP server
- Implement parameter validation (threshold range, query non-empty)
- Provides 6 unit tests for search handler validation
- Enables AI agents to find relevant content using natural language

Supports parameters:
- query (required): Natural language search query
- threshold (default: 0.7): Similarity threshold 0.0-1.0
- limit (default: 20): Maximum results
- exact (default: false): Use exact cosine distance instead of DiskANN

This completes the AI agent workflow: search → read → understand → modify

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

* refactor: Address code review feedback for search handler (#321)

Based on comprehensive pragmatic code review feedback:

**Security & Validation Improvements:**
- Fix whitespace-only query validation using .trim()
- Add upper bound validation for limit parameter (max 1000)
- Improve error handling granularity with specific error messages

**Code Quality:**
- Add authoritative defaults comment (schema vs code)
- Enhance JSON schema description with usage examples
- Fix clippy warnings (bool comparison, constant assertions)

**Testing:**
- Replace placeholder tests with 16 comprehensive validation tests
- Add parameter parsing, boundary, and response structure tests
- Test coverage: empty/whitespace queries, threshold validation,
  limit boundaries, defaults matching, parameter combinations

All tests pass, quality checks pass, no lint suppressions.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 5, 2026
* feat: Expose semantic search via MCP (search_containers method) (#321)

- Add search_containers MCP handler for AI agent semantic search access
- Create combined McpServices struct for multi-service coordination
- Update MCP server to support embedding-based search operations
- Integrate NodeEmbeddingService with MCP protocol layer
- Add search_containers to MCP capabilities schema for client discovery
- Wire up embedding service from Tauri state to MCP server
- Implement parameter validation (threshold range, query non-empty)
- Provides 6 unit tests for search handler validation
- Enables AI agents to find relevant content using natural language

Supports parameters:
- query (required): Natural language search query
- threshold (default: 0.7): Similarity threshold 0.0-1.0
- limit (default: 20): Maximum results
- exact (default: false): Use exact cosine distance instead of DiskANN

This completes the AI agent workflow: search → read → understand → modify

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

* refactor: Address code review feedback for search handler (#321)

Based on comprehensive pragmatic code review feedback:

**Security & Validation Improvements:**
- Fix whitespace-only query validation using .trim()
- Add upper bound validation for limit parameter (max 1000)
- Improve error handling granularity with specific error messages

**Code Quality:**
- Add authoritative defaults comment (schema vs code)
- Enhance JSON schema description with usage examples
- Fix clippy warnings (bool comparison, constant assertions)

**Testing:**
- Replace placeholder tests with 16 comprehensive validation tests
- Add parameter parsing, boundary, and response structure tests
- Test coverage: empty/whitespace queries, threshold validation,
  limit boundaries, defaults matching, parameter combinations

All tests pass, quality checks pass, no lint suppressions.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 26, 2026
* feat: Expose semantic search via MCP (search_containers method) (#321)

- Add search_containers MCP handler for AI agent semantic search access
- Create combined McpServices struct for multi-service coordination
- Update MCP server to support embedding-based search operations
- Integrate NodeEmbeddingService with MCP protocol layer
- Add search_containers to MCP capabilities schema for client discovery
- Wire up embedding service from Tauri state to MCP server
- Implement parameter validation (threshold range, query non-empty)
- Provides 6 unit tests for search handler validation
- Enables AI agents to find relevant content using natural language

Supports parameters:
- query (required): Natural language search query
- threshold (default: 0.7): Similarity threshold 0.0-1.0
- limit (default: 20): Maximum results
- exact (default: false): Use exact cosine distance instead of DiskANN

This completes the AI agent workflow: search → read → understand → modify

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

* refactor: Address code review feedback for search handler (#321)

Based on comprehensive pragmatic code review feedback:

**Security & Validation Improvements:**
- Fix whitespace-only query validation using .trim()
- Add upper bound validation for limit parameter (max 1000)
- Improve error handling granularity with specific error messages

**Code Quality:**
- Add authoritative defaults comment (schema vs code)
- Enhance JSON schema description with usage examples
- Fix clippy warnings (bool comparison, constant assertions)

**Testing:**
- Replace placeholder tests with 16 comprehensive validation tests
- Add parameter parsing, boundary, and response structure tests
- Test coverage: empty/whitespace queries, threshold validation,
  limit boundaries, defaults matching, parameter combinations

All tests pass, quality checks pass, no lint suppressions.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
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.

Expose semantic search via MCP (search_containers method)

1 participant