Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 1937650

Browse files
Update server to 0.0.3
1 parent 03ecf01 commit 1937650

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/extension/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
mcp_docker:
3-
image: mcp/docker:0.0.2
3+
image: mcp/docker:0.0.3
44
ports:
55
- 8811:8811
66
volumes:

src/jsonrpc/db.clj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
[{:keys [register] :as opts}]
1717
(->> register
1818
(map (fn [{:keys [cached-path ref-string]}]
19-
(let [m (prompts/get-prompts (assoc opts :prompts cached-path))]
20-
[(or (-> m :metadata :name) ref-string) m])))
19+
(try
20+
(let [m (prompts/get-prompts (assoc opts :prompts cached-path))]
21+
[(or (-> m :metadata :name) ref-string) m])
22+
(catch Throwable t
23+
(logger/error (format "error loading %s: %s" ref-string t))))))
2124
(into {})))
2225

23-
(defn- extract-resources
26+
(defn- extract-resources
2427
"extract resource map from a prompt"
2528
[m]
2629
(->> (vals m)
@@ -33,7 +36,7 @@
3336
{:text (-> entry :default :text)}))]))
3437
(into {})))
3538

36-
(defn- add-static-prompts
39+
(defn- add-static-prompts
3740
[db m]
3841
(-> db
3942
(update :mcp.prompts/registry (fnil merge {}) m)
@@ -91,13 +94,13 @@
9194
(constantly (or (:mcp.prompts/static db) {})))))))
9295
(logger/info "resources are " (:mcp.prompts/resources @db*)))
9396

94-
(defn update-prompt
97+
(defn update-prompt
9598
"update the db with new markdown prompt content being dynamically registered"
9699
[opts s content]
97100
(let [m (prompts/get-prompts
98101
(assoc opts :prompt-content content))]
99-
(swap! db* (fn [db]
100-
(-> db
102+
(swap! db* (fn [db]
103+
(-> db
101104
(update-in [:mcp.prompts/registry s] (constantly m))
102105
(update-in [:mcp.prompts/static s] (constantly m))
103106
(update [:mcp.prompts/resources] (fnil merge {}) (extract-resources m)))))))

0 commit comments

Comments
 (0)