Draft
Conversation
Implements an MCP server behind the `experimental-mcp` feature flag, exposing Meilisearch functionality through the JSON-RPC 2.0 protocol at /mcp endpoint. Features: - MCP protocol implementation (initialize, tools/list, tools/call) - Session management with Mcp-Session-Id header - Three tools: meilisearch_list_indexes, meilisearch_get_index_info, meilisearch_search - Batch request support per JSON-RPC 2.0 spec - Comprehensive integration test suite (17 tests) The MCP server enables AI assistants (Claude, etc.) to discover available indexes and perform searches against a Meilisearch instance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove dead code from protocol.rs (unused McpMethod enum and ToolCallParams struct) - Fix protocol.rs docstring to reference HTTP transport instead of STDIO - Use consistent camelCase parameter naming for get_index_info tool (indexUid) - Update tests to use the new parameter name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add TTL-based session cleanup (1 hour expiry) - Add max sessions limit (10000) with forced cleanup - Track last_accessed timestamp on each session - Change verbose info!/debug! logging to trace! level - Keep tool execution logging at debug! level - Replace .unwrap() with .expect() for better panic messages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- tools.rs: Reduce redundant clones in get_index_info and search functions by moving ownership earlier - error.rs: Remove unused error variants (AttributeNotFilterable, AttributeNotSortable, EmbedderNotFound, SearchError) and their match arms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Migrate MCP from compile-time feature flags (#[cfg(feature = "experimental-mcp")])
to runtime toggle via RuntimeTogglableFeatures, consistent with other experimental
features like chat, network, and metrics.
Changes:
- Add `mcp: bool` to RuntimeTogglableFeatures struct
- Add `check_mcp()` method to RoFeatures for runtime gating
- Always register /mcp route, check feature at handler level
- Remove all #[cfg(feature = "experimental-mcp")] conditions
- Make strsim a regular dependency (was conditional)
- Update tests to enable MCP via experimental features API
- Add test for feature gate behavior when disabled
Users can now enable MCP via PATCH /experimental-features {"mcp": true}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive documentation for the experimental MCP server: - How to enable/disable the feature - Protocol overview (JSON-RPC 2.0 over HTTP) - Session management - Complete tool reference with parameters and examples - Integration examples for Claude Desktop and Python - Error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Integrate with Meilisearch's existing API key authentication system - Add action-based permission checks (search, indexes.get, settings.get) - Support index-scoped API key restrictions in MCP endpoints - Add comprehensive auth integration tests - Fix filterable_attributes format in get_index_info (proper JSON values) - Fix mcp_unknown_tool test to check JSON-RPC error correctly - Update documentation with auth details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Fixes #...
Requirements
--experimental-dumpless-upgradeon a DB created with the last released Meilisearchdb changelabel.