colmugx/mcp/server does not have a README file
pub trait RequestStateCodec {
fn seal(Self, RequestStatePayload, now~ : Int) -> String
fn open(Self, String, RequestStateContext, now~ : Int) -> RequestStatePayload?
}pub(all) struct ActiveSubscription {
filter : SubscriptionFilter
reply : Queue[String]
subscription_id : String
cancellation_token : CancellationToken
cancellation_registration : CancellationRegistration
}pub struct AesGcmStateCodec {
key : Bytes
}fn AesGcmStateCodec::open(self : AesGcmStateCodec, blob : String, ctx : RequestStateContext, now~ : Int) -> RequestStatePayload?fn AesGcmStateCodec::seal(self : AesGcmStateCodec, payload : RequestStatePayload, now~ : Int) -> Stringpub struct CompletionRegistry {
handlers : Map[String, async (RequestContext, CompleteRequestParams) -> Result[CompletionResult, MCPError]]
}fn CompletionRegistry::register(self : CompletionRegistry, reference : CompletionReference, handler : async (RequestContext, CompleteRequestParams) -> Result[CompletionResult, MCPError]) -> CompletionRegistrypub struct MCPServer {
name : String
version : String
title : String?
description : String?
instructions : String?
auth_config : AuthConfig?
request_state_codec : AesGcmStateCodec?
clock : () -> Int
registry : ToolRegistry
resource_registry : ResourceRegistry
prompt_registry : PromptRegistry
completion_registry : CompletionRegistry?
tools_enabled : Bool?
resources_enabled : Bool?
prompts_enabled : Bool?
subscriptions : Map[String, ActiveSubscription]
active_requests : Map[String, CancellationToken]
next_scope_id : Int
}async fn MCPServer::handle_request(self : MCPServer, request_json : String, principal? : Principal, cancellation_token? : CancellationToken, progress_reporter? : ProgressReporter) -> Stringfn MCPServer::prompt(self : MCPServer, name : String, description : String, arguments : Array[PromptArgument], handler : async (RequestContext, Json) -> Result[GetPromptResult, MCPError]) -> MCPServerfn MCPServer::prompt_definition(self : MCPServer, definition : PromptDefinition, handler : async (RequestContext, Json) -> Result[PromptGetOutcome, MCPError]) -> MCPServerfn MCPServer::prompt_mrtr(self : MCPServer, name : String, description : String, arguments : Array[PromptArgument], handler : async (RequestContext, Json) -> Result[PromptGetOutcome, MCPError]) -> MCPServerfn MCPServer::resource(self : MCPServer, uri : String, name : String, description : String, mime_type : String, handler : async (RequestContext) -> Result[ResourceReadResult, MCPError]) -> MCPServerfn MCPServer::resource_definition(self : MCPServer, definition : ResourceDefinition, handler : async (RequestContext, Json) -> Result[ResourceReadOutcome, MCPError]) -> MCPServerfn MCPServer::resource_mrtr(self : MCPServer, uri : String, name : String, description : String, mime_type : String, handler : async (RequestContext, Json) -> Result[ResourceReadOutcome, MCPError]) -> MCPServerfn MCPServer::resource_template_definition(self : MCPServer, definition : ResourceTemplateDefinition) -> MCPServerasync fn MCPServer::run_http(self : MCPServer, port? : Int, path? : String) -> Unit raise TransportErrorfn MCPServer::tool(self : MCPServer, name : String, description : String, input_schema : Json, handler : async (RequestContext, Json) -> Result[ToolResult, MCPError]) -> MCPServer raise MCPErrorfn MCPServer::tool_definition(self : MCPServer, definition : ToolDefinition, handler : async (RequestContext, Json) -> Result[ToolCallOutcome, MCPError], schema_resources? : Map[String, Json], input_base_uri? : String, output_base_uri? : String) -> MCPServer raise MCPErrorpub(all) struct RequestStatePayload {
principal : String?
expires_at : Int
request_method : String
params_digest : String
state : Json
}pub(all) struct SubscriptionFilter {
tools_list_changed : Bool
prompts_list_changed : Bool
resources_list_changed : Bool
resource_subscriptions : Array[String]
}fn SubscriptionFilter::matches(self : SubscriptionFilter, kind : SubscriptionNotificationKind) -> Boolfn simple_tool(name : String, description : String, handler : (RequestContext, Json) -> ToolResult) -> ToolWrapperfn[Args : Params, Ret : ToToolResult] tool_fn(handler : (RequestContext, Args) -> Ret, name~ : String, description~ : String) -> ToolWrapperInstall
Download zipType-safe MCP SDK in MoonBit with server/client support and dual transport (STDIO/HTTP)