# Hs Mcp

> Haskell server/client for MCP (Model Context Protocol)

- **Type:** MCP server
- **Install:** `agentstack add mcp-buecking-hs-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [buecking](https://agentstack.voostack.com/s/buecking)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [buecking](https://github.com/buecking)
- **Source:** https://github.com/buecking/hs-mcp

## Install

```sh
agentstack add mcp-buecking-hs-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MCP-Haskell (hs-mcp)

A Haskell implementation of the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/).

## 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

```bash
# 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

```haskell
import Network.MCP.Server
import Network.MCP.Types
import Network.MCP.Server.StdIO

main :: IO ()
main = do
  -- Create server
  let serverInfo = Implementation "my-server" "1.0.0"
      serverCapabilities = ServerCapabilities
        { resourcesCapability = Just $ ResourcesCapability True
        , toolsCapability = Just $ ToolsCapability True
        , promptsCapability = Nothing
        }
  
  server  do
    -- Implement resource reading logic
    ...

  -- Register tools (optional)
  let tool = Tool 
        { toolName = "my-tool"
        , toolDescription = Just "My tool"
        , toolInputSchema = "{...}" -- JSON schema
        }
  
  registerTools server [tool]
  
  -- Register tool call handler
  registerToolCallHandler server $ \request -> do
    -- Implement tool execution logic
    ...
  
  -- Start the server with StdIO transport
  runServerWithSTDIO server
```

### Example Server

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

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

You can test it with the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) or Claude Desktop.

## Testing

Run the test suite:

```bash
cabal test
```

## Protocol Compatibility

This implementation follows the [Model Context Protocol specification](https://spec.modelcontextprotocol.io/) 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.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [buecking](https://github.com/buecking)
- **Source:** [buecking/hs-mcp](https://github.com/buecking/hs-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-buecking-hs-mcp
- Seller: https://agentstack.voostack.com/s/buecking
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
