Skip to content

Commit 692da02

Browse files
committed
Fix mcp servers default timeout from 20s -> 60s.
1 parent 8501b11 commit 692da02

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- Bump mcp java sdk to 1.12.1.
6+
- Fix mcp servers default timeout from 20s -> 60s.
7+
58
## 0.51.0
69

710
- Support timeout on `eca_shell_command` with default to 1min.

deps.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
org.clojure/core.async {:mvn/version "1.8.741"}
44
org.babashka/cli {:mvn/version "0.8.65"}
55
com.github.clojure-lsp/lsp4clj {:mvn/version "1.13.1"}
6-
io.modelcontextprotocol.sdk/mcp {:mvn/version "0.12.0"}
6+
io.modelcontextprotocol.sdk/mcp {:mvn/version "0.12.1"}
77
borkdude/dynaload {:mvn/version "0.3.5"}
88
babashka/fs {:mvn/version "0.5.26"}
99
babashka/process {:mvn/version "0.6.23"}

src/eca/features/tools/mcp.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,16 @@
6868
(getProcessBuilder [] (-> (ProcessBuilder. ^List pb-init-args)
6969
(.directory (io/file work-dir)))))))
7070

71-
(defn ^:private ->client ^McpSyncClient [transport config workspaces]
71+
(defn ^:private ->client ^McpSyncClient [name transport config workspaces]
7272
(-> (McpClient/sync transport)
73-
(.requestTimeout (Duration/ofSeconds (:mcpTimeoutSeconds config)))
73+
(.requestTimeout (Duration/ofHours 10)) ;; required any value for initializationTimeout work
74+
(.initializationTimeout (Duration/ofSeconds (:mcpTimeoutSeconds config)))
7475
(.capabilities (-> (McpSchema$ClientCapabilities/builder)
7576
(.roots true)
7677
(.build)))
7778
(.roots ^List (mapv #(McpSchema$Root. (:uri %) (:name %)) workspaces))
7879
(.loggingConsumer (fn [^McpSchema$LoggingMessageNotification notification]
79-
(logger/info logger-tag (.data notification))))
80+
(logger/info logger-tag (str "[MCP-" name "]") (.data notification))))
8081
(.build)))
8182

8283
(defn ^:private ->server [mcp-name server-config status db]
@@ -154,7 +155,7 @@
154155
obj-mapper (ObjectMapper.)]
155156
(try
156157
(let [transport (->transport server-config workspaces)
157-
client (->client transport config workspaces)]
158+
client (->client name transport config workspaces)]
158159
(on-server-updated (->server name server-config :starting db))
159160
(swap! db* assoc-in [:mcp-clients name] {:client client :status :starting})
160161
(.initialize client)

0 commit comments

Comments
 (0)