MCP-Haskell is an MCP server and framework implementation that brings the Model Context Protocol to the Haskell ecosystem, supporting both standard input/output (StdIO) and HTTP transport mechanisms. It connects LLM frontends such as Claude Desktop and HTTP API consumers to Haskell applications, providing a strongly typed, type-safe architecture for exposing custom capabilities. Developers who write in Haskell use this framework to expose external context, tools, and prompts to Large Language Models while preserving strict compile-time safety and automatic JSON serialization through Aeson. The framework is organized into two primary packages: mcp-types, which supplies protocol structures and JSON-RPC primitives with minimal dependencies, and mcp, which provides a Servant-based HTTP server featuring JWT authentication and Server-Sent Events alongside StdIO transport. By using MCP-Haskell, developers can implement custom tool handlers, subscribe to resource streams, expose prompt templates, and manage client-server lifecycle communications under the latest protocol specifications.
Category: AI & LLM Tooling
Tags: framework, haskell, http, sdk, stdio
mcp or mcp-types to your project's Cabal build-depends configuration depending on whether you are building a server or client. 4. Build the project using cabal build all. 5. Run the provided example server using cabal run mcp-example to start an HTTP server on http://localhost:8080/mcp and retrieve your JWT token from stdout. 6. For connecting clients such as Claude Desktop via StdIO or HTTP, configure your client using the template provided in example/mcp-config.json as documented in the repository.Part of MCP Servers
MCP-Haskell is a complete, type-safe implementation of the Model Context Protocol for Haskell. It enables developers to build custom MCP servers and clients using either StdIO or HTTP transports, integrating Haskell logic, tools, and resources with AI assistants.
You can add mcp or mcp-types to the build-depends section of your project's Cabal configuration file. For server development, include dependencies like servant, servant-server, servant-auth-server, aeson, and mcp, targeting GHC 9.12.
MCP-Haskell supports both standard input/output (StdIO) communication for local integrations and HTTP transport with streaming Server-Sent Events (SSE) and JWT authentication powered by Servant.
Yes, MCP-Haskell is open source and licensed under the Mozilla Public License 2.0 (MPL-2.0). Source code and documentation are available in the public repository.