Sign in

    moonmcp

    moonmcp — Model Context Protocol servers and clients for MoonBit (← FastMCP): the wire model, tools, resources and prompts, with the server core and transports to follow.

    mcp
    model-context-protocol
    fastmcp
    llm
    agent
    moonbit
    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    2 hours ago
    Downloads
    2

    No dependencies

    #moonmcp

    Model Context Protocol servers and clients for MoonBit, after FastMCP. Python's machinery (pydantic introspection, decorators, camelCase shims) becomes MoonBit's own: records with ToJson and FromJson, closures in place of subclasses, one error enum.

    Status: the foundation layer is in: the wire model and the components. The server core, the transports and the client come next.

    #Packages

    PackageWhat it holds
    typesThe MCP wire model: protocol constants, the JSON-RPC envelope, content blocks, tools, prompts, resources, capabilities, request parameters, every result
    exceptionsFastMCPError, one enum whose variants carry their payloads, and the mapping to MCP error codes
    componentComponentBase, the open Component trait, metadata and version handling
    toolsTool with run and prepare_run, ToolResult, structured-output wrapping
    promptsPrompt, Message, PromptResult
    resourcesResource, ResourceTemplate with an RFC 6570 URI template engine, path screening
    tasksTask mode, configuration and metadata
    settingsSettings, read from FASTMCP_* variables
    mcp_configThe mcp.json client configuration: server kinds, transforms, transport inference
    utilitiesImage, audio and file helpers that become content blocks

    #How Python maps over

    FastMCPmoonmcp
    Exception class hierarchypub(all) suberror FastMCPError, a variant per class
    Pydantic modelspub(all) structs with ToJson and FromJson written out, so wire names such as mimeType stay exact
    FunctionTool, FunctionPrompt, FunctionResource subclassesa struct with a closure field (run_fn, render_fn, read_fn); components implement the open Component trait
    TransformingMCPServer mixina transform field on MCPServerEntry

    #Install

    moon add moonbitstack/moonmcp

    #Licence

    Apache-2.0. See LICENSE.