mcp-types: Core types and protocol definitions for the Model Context Protocol (MCP)

[ ai, library, mpl, web ] [ Propose Tags ] [ Report a vulnerability ]

This library provides the core type definitions and JSON-RPC protocol layer for the Model Context Protocol (MCP). MCP is a protocol that enables seamless communication between AI models and external tools, resources, and services.

This package contains only the pure protocol types with minimal dependencies, making it suitable for building both clients and servers on any framework. For a ready-made Servant-based server, see the mcp package.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.1
Change log CHANGELOG.md
Dependencies aeson (>=2.1 && <2.3), base (>=4.18 && <4.22), containers (>=0.6 && <0.8), jsonrpc (>=0.2.0 && <0.3), text (>=2.0 && <2.2) [details]
Tested with ghc ==9.12.2
License MPL-2.0
Copyright (c) 2025 DPella AB
Author DPella AB
Maintainer matti@dpella.io, lobo@dpella.io
Uploaded by tritlo at 2026-02-16T16:01:24Z
Category Web, AI
Home page https://github.com/DPella/mcp
Bug tracker https://github.com/DPella/mcp/issues
Source repo head: git clone https://github.com/DPella/mcp.git
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-02-16 [all 1 reports]

Readme for mcp-types-0.1.1

[back to package description]

mcp-types — MCP protocol types for Haskell

mcp-types on Hackage

Core type definitions and JSON-RPC protocol layer for the Model Context Protocol (MCP).

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 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 transport types.
  • MCP.Aeson — Custom Aeson parsing options used internally.

Install

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