Provides 40+ static code analysis tools for enterprise-scale Haskell codebases, including module analysis, function call graphs, type system relationships, typeclass analysis, import dependencies, and complexity metrics.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FDEP MCP Serveranalyze the call graph for the processPayment function in the Billing module"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FDEP MCP Server
A Static Code Analysis Model Context Protocol (MCP) server delivering 40+ comprehensive analysis tools for enterprise-scale Haskell codebases. Seamlessly integrates with MCP-compatible AI tools and clients to provide real-time code intelligence and architectural insights.
π MCP Protocol Compliant | ποΈ 40+ Analysis Tools | β‘ Real-time Queries
β¨ MCP Server Features
π 40+ Comprehensive Analysis Tools
Module Analysis: 7 tools for module structure and dependencies
Function Analysis: 8 tools for call graphs and complexity metrics
Type System: 6 tools for type relationships and usage patterns
Class Analysis: 3 tools for typeclass and instance analysis
Import Analysis: 4 tools for dependency visualization
Advanced Queries: 4 tools for complex JSON-based code queries
Pattern Analysis: 5 tools for code pattern detection
Source Location: 3 tools for location-based analysis
Enhanced Analysis: 3 tools for advanced structural analysis
π Quick Start
Prerequisites
Python 3.13+
UV package manager
PostgreSQL database (must be running)
FDEP output from Spider plugin (for comprehensive analysis)
Database Setup
Before installation, ensure PostgreSQL is running and create the required database:
# Start PostgreSQL (if not already running)
# On macOS with Homebrew:
brew services start postgresql
# On Ubuntu/Debian:
sudo systemctl start postgresql
# Create the database
createdb code_as_data # this should match with you $DB_NAME value in .env file (DEFAULT: code_as_data)Installation
# Clone the repository
git clone https://github.com/juspay/fdep-mcp-server.git
cd fdep_mcp
# Install globally with UV (recommended)
uv tool install .
# OR install globally with pipx
# pipx install .
# OR system-wide installation
# pip install .vi Database Setup and Data Import
Important: Complete this step before using the MCP server with any client.
fdep-mcp-server --setup --verboseThis command will:
Initialize the PostgreSQL database schema
Import and process your FDEP data (if FDEP_PATH is configured)
Set up all necessary indexes and relationships
Note: The first run takes time as it processes large FDEP datasets.
Configure Environment
cp .env.example .env
# Edit .env with your database settings and FDEP_PATHπ MCP Client Configuration
After installation, configure your preferred MCP client to connect to the FDEP server:
Claude Code
Add to your ~/.claude/settings.json:
{
"mcpServers": {
"fdepAnalyzer": {
"command": "fdep-mcp-server",
"args": [],
"env": {
"FDEP_PATH": "/path/to/your/fdep/output"
}
}
}
}Note: The first time running the server takes time as it imports and processes the FDEP data.
Cursor
Add to your Cursor settings (Cmd/Ctrl + , β Extensions β MCP):
{
"mcp.servers": {
"fdepAnalyzer": {
"command": "fdep-mcp-server",
"args": [],
"env": {
"FDEP_PATH": "/path/to/your/fdep/output",
"LOG_LEVEL": "INFO"
}
}
}
}Note: The first time running the server takes time as it imports and processes the FDEP data.
VS Code
Install the MCP extension and add to settings.json:
{
"mcp.servers": [
{
"name": "fdepAnalyzer",
"command": "fdep-mcp-server",
"args": [],
"env": {
"FDEP_PATH": "/path/to/your/fdep/output"
}
}
]
}Note: The first time running the server takes time as it imports and processes the FDEP data.
Cline
Add to your Cline configuration:
{
"mcpServers": {
"fdepAnalyzer": {
"command": "fdep-mcp-server",
"args": [],
"env": {
"FDEP_PATH": "/path/to/your/fdep/output"
}
}
}
}Note: The first time running the server takes time as it imports and processes the FDEP data.
Continue.dev
Add to your .continue/config.json:
{
"mcpServers": [
{
"name": "fdepAnalyzer",
"command": "fdep-mcp-server",
"args": [],
"env": {
"FDEP_PATH": "/path/to/your/fdep/output"
}
}
]
}Note: The first time running the server takes time as it imports and processes the FDEP data.
Generic MCP Client
For any MCP-compatible client:
{
"server_name": "fdepAnalyzer",
"command": "fdep-mcp-server",
"args": [],
"environment": {
"FDEP_PATH": "/path/to/your/fdep/output",
"DB_HOST": "localhost",
"DB_NAME": "code_as_data",
"LOG_LEVEL": "INFO"
}
}Note: The first time running the server takes time as it imports and processes the FDEP data.
Environment Variables for All Clients
# Required
FDEP_PATH=/path/to/your/fdep/output
# Database (if different from defaults)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=code_as_data
DB_USER=postgres
DB_PASSWORD=postgres
# Optional
LOG_LEVEL=INFO
DEV_MODE=falseVerify Connection
After configuring your client, verify the connection:
Start your MCP client
Look for "fdepAnalyzer" in available tools/servers
Test with a simple query:
list_modules(limit=5)You should see your Haskell modules listed
π οΈ MCP Tools Available (40+ Total)
π Module Analysis (7 tools)
Tool | Description |
| Setup database and import FDEP data |
| Get list of modules with filtering |
| Detailed module info with statistics |
| List all functions in a module |
| Pattern-based module search |
| Module dependency analysis |
| Comprehensive codebase statistics |
β‘ Function Analysis (8 tools)
Tool | Description |
| Detailed function information |
| Search functions by pattern |
| Find frequently called functions |
| Function call hierarchy |
| Who calls this function |
| What functions this calls |
| Function complexity metrics |
| Complete function context with dependencies |
ποΈ Type System Analysis (6 tools)
Tool | Description |
| Get types by module/pattern with categories |
| Type info with constructors/fields |
| Advanced type search with filtering |
| Type dependency analysis |
| Type usage patterns |
| Get nested type definitions |
π Class Analysis (3 tools)
Tool | Description |
| Get class definitions with filtering |
| Class info with instances |
| Pattern-based class search |
π¦ Import Analysis (4 tools)
Tool | Description |
| Import patterns and dependencies |
| Module import relationship graphs |
| Potential cleanup candidates |
| Comprehensive import information |
π Advanced Queries (4 tools)
Tool | Description |
| Basic SQL queries |
| JSON-based complex queries with joins |
| Custom SQL queries with parameters |
| Cross-module function usage |
π― Pattern Analysis (5 tools)
Tool | Description |
| Find functions similar to a given function |
| Find recurring code patterns |
| Group functions by similarity |
| Build comprehensive type dependency graph |
| Analyze deep type relationships |
π Source Location (3 tools)
Tool | Description |
| Find code elements by source location |
| Get context around a source location |
| Generate import statements for functions |
π¬ Enhanced Analysis (3 tools)
Tool | Description |
| Advanced pattern matching for code structures |
| Comprehensive dependency analysis |
| Enhanced call graphs with advanced options |
π Example Queries
Basic Analysis
# Search for validation functions
search_functions(pattern="validation", limit=10)
# Get details about main functions
get_function_details(function_name="main")
# Find most called functions
get_most_called_functions(limit=20)
# List modules in a specific area
list_modules(limit=50)Advanced Analysis
# Get function call hierarchy
get_function_call_graph(function_name="processData", depth=3)
# Analyze type dependencies
get_type_dependencies(type_name="User", include_dependents=true)
# Find cross-module function calls
find_cross_module_calls(source_module="Services", target_module="Database")
# Complex JSON query
execute_advanced_query({
"type": "function",
"conditions": [
{"field": "name", "operator": "like", "value": "%Handler%"}
],
"limit": 50
})Architectural Analysis
# Module dependency analysis
get_module_dependencies(module_name="Core.Services", include_dependents=true)
# Import relationship graph
get_import_graph(root_module="Main", depth=3)
# Complexity analysis
analyze_function_complexity(module_name="BusinessLogic", min_complexity=5)
# Comprehensive statistics
get_code_statistics(include_details=true)βοΈ Configuration
Environment Variables (.env)
# Database
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=code_as_data
# FDEP Data Source
FDEP_PATH=/path/to/your/fdep/output
# Logging
LOG_LEVEL=INFOSpider Plugin Integration
For Haskell projects using GHC 9.2.8:
Add Spider flake input
Configure cabal with fdep and fieldInspector plugins
Run socket server during build
Generate FDEP output for analysis
Tool Distribution
π Module Analysis: 7 tools
β‘ Function Analysis: 8 tools
ποΈ Type System: 6 tools
π Class Analysis: 3 tools
π¦ Import Analysis: 4 tools
π Advanced Queries: 4 tools
π― Pattern Analysis: 5 tools
π Source Location: 3 tools
π¬ Enhanced Analysis: 3 tools
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.