Skip to content

Commit 11a499c

Browse files
Merge branch 'main' into eunomia_server
2 parents 813aa58 + 8d54d44 commit 11a499c

File tree

9 files changed

+77
-13
lines changed

9 files changed

+77
-13
lines changed

src/everything/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"scripts": {
1717
"build": "tsc && shx chmod +x dist/*.js",
1818
"prepare": "npm run build",
19-
"watch": "tsc --watch"
19+
"watch": "tsc --watch",
20+
"start": "node dist/index.js",
21+
"start:sse": "node dist/sse.js"
2022
},
2123
"dependencies": {
2224
"@modelcontextprotocol/sdk": "1.0.1",

src/gdrive/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import fs from "fs";
1313
import { google } from "googleapis";
1414
import path from "path";
15+
import { fileURLToPath } from 'url';
1516

1617
const drive = google.drive("v3");
1718

@@ -176,15 +177,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
176177
});
177178

178179
const credentialsPath = process.env.GDRIVE_CREDENTIALS_PATH || path.join(
179-
path.dirname(new URL(import.meta.url).pathname),
180+
path.dirname(fileURLToPath(import.meta.url)),
180181
"../../../.gdrive-server-credentials.json",
181182
);
182183

183184
async function authenticateAndSaveCredentials() {
184185
console.log("Launching auth flow…");
185186
const auth = await authenticate({
186187
keyfilePath: process.env.GDRIVE_OAUTH_PATH || path.join(
187-
path.dirname(new URL(import.meta.url).pathname),
188+
path.dirname(fileURLToPath(import.meta.url)),
188189
"../../../gcp-oauth.keys.json",
189190
),
190191
scopes: ["https://www.googleapis.com/auth/drive.readonly"],

src/git/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,23 @@ Please note that mcp-server-git is currently in early development. The functiona
6767
- `branch_name` (string): Name of the new branch
6868
- `start_point` (string, optional): Starting point for the new branch
6969
- Returns: Confirmation of branch creation
70-
8. `git_checkout`
70+
10. `git_checkout`
7171
- Switches branches
7272
- Inputs:
7373
- `repo_path` (string): Path to Git repository
7474
- `branch_name` (string): Name of branch to checkout
7575
- Returns: Confirmation of branch switch
76-
9. `git_show`
76+
11. `git_show`
7777
- Shows the contents of a commit
7878
- Inputs:
7979
- `repo_path` (string): Path to Git repository
8080
- `revision` (string): The revision (commit hash, branch name, tag) to show
8181
- Returns: Contents of the specified commit
82+
12. `git_init`
83+
- Initializes a Git repository
84+
- Inputs:
85+
- `repo_path` (string): Path to directory to initialize git repo
86+
- Returns: Confirmation of repository initialization
8287

8388
## Installation
8489

src/git/src/mcp_server_git/server.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class GitShow(BaseModel):
5656
repo_path: str
5757
revision: str
5858

59+
class GitInit(BaseModel):
60+
repo_path: str
61+
5962
class GitTools(str, Enum):
6063
STATUS = "git_status"
6164
DIFF_UNSTAGED = "git_diff_unstaged"
@@ -68,6 +71,7 @@ class GitTools(str, Enum):
6871
CREATE_BRANCH = "git_create_branch"
6972
CHECKOUT = "git_checkout"
7073
SHOW = "git_show"
74+
INIT = "git_init"
7175

7276
def git_status(repo: git.Repo) -> str:
7377
return repo.git.status()
@@ -118,6 +122,13 @@ def git_checkout(repo: git.Repo, branch_name: str) -> str:
118122
repo.git.checkout(branch_name)
119123
return f"Switched to branch '{branch_name}'"
120124

125+
def git_init(repo_path: str) -> str:
126+
try:
127+
repo = git.Repo.init(path=repo_path, mkdir=True)
128+
return f"Initialized empty Git repository in {repo.git_dir}"
129+
except Exception as e:
130+
return f"Error initializing repository: {str(e)}"
131+
121132
def git_show(repo: git.Repo, revision: str) -> str:
122133
commit = repo.commit(revision)
123134
output = [
@@ -206,6 +217,11 @@ async def list_tools() -> list[Tool]:
206217
name=GitTools.SHOW,
207218
description="Shows the contents of a commit",
208219
inputSchema=GitShow.schema(),
220+
),
221+
Tool(
222+
name=GitTools.INIT,
223+
description="Initialize a new Git repository",
224+
inputSchema=GitInit.schema(),
209225
)
210226
]
211227

@@ -241,6 +257,16 @@ def by_commandline() -> Sequence[str]:
241257
@server.call_tool()
242258
async def call_tool(name: str, arguments: dict) -> list[TextContent]:
243259
repo_path = Path(arguments["repo_path"])
260+
261+
# Handle git init separately since it doesn't require an existing repo
262+
if name == GitTools.INIT:
263+
result = git_init(str(repo_path))
264+
return [TextContent(
265+
type="text",
266+
text=result
267+
)]
268+
269+
# For all other commands, we need an existing repo
244270
repo = git.Repo(repo_path)
245271

246272
match name:

src/gitlab/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ Add the following to your `claude_desktop_config.json`:
117117
"command": "docker",
118118
"args": [
119119
"run",
120+
"--rm",
121+
"-i",
120122
"-e",
121123
"GITLAB_PERSONAL_ACCESS_TOKEN",
122124
"-e",
@@ -167,4 +169,4 @@ docker build -t vonwig/gitlab:mcp -f src/gitlab/Dockerfile .
167169

168170
## License
169171

170-
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.
172+
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.

src/google-maps/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Add the following to your `claude_desktop_config.json`:
106106
Docker build:
107107

108108
```bash
109-
docker build -t vonwig/google-maps:mcp -f src/google-maps/Dockerfile .
109+
docker build -t mcp/google-maps -f src/google-maps/Dockerfile .
110110
```
111111

112112
## License

src/memory/README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Add this to your claude_desktop_config.json:
137137
"mcpServers": {
138138
"memory": {
139139
"command": "docker",
140-
"args": ["run", "-i", "--rm", "mcp/memory"]
140+
"args": ["run", "-i", "-v", "claude-memory:/app/dist", "--rm", "mcp/memory"]
141141
}
142142
}
143143
}
@@ -158,6 +158,29 @@ Add this to your claude_desktop_config.json:
158158
}
159159
```
160160

161+
#### NPX with custom setting
162+
163+
The server can be configured using the following environment variables:
164+
165+
```json
166+
{
167+
"mcpServers": {
168+
"memory": {
169+
"command": "npx",
170+
"args": [
171+
"-y",
172+
"@modelcontextprotocol/server-memory"
173+
],
174+
"env": {
175+
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
176+
}
177+
}
178+
}
179+
}
180+
```
181+
182+
- `MEMORY_FILE_PATH`: Path to the memory storage JSON file (default: `memory.json` in the server directory)
183+
161184
### System Prompt
162185

163186
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.
@@ -200,4 +223,4 @@ docker build -t mcp/memory -f src/memory/Dockerfile .
200223

201224
## License
202225

203-
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.
226+
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.

src/memory/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ import { promises as fs } from 'fs';
1010
import path from 'path';
1111
import { fileURLToPath } from 'url';
1212

13+
// Define memory file path using environment variable with fallback
14+
const defaultMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.json');
1315

14-
// Define the path to the JSONL file, you can change this to your desired local path
15-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
16-
const MEMORY_FILE_PATH = path.join(__dirname, 'memory.json');
16+
// If MEMORY_FILE_PATH is just a filename, put it in the same directory as the script
17+
const MEMORY_FILE_PATH = process.env.MEMORY_FILE_PATH
18+
? path.isAbsolute(process.env.MEMORY_FILE_PATH)
19+
? process.env.MEMORY_FILE_PATH
20+
: path.join(path.dirname(fileURLToPath(import.meta.url)), process.env.MEMORY_FILE_PATH)
21+
: defaultMemoryPath;
1722

1823
// We are storing our memory using entities, relations, and observations in a graph structure
1924
interface Entity {

src/memory/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/server-memory",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "MCP server for enabling memory for Claude through a knowledge graph",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",

0 commit comments

Comments
 (0)