This MCP server provides AI assistants with comprehensive PureScript development tools for code analysis, type checking, and project management.
Lightweight Code Analysis (No IDE Server Required):
Extract module names, imports, and function names from PureScript code
Parse and filter top-level declarations (functions, data types, type classes) with detailed information
Analyze function structure including where-clause bindings
Quick code inspection without full IDE setup
IDE Server Management:
Start and stop PureScript IDE servers with automatic port selection and conflict prevention
Monitor server status and check running processes
Load modules to initialize the IDE server with project context
Reset server state or gracefully quit IDE processes
Advanced Development Features (Requires IDE Server):
Look up type signatures for identifiers
Find all usages of functions, types, or values across the project
Quickly rebuild individual modules and check for errors
Generate comprehensive dependency graphs showing relationships between modules, functions, and types
List available modules and browse project structure
Get completion information and verify working directory
Testing and Diagnostics:
Echo test to verify server connectivity
Status checks to monitor available features and running processes
Serves as the runtime environment for the MCP server, allowing it to provide PureScript development tools and IDE features.
Enables advanced code analysis features including starting/managing PureScript IDE servers, looking up types, finding code usages, generating dependency graphs, and parsing module structure (modules, imports, functions).
PureScript MCP Tools
A Model Context Protocol (MCP) server that provides PureScript development tools for AI assistants like Claude.
Features
Code Analysis: Parse and analyze PureScript code structure without heavy IDE setup
PureScript IDE Integration: Start and manage PureScript IDE servers
Type Information: Look up types and find code usages
Dependency Graphs: Generate visual representations of module dependencies
AI-First: Built specifically for AI assistants using the Model Context Protocol
Related MCP server: WithSeismic MCP
Installation
Via npm (Recommended)
From Source
Configuration
For Claude Desktop
Find your Claude config file:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
Add this server configuration:
If installed via npm:
If installed from source:
Restart Claude Desktop.
For Other MCP Clients
Configure as a stdio MCP server:
Command:
npx(ornodeif from source)Arguments:
["purescript-mcp-tools"](or["/full/path/to/index.js"]if from source)Protocol: stdio
Usage
Verify Installation
In your MCP client, try running:
You should see a response showing the server is running.
Available Tools
This MCP server provides the following tools:
Static Analysis (No IDE Required)
getModuleName- Extract module name from PureScript filegetImports- List all imports from a modulegetAllFunctionNames- Get all function definitionsgetExports- List exported valuesgetFunctionSignature- Get type signature for a functiongetDependencyGraph- Generate module dependency graph
PureScript IDE Integration
start_purs_ide_server- Start a PureScript IDE serverstop_purs_ide_server- Stop the IDE serverpursIdeLoad- Load modules into IDEpursIdeType- Get type informationpursIdeComplete- Get completion suggestionspursIdeUsages- Find where a symbol is usedpursIdeCaseSplit- Generate case splitspursIdeAddClause- Add function clausepursIdeImport- Add imports
Basic Workflow
Check status:
get_server_statusFor simple analysis: Use static analysis tools directly
For advanced features:
start_purs_ide_serverwith your project pathpursIdeLoadto load modulesUse
pursIdeType,pursIdeUsages, etc.
Requirements
Node.js >= 14.0.0
PureScript compiler (
purs) - Required only if using IDE featuresYour PureScript project - With compiled output for IDE features
Troubleshooting
Server won't start: Check that Node.js is installed and dependencies are installed (npm install)
Tools not working: Run get_server_status to see what's available
Path errors: Ensure you use absolute paths in your MCP configuration
Multiple servers: Only run one PureScript IDE server at a time to avoid port conflicts
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Acknowledgments
This server implements the Model Context Protocol and provides comprehensive PureScript development assistance to AI tools.