Skip to content

Commit b5ad443

Browse files
committed
2 parents 81bb685 + 7e1d9d9 commit b5ad443

7 files changed

Lines changed: 154 additions & 75 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Anthropic, PBC
3+
Copyright (c) 2025 Anthropic, PBC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

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

src/everything/everything.ts

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,6 @@ export const createServer = () => {
186186
let subsUpdateInterval: NodeJS.Timeout | undefined;
187187
let stdErrUpdateInterval: NodeJS.Timeout | undefined;
188188

189-
// Set up update interval for subscribed resources
190-
subsUpdateInterval = setInterval(() => {
191-
for (const uri of subscriptions) {
192-
server.notification({
193-
method: "notifications/resources/updated",
194-
params: { uri },
195-
});
196-
}
197-
}, 10000);
198-
199189
let logLevel: LoggingLevel = "debug";
200190
let logsUpdateInterval: NodeJS.Timeout | undefined;
201191
const messages = [
@@ -215,15 +205,30 @@ export const createServer = () => {
215205
return messageLevel < currentLevel;
216206
};
217207

218-
// Set up update interval for random log messages
219-
logsUpdateInterval = setInterval(() => {
220-
let message = {
221-
method: "notifications/message",
222-
params: messages[Math.floor(Math.random() * messages.length)],
223-
};
224-
if (!isMessageIgnored(message.params.level as LoggingLevel))
225-
server.notification(message);
226-
}, 20000);
208+
// Function to start notification intervals when a client connects
209+
const startNotificationIntervals = () => {
210+
if (!subsUpdateInterval) {
211+
subsUpdateInterval = setInterval(() => {
212+
for (const uri of subscriptions) {
213+
server.notification({
214+
method: "notifications/resources/updated",
215+
params: { uri },
216+
});
217+
}
218+
}, 10000);
219+
}
220+
221+
if (!logsUpdateInterval) {
222+
logsUpdateInterval = setInterval(() => {
223+
let message = {
224+
method: "notifications/message",
225+
params: messages[Math.floor(Math.random() * messages.length)],
226+
};
227+
if (!isMessageIgnored(message.params.level as LoggingLevel))
228+
server.notification(message);
229+
}, 20000);
230+
}
231+
};
227232

228233

229234

@@ -941,7 +946,7 @@ export const createServer = () => {
941946
if (stdErrUpdateInterval) clearInterval(stdErrUpdateInterval);
942947
};
943948

944-
return { server, cleanup };
949+
return { server, cleanup, startNotificationIntervals };
945950
};
946951

947952
const MCP_TINY_IMAGE =

src/everything/sse.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const transports: Map<string, SSEServerTransport> = new Map<string, SSEServerTra
1010

1111
app.get("/sse", async (req, res) => {
1212
let transport: SSEServerTransport;
13-
const { server, cleanup } = createServer();
13+
const { server, cleanup, startNotificationIntervals } = createServer();
1414

1515
if (req?.query?.sessionId) {
1616
const sessionId = (req?.query?.sessionId as string);
@@ -25,6 +25,9 @@ app.get("/sse", async (req, res) => {
2525
await server.connect(transport);
2626
console.error("Client Connected: ", transport.sessionId);
2727

28+
// Start notification intervals after client connects
29+
startNotificationIntervals();
30+
2831
// Handle close of connection
2932
server.onclose = async () => {
3033
console.error("Client Disconnected: ", transport.sessionId);

src/filesystem/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ The server's directory access control follows this flow:
6464

6565
## API
6666

67-
### Resources
68-
69-
- `file://system`: File system operations interface
70-
7167
### Tools
7268

7369
- **read_text_file**

src/filesystem/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
615615
{
616616
name: "list_allowed_directories",
617617
description:
618-
"Returns the list of root directories that this server is allowed to access. " +
619-
"Use this to understand which directories are available before trying to access files. ",
618+
"Returns the list of directories that this server is allowed to access. " +
619+
"Subdirectories within these allowed directories are also accessible. " +
620+
"Use this to understand which directories and their nested paths are available " +
621+
"before trying to access files.",
620622
inputSchema: {
621623
type: "object",
622624
properties: {},

src/git/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2424

2525
FROM python:3.12-slim-bookworm
2626

27-
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
27+
RUN apt-get update && apt-get install -y git git-lfs && rm -rf /var/lib/apt/lists/* \
28+
&& git lfs install --system
2829

2930
WORKDIR /app
3031

0 commit comments

Comments
 (0)