+3
-2
bin/capitalize_sdk.ml
+3
-2
bin/capitalize_sdk.ml
+3
-2
bin/multimodal_sdk.ml
+3
-2
bin/multimodal_sdk.ml
···
···
+3
-3
lib/mcp.ml
+3
-3
lib/mcp.ml
·········
·········
+1
-1
lib/mcp.mli
+1
-1
lib/mcp.mli
···
···
+108
lib/mcp_rpc.ml
+108
lib/mcp_rpc.ml
···
+34
lib/mcp_rpc.mli
+34
lib/mcp_rpc.mli
···val create_response : id:RequestId.t -> resources:Resource.t list -> ?next_cursor:Cursor.t -> unit -> JSONRPCMessage.t+val create_response : id:RequestId.t -> resource_templates:ResourceTemplate.t list -> ?next_cursor:Cursor.t -> unit -> JSONRPCMessage.t
+91
-11
lib/mcp_sdk.ml
+91
-11
lib/mcp_sdk.ml
··················-let default_capabilities ?(with_tools=true) ?(with_resources=false) ?(with_prompts=false) () =············
···+Log.warningf "Resource '%s' contains template variables. Consider using add_resource_template instead." uri;······+(* Convert a list of ResourceTemplate.t to the format needed for resources/templates/list response *)·········+let default_capabilities ?(with_tools=true) ?(with_resources=false) ?(with_resource_templates=false) ?(with_prompts=false) () =·········+let configure_server server ?with_tools ?with_resources ?with_resource_templates ?with_prompts () =···+let capabilities = default_capabilities ~with_tools ~with_resources ~with_resource_templates ~with_prompts () in
+32
-5
lib/mcp_sdk.mli
+32
-5
lib/mcp_sdk.mli
···-val create : uri_template:string -> ?description:string -> ?mime_type:string -> handler:handler -> unit -> t······val create_server : name:string -> ?version:string -> ?protocol_version:string -> unit -> server-val default_capabilities : ?with_tools:bool -> ?with_resources:bool -> ?with_prompts:bool -> unit -> Json.tval add_tool : server -> name:string -> ?description:string -> ?schema_properties:(string * string * string) list -> ?schema_required:string list -> (Json.t -> Json.t) -> Tool.t-val add_resource : server -> uri_template:string -> ?description:string -> ?mime_type:string -> (string list -> string) -> Resource.tval add_prompt : server -> name:string -> ?description:string -> ?arguments:(string * string option * bool) list -> ((string * string) list -> Prompt.message list) -> Prompt.t-val configure_server : server -> ?with_tools:bool -> ?with_resources:bool -> ?with_prompts:bool -> unit -> server
···+val create : uri:string -> name:string -> ?description:string -> ?mime_type:string -> handler:handler -> unit -> t···+val create : uri_template:string -> name:string -> ?description:string -> ?mime_type:string -> handler:handler -> unit -> t+(** Convert a list of ResourceTemplate.t to the format needed for resources/templates/list response *)+val to_rpc_resource_templates_list : t list -> Mcp_rpc.ListResourceTemplatesResult.ResourceTemplate.t list···val create_server : name:string -> ?version:string -> ?protocol_version:string -> unit -> server+val default_capabilities : ?with_tools:bool -> ?with_resources:bool -> ?with_resource_templates:bool -> ?with_prompts:bool -> unit -> Json.tval add_tool : server -> name:string -> ?description:string -> ?schema_properties:(string * string * string) list -> ?schema_required:string list -> (Json.t -> Json.t) -> Tool.t+val add_resource : server -> uri:string -> name:string -> ?description:string -> ?mime_type:string -> (string list -> string) -> Resource.t+val add_resource_template : server -> uri_template:string -> name:string -> ?description:string -> ?mime_type:string -> (string list -> string) -> ResourceTemplate.tval add_prompt : server -> name:string -> ?description:string -> ?arguments:(string * string option * bool) list -> ((string * string) list -> Prompt.message list) -> Prompt.t+val configure_server : server -> ?with_tools:bool -> ?with_resources:bool -> ?with_resource_templates:bool -> ?with_prompts:bool -> unit -> server
+100
-47
lib/mcp_server.ml
+100
-47
lib/mcp_server.ml
············Some (create_jsonrpc_error req.id ErrorCode.InternalError ("Error reading resource: " ^ err) ()))···
············Some (create_jsonrpc_error req.id ErrorCode.InternalError ("Error reading resource: " ^ err) ()))+let response = Mcp_rpc.ResourcesRead.create_response ~id:req.id ~contents:[resource_content] () in+Some (create_jsonrpc_error req.id ErrorCode.InternalError ("Error reading resource template: " ^ err) ()))···