Gemini CLI commited on
Commit
0be76ea
·
1 Parent(s): d044f61

Fix: Use git apply to patch server code

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -6
  2. fix.patch +29 -0
Dockerfile CHANGED
@@ -5,12 +5,9 @@ WORKDIR /app
5
  # Clone the repository
6
  RUN git clone https://github.com/sylweriusz/mcp-neo4j-memory-server.git .
7
 
8
- # Add a root endpoint to the server for a better user experience
9
- RUN sed -i "/this.app.get('\/health', (_req, res) => {/i this.app.get('/', (_req, res) => { res.json({ message: 'MCP Neo4j Memory Server is running.', endpoints: { health: '/health', mcp: '/mcp' } }); });" src/http/server.ts
10
-
11
- # Fix the session initialization bug
12
- RUN sed -i '/isInitializeRequest/c\
13
- } else if (req.body && req.body.method === "initialize") {' src/http/server.ts
14
 
15
  # Install dependencies
16
  RUN npm install
 
5
  # Clone the repository
6
  RUN git clone https://github.com/sylweriusz/mcp-neo4j-memory-server.git .
7
 
8
+ # Create and apply a patch to fix the server
9
+ COPY fix.patch .
10
+ RUN git apply fix.patch
 
 
 
11
 
12
  # Install dependencies
13
  RUN npm install
fix.patch ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --- a/src/http/server.ts
2
+ +++ b/src/http/server.ts
3
+ @@ -108,6 +108,15 @@
4
+ }
5
+
6
+ private setupRoutes(): void {
7
+ + // Root endpoint for basic health check and discovery
8
+ + this.app.get('/', (_req, res) => {
9
+ + res.json({
10
+ + message: 'MCP Neo4j Memory Server is running.',
11
+ + endpoints: {
12
+ + health: '/health',
13
+ + mcp: '/mcp'
14
+ + }
15
+ + });
16
+ + });
17
+ +
18
+ // Health check
19
+ this.app.get('/health', (_req, res) => {
20
+ res.json({
21
+ @@ -164,7 +173,7 @@
22
+ // Use existing session
23
+ transport = this.transports.get(sessionId)!;
24
+ responseSessionId = sessionId;
25
+ - } else if (isInitializeRequest(req.body)) {
26
+ + } else if (req.body && req.body.method === 'initialize') {
27
+ // Create new session for initialize request
28
+ responseSessionId = randomUUID();
29
+ transport = new StreamableHTTPServerTransport({