Repository navigation
feat. implement simple mcp - #405
Conversation
4a405e4 to
ebc7fba
Compare
457b6c3 to
418503e
Compare
418503e to
cf8f508
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a simplified MCP (Model Content Protocol) server for MemMachine, replacing complex MCP tools with two streamlined methods: add_memory and search_memory. The new implementation focuses on better LLM integration with clearer descriptions and minimal parameter sets.
- Simplified MCP interface with two core tools optimized for LLM interaction
- Added two new command-line entry points for standalone MCP operation
- Implemented user ID context management with environment variable override support
- Restructured application lifespan management to support both standalone MCP and integrated HTTP modes
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/memmachine/server/test_mcp_stdio.py | Comprehensive test suite for the new MCP implementation with parameter validation and tool functionality tests |
| src/memmachine/server/mcp_stdio.py | New standalone MCP server in stdio mode for direct protocol communication |
| src/memmachine/server/mcp_http.py | New standalone MCP server in HTTP mode with command-line argument parsing |
| src/memmachine/server/app.py | Major refactoring of MCP tools, user context management, and application structure |
| src/memmachine/common/embedder/embedder_builder.py | Minor error message improvement for sentence-transformer configuration |
| pyproject.toml | Added new command-line entry points for MCP servers |
| docs/examples/mcp.mdx | Updated documentation with new MCP usage examples and Claude Desktop integration guide |
Comments suppressed due to low confidence (1)
src/memmachine/server/app.py:1
- The
deprecated=Trueparameter was removed from thesessionfield definition, but there's no indication in the PR description or commit that this deprecation warning should be removed. This could affect users who rely on this warning to migrate away from the deprecated field.
"""FastAPI application for the MemMachine memory system.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cf8f508 to
8d88e96
Compare
o-love
left a comment
There was a problem hiding this comment.
Looks good.
A few nits and a suggestion.
2e4cf93 to
863d46e
Compare
Implements a simplified MCP (Model Content Protocol) server for MemMachine, replacing complex MCP tools with two streamlined methods: `add_memory` and `search_memory`. The new implementation focuses on better LLM integration with clearer descriptions and minimal parameter sets. - Simplify MCP interface with two core tools optimized for LLM interaction - Add two new command-line entry points for standalone MCP operation - Implement user ID context management with environment variable override support - Restructure application lifespan management to support both standalone MCP and integrated HTTP modes
863d46e to
b9d092f
Compare
SarahScargall
left a comment
There was a problem hiding this comment.
LGTM - Content is solid. I may edit it so the responses and code are in the same window at a future time, but this is very good for now.
Purpose of the change
Implement a simpler MCP.
Description
Replaces the complex MCP implementation with a simpler version.
The new MCP contains only two methods:
user_id: the user to whom the memory belongs. It can be overriddenby the
MM_USER_IDenvironment variable or theuser-idfield inthe HTTP request header.
content: the content to memorize.user_id: the user from whom to retrieve memory.limit: maximum number of memories to retrieve.query: the related topic to query.Each method maintains a minimal set of parameters, and the descriptions
are tuned to help the LLM better understand the tools.
Adds two tools to start the MCP:
memmachine-mcp-stdio: starts the MCP server in stdio mode.memmachine-mcp-http: starts the MCP as an HTTP server without RESTAPI.
Changes in the main server:
memmachine-serverretains the old behavior—it starts the REST APIserver with MCP available at
/mcp.Type of change
How Has This Been Tested?
Unittest is added for the server layer. Integration test done with the Claude App.
Test Results:
Checklist
Maintainer Checklist