hs-mcp-0.1.1.0: Library with tools for creating an MCP server implementation.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.MCP.Server

Synopsis

Documentation

data Server Source #

Server type with resources, tools, prompts and handlers

type ServerHandler = Server -> Value -> IO Value Source #

Server handler for message processing

type ToolCallHandler = CallToolRequest -> IO CallToolResult Source #

Tool call handler type

registerResources :: Server -> [Resource] -> IO () Source #

Register available resources

registerResourceReadHandler :: Server -> ResourceReadHandler -> IO () Source #

Register resource read handler

registerTools :: Server -> [Tool] -> IO () Source #

Register available tools

registerToolCallHandler :: Server -> ToolCallHandler -> IO () Source #

Register tool call handler

registerPrompts :: Server -> [Prompt] -> IO () Source #

Register available prompts

registerPromptHandler :: Server -> PromptHandler -> IO () Source #

Register prompt handler

runServerWithTransport :: Transport t => Server -> t -> IO () Source #

Run the server, handling messages until the transport mechanism shuts down.

withTransportServer :: Transport t => Server -> t -> (Async () -> IO a) -> IO a Source #

Run a transport server while the action is executed. If the action throws an exception or terminates the server will be stopped.