packages feed

mcp-types 0.1.0 → 0.1.1

raw patch · 6 files changed

+69/−4 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ MCP.Protocol: sERVER_NOT_INITIALIZED :: Int

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog +## 0.1.1++### Added+- `sERVER_NOT_INITIALIZED` error code constant (-32002) in `MCP.Protocol`.+ ## 0.1.0  ### Added
+ README.md view
@@ -0,0 +1,56 @@+# mcp-types — MCP protocol types for Haskell++[![mcp-types on Hackage](https://img.shields.io/hackage/v/mcp-types.svg)](https://hackage.haskell.org/package/mcp-types)++Core type definitions and JSON-RPC protocol layer for the+[Model Context Protocol (MCP)](https://modelcontextprotocol.io/).++This package contains only the pure protocol types with minimal dependencies,+Implements MCP protocol version **2025-06-18**, making it suitable for+building both clients and servers on any framework.+For a ready-made Servant-based server, see the+[`mcp`](https://hackage.haskell.org/package/mcp) package.++## Modules++- **`MCP.Types`** — Core MCP data types: Content, Resource, Tool, Prompt,+  Capability, Implementation, and more.+- **`MCP.Protocol`** — JSON-RPC 2.0 message wrappers, all client/server+  request/response types, notification types, and protocol constants.+  Re-exports the [`jsonrpc`](https://hackage.haskell.org/package/jsonrpc)+  transport types.+- **`MCP.Aeson`** — Custom Aeson parsing options used internally.++## Install++```cabal+build-depends:+    base+  , aeson+  , mcp-types+```++## MCP Protocol Support++| Operation | Description |+|-----------|-------------|+| `initialize` | Start session and negotiate capabilities |+| `ping` | Health check |+| `resources/list` | List available resources |+| `resources/templates/list` | List resource templates |+| `resources/read` | Read resource contents |+| `resources/subscribe` | Subscribe to resource updates |+| `resources/unsubscribe` | Unsubscribe from resource updates |+| `prompts/list` | List available prompts |+| `prompts/get` | Get prompt with arguments |+| `tools/list` | List available tools |+| `tools/call` | Execute a tool |+| `completion/complete` | Auto-completion with context |+| `logging/setLevel` | Set logging level |+| `sampling/createMessage` | Request LLM sampling |+| `roots/list` | List client root directories |+| `elicitation/create` | Request user input via forms |++## License++MPL-2.0
mcp-types.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: mcp-types-version: 0.1.0+version: 0.1.1 license: MPL-2.0 license-file: LICENSE copyright: (c) 2025 DPella AB@@ -8,6 +8,7 @@ tested-with: ghc ==9.12.2 extra-doc-files:   CHANGELOG.md+  README.md  maintainer:   matti@dpella.io,
src/MCP/Aeson.hs view
@@ -1,6 +1,5 @@ {- | Module:      MCP.Aeson-Copyright:   (c) DPella AB 2025 License:     MPL-2.0 Maintainer:  <matti@dpella.io>, <lobo@dpella.io> -}
src/MCP/Protocol.hs view
@@ -13,7 +13,6 @@ {- | Module      : MCP.Protocol Description : MCP protocol types built on JSON-RPC 2.0-Copyright   : (C) 2025 DPella AB License     : MPL-2.0 Maintainer  : matti@dpella.io, lobo@dpella.io Stability   : experimental@@ -106,6 +105,7 @@      -- * MCP Constants     pROTOCOL_VERSION,+    sERVER_NOT_INITIALIZED, ) where  import Control.Applicative ((<|>))@@ -1119,6 +1119,10 @@ -} pROTOCOL_VERSION :: Text pROTOCOL_VERSION = "2025-06-18"++-- | JSON-RPC error code for requests received before the server has been initialized (-32002).+sERVER_NOT_INITIALIZED :: Int+sERVER_NOT_INITIALIZED = -32002  {- | Primitive schema definitions that only allow primitive types without nested objects or arrays. 
src/MCP/Types.hs view
@@ -9,7 +9,6 @@ {- | Module      : MCP.Types Description : Core types for the Model Context Protocol (MCP)-Copyright   : (C) 2025 DPella AB License     : MPL-2.0 Maintainer  : matti@dpella.io, lobo@dpella.io Stability   : experimental@@ -22,6 +21,7 @@ module MCP.Types (     -- * Basic Types (re-exported from JSONRPC)     RequestId (..),+     -- * Basic Types     Role (..),     Cursor (..),