My agentic slop goes here. Not intended for anyone else!
at main 3.4 kB view raw
1(** MCP Capability negotiation types. 2 3 Capabilities are exchanged during initialization to determine what features 4 the client and server support. *) 5 6(** {1 Implementation Info} *) 7 8module Implementation : sig 9 type t = { 10 name : string; 11 version : string; 12 unknown : Jsont.json; 13 } 14 (** Information about client or server implementation *) 15 16 val make : name:string -> version:string -> t 17 val jsont : t Jsont.t 18 val pp : Format.formatter -> t -> unit 19end 20 21(** {1 Client Capabilities} *) 22 23module Sampling : sig 24 type t = { 25 context : bool option; 26 tools : bool option; 27 unknown : Jsont.json; 28 } 29 (** Sampling capability (for servers to request LLM sampling from clients) *) 30 31 val empty : t 32 val make : ?context:bool -> ?tools:bool -> unit -> t 33 val jsont : t Jsont.t 34end 35 36module Elicitation : sig 37 type t = { 38 unknown : Jsont.json; 39 } 40 (** Elicitation capability (for servers to request user input) *) 41 42 val empty : t 43 val jsont : t Jsont.t 44end 45 46module Roots : sig 47 type t = { 48 list_changed : bool option; 49 unknown : Jsont.json; 50 } 51 (** Roots capability (for servers to query filesystem roots) *) 52 53 val empty : t 54 val make : ?list_changed:bool -> unit -> t 55 val jsont : t Jsont.t 56end 57 58module Client : sig 59 type t = { 60 sampling : Sampling.t option; 61 elicitation : Elicitation.t option; 62 roots : Roots.t option; 63 experimental : Jsont.json option; 64 unknown : Jsont.json; 65 } 66 (** Client capabilities advertised during initialization *) 67 68 val empty : t 69 val make : 70 ?sampling:Sampling.t -> 71 ?elicitation:Elicitation.t -> 72 ?roots:Roots.t -> 73 ?experimental:Jsont.json -> 74 unit -> t 75 val jsont : t Jsont.t 76 val pp : Format.formatter -> t -> unit 77end 78 79(** {1 Server Capabilities} *) 80 81module Logging : sig 82 type t = { 83 unknown : Jsont.json; 84 } 85 (** Logging capability *) 86 87 val empty : t 88 val jsont : t Jsont.t 89end 90 91module Prompts : sig 92 type t = { 93 list_changed : bool option; 94 unknown : Jsont.json; 95 } 96 (** Prompts capability *) 97 98 val empty : t 99 val make : ?list_changed:bool -> unit -> t 100 val jsont : t Jsont.t 101end 102 103module Resources : sig 104 type t = { 105 subscribe : bool option; 106 list_changed : bool option; 107 unknown : Jsont.json; 108 } 109 (** Resources capability *) 110 111 val empty : t 112 val make : ?subscribe:bool -> ?list_changed:bool -> unit -> t 113 val jsont : t Jsont.t 114end 115 116module Tools : sig 117 type t = { 118 list_changed : bool option; 119 unknown : Jsont.json; 120 } 121 (** Tools capability *) 122 123 val empty : t 124 val make : ?list_changed:bool -> unit -> t 125 val jsont : t Jsont.t 126end 127 128module Completions : sig 129 type t = { 130 unknown : Jsont.json; 131 } 132 (** Completions capability (for auto-complete) *) 133 134 val empty : t 135 val jsont : t Jsont.t 136end 137 138module Server : sig 139 type t = { 140 logging : Logging.t option; 141 prompts : Prompts.t option; 142 resources : Resources.t option; 143 tools : Tools.t option; 144 completions : Completions.t option; 145 experimental : Jsont.json option; 146 unknown : Jsont.json; 147 } 148 (** Server capabilities advertised during initialization *) 149 150 val empty : t 151 val make : 152 ?logging:Logging.t -> 153 ?prompts:Prompts.t -> 154 ?resources:Resources.t -> 155 ?tools:Tools.t -> 156 ?completions:Completions.t -> 157 ?experimental:Jsont.json -> 158 unit -> t 159 val jsont : t Jsont.t 160 val pp : Format.formatter -> t -> unit 161end