File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 11services :
22 mcp_docker :
3- image : mcp/docker:0.0.2
3+ image : mcp/docker:0.0.3
44 ports :
55 - 8811:8811
66 volumes :
Original file line number Diff line number Diff line change 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)
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)
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)))))))
You can’t perform that action at this time.
0 commit comments