PureScript MCP Server
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).
Click on "Deploy 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., "@PureScript MCP Server get the type signature for the 'map' function in my current 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.
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: TypeScript Definition Finder
Installation
Via npm (Recommended)
npm install -g purescript-mcp-toolsFrom Source
# Clone this repository
git clone https://github.com/avi892nash/purescript-mcp-tools.git
cd purescript-mcp-tools
# Install dependencies
npm install
# Test that it works
npm testConfiguration
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:
{
"mcpServers": {
"purescript-tools": {
"command": "npx",
"args": ["purescript-mcp-tools"]
}
}
}If installed from source:
{
"mcpServers": {
"purescript-tools": {
"command": "node",
"args": ["/FULL/PATH/TO/purescript-mcp-tools/index.js"]
}
}
}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:
get_server_statusYou 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.
Available Tools
19 toolsechoA
Simple test tool that echoes back your input. Use to verify the MCP server is responding correctly.
Inputs: message (required).
generate_dependency_graphA
Create a dependency graph showing which functions/types use which others in PureScript modules. PREREQUISITES: IDE server must be running and modules must be loaded. Useful for understanding code relationships and refactoring impact.
Inputs: target_modules (required), max_concurrent_requests.
getFunctionNamesA
Extract only function names from PureScript code snippets. Focuses specifically on functions, ignoring data types and classes. Quick analysis for code understanding.
Inputs: code (required).
getImportsA
Find all import statements in PureScript code (like 'import Data.List', 'import Prelude'). Shows what external modules the code depends on. Works without the IDE server.
Inputs: code, filePath.
getModuleNameA
Extract the module name (like 'Data.List' or 'Main') from PureScript code. Works on files or code snippets without needing the IDE server. Useful for understanding code structure.
Inputs: code, filePath.
get_server_statusA
Check if IDE server processes are running to avoid resource conflicts. Shows status of Tree-sitter parser (lightweight code analysis) and purs IDE server (process for type checking). ALWAYS use this before starting new IDE servers to prevent running multiple processes simultaneously.
Inputs: no named parameters.
getTopLevelDeclarationNamesA
List all main definitions in PureScript code: function names, data types, type classes, etc. Gets just the names (like 'myFunction', 'MyDataType'). Fast analysis without needing IDE server.
Inputs: code, filePath.
getTopLevelDeclarationsA
Get detailed information about all main definitions in PureScript code: names, types (function/data/class), and full source code. Includes filtering options to find specific items. More comprehensive than getTopLevelDeclarationNames.
Inputs: code, filePath, filters.
getWhereBindingsB
Find 'where' clauses in PureScript functions. These contain local helper functions and variables. Useful for understanding function implementation details.
Inputs: code (required).
pursIdeCwdA
Get the current working directory that the IDE server is using. PREREQUISITE: IDE server must be running. Useful for understanding the project context.
Inputs: no named parameters.
pursIdeListB
List available modules in the project or imports in a specific file. PREREQUISITES: IDE server running and modules loaded. Helps understand project structure and dependencies.
Inputs: listType (required), file.
pursIdeLoadA
Load PureScript modules into the IDE server for type checking and completions. PREREQUISITE: IDE server must be running. ALWAYS run this first after starting the IDE server before using other pursIde* tools.
Inputs: modules.
pursIdeQuitA
Gracefully shut down the IDE server and free up resources. PREREQUISITE: IDE server must be running. Same effect as stop_purs_ide_server but uses the server's built-in quit command first.
Inputs: no named parameters.
pursIdeRebuildA
Quickly recompile a single PureScript module and check for errors. PREREQUISITES: IDE server running and modules loaded. Much faster than full project rebuild. Use when editing code to get immediate feedback.
Inputs: file (required), actualFile, codegen.
pursIdeResetA
Clear all loaded modules from the IDE server's memory. PREREQUISITE: IDE server must be running. Use when switching projects or after major code changes. You'll need to run pursIdeLoad again after this.
Inputs: no named parameters.
pursIdeTypeA
Look up the type signature of functions, variables, or values in PureScript code. PREREQUISITES: IDE server running and modules loaded. Helpful for understanding what a function expects and returns.
Inputs: search (required), currentModule, filters.
pursIdeUsagesA
Find everywhere a specific function, type, or value is used across the project. PREREQUISITES: IDE server running and modules loaded. Essential for refactoring - shows impact of changes. If you plan to refactor, get usages before refactoring so you can make changes to all places that function is used.
Inputs: identifier (required), module (required), namespace (required).
start_purs_ide_serverA
Start the PureScript IDE server for type checking, auto-completion, and error detection. Automatically stops any existing server to prevent conflicts. Only run one at a time. Required for all pursIde* tools to work. Automatically selects a random available port to avoid conflicts - the port number is returned in the response. Only accepts absolute paths.
Inputs: project_path (required), log_level, output_directory, source_globs.
stop_purs_ide_serverA
Stop the PureScript IDE server to free up system resources. Use when you're done with type checking or want to switch projects. All pursIde* tools will stop working after this.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools have distinct purposes, but there is some overlap between getTopLevelDeclarationNames and getTopLevelDeclarations, where the latter is a more detailed version of the former, which could cause confusion. Other tools like getFunctionNames and getTopLevelDeclarationNames also have overlapping scopes, but descriptions help clarify differences.
Naming is inconsistent with mixed conventions: snake_case (e.g., get_server_status, start_purs_ide_server), camelCase (e.g., getFunctionNames, pursIdeCwd), and verb_noun patterns vary (e.g., generate_dependency_graph vs. pursIdeList). This lack of a predictable pattern makes the tool set harder to navigate.
With 19 tools, the count is borderline high for a PureScript server, leaning towards heavy but not extreme. It covers both IDE server management and code analysis, which justifies some bulk, but it could be streamlined for better coherence.
The tool set provides comprehensive coverage for PureScript development, including IDE server lifecycle management (start, stop, status), code analysis (dependencies, imports, types, usages), and module operations (load, rebuild, reset). No obvious gaps exist for the stated domain.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA TypeScript implementation of a Model Context Protocol server that provides a frictionless framework for developers to build and deploy AI tools and prompts, focusing on developer experience with zero boilerplate and automatic tool registration.2,105 npm14MIT
- FlicenseBqualityDmaintenanceA Model Context Protocol server that helps AI code editors locate TypeScript symbol definitions in codebases, particularly useful for finding original definitions of imported symbols and classes.113 npm-
- FlicenseDqualityDmaintenanceA comprehensive Model Context Protocol server for advanced code analysis that provides tools for syntax analysis, dependency visualization, and AI-assisted development workflow support.287-
- AlicenseBqualityDmaintenanceA TypeScript-based Model Context Protocol server that enables AI assistants to perform secure database operations on PostgreSQL databases through structured tool interfaces.822 npmMIT