Skip to content

Commit 1bf51c1

Browse files
Merge branch 'main' into feature/add-mcp-google-search
2 parents 5b64473 + 2184769 commit 1bf51c1

File tree

19 files changed

+517
-22
lines changed

19 files changed

+517
-22
lines changed

README.md

Lines changed: 46 additions & 6 deletions
Large diffs are not rendered by default.

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/github/common/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { getUserAgent } from "universal-user-agent";
12
import { createGitHubError } from "./errors.js";
3+
import { VERSION } from "./version.js";
24

35
type RequestOptions = {
46
method?: string;
57
body?: unknown;
68
headers?: Record<string, string>;
7-
};
9+
}
810

911
async function parseResponseBody(response: Response): Promise<unknown> {
1012
const contentType = response.headers.get("content-type");
@@ -24,13 +26,16 @@ export function buildUrl(baseUrl: string, params: Record<string, string | number
2426
return url.toString();
2527
}
2628

29+
const USER_AGENT = `modelcontextprotocol/servers/github/v${VERSION} ${getUserAgent()}`;
30+
2731
export async function githubRequest(
2832
url: string,
2933
options: RequestOptions = {}
3034
): Promise<unknown> {
3135
const headers: Record<string, string> = {
3236
"Accept": "application/vnd.github.v3+json",
3337
"Content-Type": "application/json",
38+
"User-Agent": USER_AGENT,
3439
...options.headers,
3540
};
3641

src/github/common/version.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const VERSION = "0.6.2";

src/github/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ import {
2525
GitHubConflictError,
2626
isGitHubError,
2727
} from './common/errors.js';
28+
import { VERSION } from "./common/version.js";
2829

2930
const server = new Server(
3031
{
3132
name: "github-mcp-server",
32-
version: "0.1.0",
33+
version: VERSION,
3334
},
3435
{
3536
capabilities: {

src/github/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
"@types/node": "^22",
2424
"@types/node-fetch": "^2.6.12",
2525
"node-fetch": "^3.3.2",
26+
"universal-user-agent": "^7.0.2",
2627
"zod": "^3.22.4",
2728
"zod-to-json-schema": "^3.23.5"
2829
},
2930
"devDependencies": {
3031
"shx": "^0.3.4",
3132
"typescript": "^5.6.2"
3233
}
33-
}
34+
}

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)",

src/redis/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:22.12-alpine as builder
2+
3+
COPY src/redis /app
4+
5+
WORKDIR /app
6+
7+
RUN --mount=type=cache,target=/root/.npm npm install
8+
9+
RUN npm run build
10+
11+
FROM node:22-alpine AS release
12+
13+
COPY --from=builder /app/build /app/build
14+
COPY --from=builder /app/package.json /app/package.json
15+
COPY --from=builder /app/package-lock.json /app/package-lock.json
16+
17+
ENV NODE_ENV=production
18+
19+
WORKDIR /app
20+
21+
RUN npm ci --ignore-scripts --omit-dev
22+
23+
ENTRYPOINT ["node", "build/index.js"]

src/redis/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Redis
2+
3+
A Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
4+
5+
## Components
6+
7+
### Tools
8+
9+
- **set**
10+
- Set a Redis key-value pair with optional expiration
11+
- Input:
12+
- `key` (string): Redis key
13+
- `value` (string): Value to store
14+
- `expireSeconds` (number, optional): Expiration time in seconds
15+
16+
- **get**
17+
- Get value by key from Redis
18+
- Input: `key` (string): Redis key to retrieve
19+
20+
- **delete**
21+
- Delete one or more keys from Redis
22+
- Input: `key` (string | string[]): Key or array of keys to delete
23+
24+
- **list**
25+
- List Redis keys matching a pattern
26+
- Input: `pattern` (string, optional): Pattern to match keys (default: *)
27+
28+
## Usage with Claude Desktop
29+
30+
To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your `claude_desktop_config.json`:
31+
32+
### Docker
33+
34+
* when running docker on macos, use host.docker.internal if the server is running on the host network (eg localhost)
35+
* Redis URL can be specified as an argument, defaults to "redis://localhost:6379"
36+
37+
```json
38+
{
39+
"mcpServers": {
40+
"redis": {
41+
"command": "docker",
42+
"args": [
43+
"run",
44+
"-i",
45+
"--rm",
46+
"mcp/redis",
47+
"redis://host.docker.internal:6379"]
48+
}
49+
}
50+
}
51+
```
52+
53+
### NPX
54+
55+
```json
56+
{
57+
"mcpServers": {
58+
"redis": {
59+
"command": "npx",
60+
"args": [
61+
"-y",
62+
"@modelcontextprotocol/server-redis",
63+
"redis://localhost:6379"
64+
]
65+
}
66+
}
67+
}
68+
```
69+
70+
## Building
71+
72+
Docker:
73+
74+
```sh
75+
docker build -t mcp/redis -f src/redis/Dockerfile .
76+
```
77+
78+
## License
79+
80+
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.

0 commit comments

Comments
 (0)