From 04209ec24813c063775bb4e0e9e51bc265d3bf1c Mon Sep 17 00:00:00 2001 From: s2005 Date: Sat, 21 Dec 2024 18:38:12 +0100 Subject: [PATCH 1/7] feat(memory): add MEMORY_FILE_PATH environment variable support - Add environment variable MEMORY_FILE_PATH to configure custom storage location - Support both absolute and relative paths - Update documentation with configuration examples - Bump version to 0.6.3 --- src/memory/README.md | 23 +++++++++++++++++++++++ src/memory/index.ts | 14 +++++++++----- src/memory/package.json | 2 +- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/memory/README.md b/src/memory/README.md index e405a0d4..eead5faf 100644 --- a/src/memory/README.md +++ b/src/memory/README.md @@ -158,6 +158,29 @@ Add this to your claude_desktop_config.json: } ``` +#### NPX with custom setting + +The server can be configured using the following environment variables: + +```json +{ + "mcpServers": { + "memory": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-memory" + ], + "env": { + "MEMORY_FILE_PATH": "/path/to/custom/memory.json" + } + } + } +} +``` + +- `MEMORY_FILE_PATH`: Path to the memory storage JSON file (default: `memory.json` in the server directory) + ### System Prompt The prompt for utilizing memory depends on the use case. Changing the prompt will help the model determine the frequency and types of memories created. diff --git a/src/memory/index.ts b/src/memory/index.ts index 0117c920..14ef92ad 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -10,10 +10,15 @@ import { promises as fs } from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; +// Define memory file path using environment variable with fallback +const defaultMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.json'); -// Define the path to the JSONL file, you can change this to your desired local path -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const MEMORY_FILE_PATH = path.join(__dirname, 'memory.json'); +// If MEMORY_FILE_PATH is just a filename, put it in the same directory as the script +const MEMORY_FILE_PATH = process.env.MEMORY_FILE_PATH + ? path.isAbsolute(process.env.MEMORY_FILE_PATH) + ? process.env.MEMORY_FILE_PATH + : path.join(path.dirname(fileURLToPath(import.meta.url)), process.env.MEMORY_FILE_PATH) + : defaultMemoryPath; // We are storing our memory using entities, relations, and observations in a graph structure interface Entity { @@ -178,8 +183,7 @@ class KnowledgeGraphManager { } } -const knowledgeGraphManager = new KnowledgeGraphManager(); - +const knowledgeGraphManager = new KnowledgeGraphManager; // The server instance and tools exposed to Claude const server = new Server({ diff --git a/src/memory/package.json b/src/memory/package.json index 741244b1..b64cf3b6 100644 --- a/src/memory/package.json +++ b/src/memory/package.json @@ -1,6 +1,6 @@ { "name": "@modelcontextprotocol/server-memory", - "version": "0.6.2", + "version": "0.6.3", "description": "MCP server for enabling memory for Claude through a knowledge graph", "license": "MIT", "author": "Anthropic, PBC (https://anthropic.com)", From 5d0bee029505c66fd94cb78df5e814f7107b4cce Mon Sep 17 00:00:00 2001 From: s2005 Date: Sat, 21 Dec 2024 18:54:35 +0100 Subject: [PATCH 2/7] fix(memory): revert back instantiation of KnowledgeGraphManager --- src/memory/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory/index.ts b/src/memory/index.ts index 14ef92ad..75b30aae 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -183,7 +183,7 @@ class KnowledgeGraphManager { } } -const knowledgeGraphManager = new KnowledgeGraphManager; +const knowledgeGraphManager = new KnowledgeGraphManager(); // The server instance and tools exposed to Claude const server = new Server({ From 05fb0eab366ef3b9c0fd0e4d8273c2fb800d7d17 Mon Sep 17 00:00:00 2001 From: s2005 <17839543+s2005@users.noreply.github.com> Date: Sat, 21 Dec 2024 18:59:17 +0100 Subject: [PATCH 3/7] Add newline before server instance initialization As it was before --- src/memory/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/memory/index.ts b/src/memory/index.ts index 75b30aae..62f7aeb6 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -185,6 +185,7 @@ class KnowledgeGraphManager { const knowledgeGraphManager = new KnowledgeGraphManager(); + // The server instance and tools exposed to Claude const server = new Server({ name: "memory-server", From f2a802822b8a72e6a5b3bc9e6847a86b91918749 Mon Sep 17 00:00:00 2001 From: Alexandros Pappas Date: Sun, 22 Dec 2024 15:55:07 +0100 Subject: [PATCH 4/7] feat: Add start and start:sse scripts to package.json on everything server --- src/everything/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/everything/package.json b/src/everything/package.json index 0344f2f1..680dbb88 100644 --- a/src/everything/package.json +++ b/src/everything/package.json @@ -16,7 +16,9 @@ "scripts": { "build": "tsc && shx chmod +x dist/*.js", "prepare": "npm run build", - "watch": "tsc --watch" + "watch": "tsc --watch", + "start": "node dist/index.js", + "start:sse": "node dist/sse.js" }, "dependencies": { "@modelcontextprotocol/sdk": "1.0.1", From 69bba96dab6fa105b5f83ffc997579ecd4e1c8b3 Mon Sep 17 00:00:00 2001 From: Cass Petrus Date: Sun, 22 Dec 2024 12:04:12 -0800 Subject: [PATCH 5/7] fix: update filesystem readme The README for the filesystem MCP setup had a trailing comma (invalid JSON syntax). This addresses that. Along the way, as I was testing out Claude's use of the filesystem, I asked it to check for other inconsistencies. Here are a few others. --- src/filesystem/README.md | 2 +- src/git/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filesystem/README.md b/src/filesystem/README.md index 05c915ad..c52f1a40 100644 --- a/src/filesystem/README.md +++ b/src/filesystem/README.md @@ -124,7 +124,7 @@ Note: all directories must be mounted to `/projects` by default. "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro", "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt", "mcp/filesystem", - "/projects", + "/projects" ] } } diff --git a/src/git/README.md b/src/git/README.md index cb22629e..f0855695 100644 --- a/src/git/README.md +++ b/src/git/README.md @@ -213,7 +213,7 @@ If you are doing local development, there are two ways to test your changes: ```json { "mcpServers": { - "brave-search": { + "git": { "command": "docker", "args": [ "run", From 7ecbfdfd84a168d76a08dd404e000fbabccba721 Mon Sep 17 00:00:00 2001 From: Cass Petrus Date: Wed, 25 Dec 2024 15:04:28 -0800 Subject: [PATCH 6/7] fix: also change tag name --- src/google-maps/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google-maps/README.md b/src/google-maps/README.md index c0fd576e..b91a0657 100644 --- a/src/google-maps/README.md +++ b/src/google-maps/README.md @@ -106,7 +106,7 @@ Add the following to your `claude_desktop_config.json`: Docker build: ```bash -docker build -t vonwig/google-maps:mcp -f src/google-maps/Dockerfile . +docker build -t mcp/google-maps -f src/google-maps/Dockerfile . ``` ## License From ded263ff4174a8cbce33d252d3e2d3700c4f6a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Charri=C3=A8re?= Date: Tue, 31 Dec 2024 13:40:34 +0100 Subject: [PATCH 7/7] Add arguments to the docker command to avoid the server exit --- src/gitlab/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gitlab/README.md b/src/gitlab/README.md index e2b16fe1..4b3d6dc3 100644 --- a/src/gitlab/README.md +++ b/src/gitlab/README.md @@ -117,6 +117,8 @@ Add the following to your `claude_desktop_config.json`: "command": "docker", "args": [ "run", + "--rm", + "-i", "-e", "GITLAB_PERSONAL_ACCESS_TOKEN", "-e", @@ -167,4 +169,4 @@ docker build -t vonwig/gitlab:mcp -f src/gitlab/Dockerfile . ## License -This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. \ No newline at end of file +This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.