MCP ExplorerExplorer

Hs Mcp

@bueckingon 9 months ago
13 MIT
FreeCommunity
AI Systems
#ai#haskell#mcp-client#mcp-server
Haskell Client/Server implantation of MCP ( Model Context Protocol)

Overview

What is Hs Mcp

hs-mcp is a Haskell implementation of the Model Context Protocol (MCP), which allows Haskell applications to expose tools, resources, and prompts to MCP-compatible clients.

Use cases

Use cases for hs-mcp include building AI assistants that interact with users through prompts and tools, creating data processing services that expose resources to clients, and developing interactive applications that require real-time communication.

How to use

To use hs-mcp, clone the repository, set up the environment with direnv and nix, and build the project using cabal. You can create a simple server by defining server information, capabilities, resources, and tools, and registering handlers for resource reading and tool calls.

Key features

Key features of hs-mcp include a full implementation of the MCP protocol, StdIO transport for local process communication, JSON-RPC messaging, support for resources, tools, and prompts, and a comprehensive test suite.

Where to use

hs-mcp can be used in various domains where Haskell applications need to communicate with MCP-compatible clients, such as AI tools, data processing applications, and interactive systems.

Content

MCP-Haskell (hs-mcp)

A Haskell implementation of the Model Context Protocol (MCP).

Overview

MCP-Haskell (hs-mcp) provides a Haskell implementation of the Model Context Protocol, allowing Haskell applications to expose tools, resources, and prompts to MCP-compatible clients like Claude.

Key features:

  • Full implementation of MCP protocol
  • StdIO transport for local process communication
  • JSON-RPC messaging
  • Support for resources, tools, and prompts
  • Comprehensive test suite

Installation

# Clone the repository
git clone github.com:buecking/hs-mcp.git
cd hs-mcp

# direnv
# echo 'use flake' > .envrc
direnv allow

# nix
nix develop

# Build the project
cabal build

Usage

Creating a simple server

Example Server

The project includes an example echo server that demonstrates the MCP functionality:

# Build and run the example server
cabal run mcp-echo-server

You can test it with the MCP Inspector or Claude Desktop.

Testing

Run the test suite:

cabal test

Protocol Compatibility

This implementation follows the Model Context Protocol specification and is compatible with:

  • Claude Desktop
  • MCP Inspector
  • Other MCP clients following the specification

Project Structure

  • src/Network/MCP/Types.hs - Core MCP types
  • src/Network/MCP/Transport/ - Transport implementations
  • src/Network/MCP/Server/ - Server implementation
  • Examples/ - Example implementations
  • Test/ - Test suite

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers