@letoribo/mcp-graphql-enhanced 2.2.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +11 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -24,16 +24,24 @@ This allows external systems, web applications, and direct `curl` commands to ac
24
24
  | `/mcp` | `POST` | The main JSON-RPC endpoint for tool execution. |
25
25
  | `/health` | `GET` | Simple health check, returns `{ status: 'ok' }`. |
26
26
 
27
+ ### Resolving Port Conflicts (EADDRINUSE) and Automatic Port Selection
28
+
29
+ The server defaults to port `6274`. If you encounter an `EADDRINUSE: address already in use :::6274` error (common in local development due to stale processes), the server will automatically **increment the port and retry** (e.g., bind to `6275`, then `6276`, etc., up to 5 times).
30
+
31
+ This ensures the server starts successfully even when the default is blocked. **Always check the server logs for the final bound port** (e.g., `[HTTP] Started server on http://localhost:6275`) if your `curl` or client tool fails on the default `6274`.
32
+
33
+ To **force a specific port** (e.g., for guaranteed external firewall settings), you can still explicitly set the `MCP_PORT` environment variable:
34
+
27
35
  ### Testing the HTTP Endpoint
28
36
 
29
37
  You can test the endpoint using `curl` as long as the server is running (e.g., via `npm run dev`):
30
38
 
31
39
  ```bash
32
- # Test the health check
40
+ # Test the health check (assuming the server bound to the default or found the next available port)
33
41
  curl http://localhost:6274/health
34
42
 
35
- # Test the query tool via JSON-RPC
36
- curl -X POST http://localhost:6274/mcp -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"query-graphql","params":{"query":"query { __typename }"},"id":1}'
43
+ # Example: Test the query tool via JSON-RPC (using port 6275 if 6274 was busy)
44
+ curl -X POST http://localhost:6275/mcp -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"query-graphql","params":{"query":"query { __typename }"},"id":1}'
37
45
 
38
46
  ## 🔍 Filtered Introspection (New!)
39
47
  Avoid 50k-line schema dumps. Ask for only what you need:
package/package.json CHANGED
@@ -50,5 +50,5 @@
50
50
  "ts-node": "^10.9.2",
51
51
  "typescript": "5.8.3"
52
52
  },
53
- "version": "2.2.3"
53
+ "version": "2.3.0"
54
54
  }