⚠️ AI SLOP WARNING⚠️ This project was generated by an AI assistant. The code has not been thoroughly reviewed or tested in production. Use at your own risk.
MCP server that exposes Hoogle (Haskell documentation search) as a tool for AI agents.
Build the server:
nix buildThe executable will be at ./result/bin/hoogle-mcp.
Add to ~/.config/claude-code/mcp_settings.json:
{
"mcpServers": {
"hoogle": {
"command": "hoogle-mcp"
}
}
}Alternatively, add to .mcp.json in your project root:
{
"mcpServers": {
"hoogle": {
"command": "hoogle-mcp"
}
}
}This assumes hoogle-mcp is in your PATH. You can make it available via:
nix shellornix run- Adding to your NixOS system packages
- Adding to home-manager configuration
- Using
nix profile install
Alternatively, use the absolute path: "/absolute/path/to/hoogle-mcp/result/bin/hoogle-mcp"
The server provides two tools for searching Haskell documentation:
Simple text-based search returning human-readable results.
Parameters:
query(string, required): Search query for functions, types, modules, or packages
Returns: Plain text search results from Hoogle
Example queries:
"map"- Search for the map function"[a] -> [a]"- Search by type signature"Data.List"- Search for a module
Structured JSON documentation with full Haddock details and URLs.
Parameters:
query(string, required): Name of function, type, module, or packagecount(integer, optional): Maximum number of results to return (default: 10)
Returns: JSON array with structured documentation including:
docs: Full documentation text (HTML format)item: Type signature or declarationmodule: Module name and URLpackage: Package name and URLurl: Direct link to Haddock documentationtype: Result type (e.g., "module" for modules)
Example queries:
"fmap"- Get documentation for a function"Data.List"- Get module documentation and overview"Functor"- Get typeclass documentation
Use cases:
- Access full Haddock documentation for symbols
- Get URLs to browse detailed HTML documentation
- Retrieve module and package information
- Find documentation for types, functions, and typeclasses
The server communicates via JSON-RPC over stdio following the Model Context Protocol specification.