Skip to main content
Glama

MemOS-MCP

by qinshu1109
Apache 2.0
3
  • Linux
  • Apple
README.md4.67 kB
# MemOS VS Code Extension VS Code extension for MemOS memory management system. This extension allows you to search and manage your code memories directly from VS Code. ## Features - **Memory Search**: Search through your code memories using Ctrl+Shift+M - **Code Snippet Collection**: Add selected code snippets to memory with right-click context menu - **Hover Information**: Get memory information when hovering over code elements - **Memory Panel**: Dedicated panel in the Explorer view for memory management - **Real-time Search**: Search memories as you type in the dedicated panel ## Prerequisites 1. **MemOS API Server**: The extension requires the MemOS API server running on `localhost:7788` 2. **Node.js**: Required for building the extension 3. **VS Code**: Version 1.74.0 or higher ## Installation & Setup ### 1. Start the MemOS API Server First, start the MemOS API server that the extension will communicate with: ```bash cd /path/to/MemOS python3 vscode_api_server.py ``` The server will start on `http://localhost:7788` and provide the following endpoints: - `GET /mem/search?q=query` - Simple search - `POST /mem/search` - Advanced search with JSON payload - `POST /mem/add` - Add new memory - `GET /health` - Health check - `GET /docs` - API documentation ### 2. Install Extension Dependencies Navigate to the extension directory and install dependencies: ```bash cd vscode-extension npm install ``` ### 3. Compile TypeScript Compile the TypeScript source code: ```bash npm run compile ``` ### 4. Install Extension in VS Code 1. Open VS Code 2. Open the `vscode-extension` folder in VS Code 3. Press `F5` to launch a new Extension Development Host window 4. The extension will be automatically loaded in the new window ## Usage ### Search Memories - **Keyboard Shortcut**: Press `Ctrl+Shift+M` (or `Cmd+Shift+M` on Mac) - **Command Palette**: Open Command Palette (`Ctrl+Shift+P`) and search for "MemOS: Search Memory" - **Memory Panel**: Use the MemOS panel in the Explorer view ### Add Code Snippets 1. Select code in the editor 2. Right-click and choose "Add Code Snippet to Memory" 3. The selected code will be added to the `code_snippet_mem` memory type ### Hover Information - Hover over code elements to see related error information from your memory - The extension will automatically search for error-related memories ### Memory Panel - Open the MemOS panel from the Explorer view - Type search queries directly in the panel - View search results in real-time ## API Endpoints The extension communicates with the following API endpoints: ### Search Memories ```http POST /mem/search Content-Type: application/json { "query": "search term", "memory_type": "code_snippet_mem", "limit": 5 } ``` ### Add Memory ```http POST /mem/add Content-Type: application/json { "text": "code content", "memory_type": "code_snippet_mem", "tags": ["tag1", "tag2"], "metadata": {} } ``` ## Configuration The extension uses the following default configuration: - **API Base URL**: `http://localhost:7788` - **Default Memory Type**: `code_snippet_mem` - **Search Limit**: 5-10 results - **Timeout**: 2-10 seconds depending on operation ## Commands | Command | Description | Keybinding | |---------|-------------|------------| | `memos.searchMemory` | Search memories | `Ctrl+Shift+M` | | `memos.addCodeSnippet` | Add selected code to memory | - | | `memos.showMemoryPanel` | Show memory panel | - | ## Development ### Building ```bash npm run compile ``` ### Watching for Changes ```bash npm run watch ``` ### Testing Run the test script to verify functionality: ```bash cd .. python3 test_vscode_extension.py ``` ## Troubleshooting ### Extension Not Working 1. **Check API Server**: Ensure the MemOS API server is running on `localhost:7788` 2. **Check Health**: Visit `http://localhost:7788/health` in your browser 3. **Check Console**: Open VS Code Developer Tools (`Help > Toggle Developer Tools`) and check for errors ### Search Not Returning Results 1. **Add Test Data**: Use the API to add some test memories first 2. **Check Memory Types**: Ensure you're searching in the correct memory type 3. **Check API Response**: Test the API directly using curl or a REST client ### Compilation Errors 1. **Install Dependencies**: Run `npm install` in the extension directory 2. **Check TypeScript**: Ensure TypeScript is properly installed 3. **Check VS Code Version**: Ensure you're using VS Code 1.74.0 or higher ## API Documentation Visit `http://localhost:7788/docs` when the API server is running to see the complete API documentation. ## License This extension is part of the MemOS project.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qinshu1109/memos-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server