purescript-mcp-tools 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +160 -0
- package/index.js +1287 -0
- package/package.json +62 -0
- package/purescript-test-examples/packages.dhall +105 -0
- package/purescript-test-examples/spago.dhall +17 -0
- package/purescript-test-examples/src/Main.purs +13 -0
- package/purescript-test-examples/src/Utils.purs +23 -0
- package/purescript-test-examples/test/Main.purs +11 -0
- package/run_tests.js +677 -0
- package/tree-sitter-purescript.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Avinash Verma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# PureScript MCP Tools
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/purescript-mcp-tools)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
A Model Context Protocol (MCP) server that provides PureScript development tools for AI assistants like Claude.
|
|
7
|
+
|
|
8
|
+
<a href="https://glama.ai/mcp/servers/@avi892nash/purescript-mcp-tools">
|
|
9
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@avi892nash/purescript-mcp-tools/badge" alt="PureScript Server MCP server" />
|
|
10
|
+
</a>
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Code Analysis**: Parse and analyze PureScript code structure without heavy IDE setup
|
|
15
|
+
- **PureScript IDE Integration**: Start and manage PureScript IDE servers
|
|
16
|
+
- **Type Information**: Look up types and find code usages
|
|
17
|
+
- **Dependency Graphs**: Generate visual representations of module dependencies
|
|
18
|
+
- **AI-First**: Built specifically for AI assistants using the Model Context Protocol
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
### Via npm (Recommended)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g purescript-mcp-tools
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### From Source
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Clone this repository
|
|
32
|
+
git clone https://github.com/avi892nash/purescript-mcp-tools.git
|
|
33
|
+
cd purescript-mcp-tools
|
|
34
|
+
|
|
35
|
+
# Install dependencies
|
|
36
|
+
npm install
|
|
37
|
+
|
|
38
|
+
# Test that it works
|
|
39
|
+
npm test
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
### For Claude Desktop
|
|
45
|
+
|
|
46
|
+
1. Find your Claude config file:
|
|
47
|
+
- **Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
48
|
+
- **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
49
|
+
|
|
50
|
+
2. Add this server configuration:
|
|
51
|
+
|
|
52
|
+
**If installed via npm:**
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"purescript-tools": {
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["purescript-mcp-tools"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**If installed from source:**
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"purescript-tools": {
|
|
69
|
+
"command": "node",
|
|
70
|
+
"args": ["/FULL/PATH/TO/purescript-mcp-tools/index.js"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
3. Restart Claude Desktop.
|
|
77
|
+
|
|
78
|
+
### For Other MCP Clients
|
|
79
|
+
|
|
80
|
+
Configure as a stdio MCP server:
|
|
81
|
+
- **Command**: `npx` (or `node` if from source)
|
|
82
|
+
- **Arguments**: `["purescript-mcp-tools"]` (or `["/full/path/to/index.js"]` if from source)
|
|
83
|
+
- **Protocol**: stdio
|
|
84
|
+
|
|
85
|
+
## Usage
|
|
86
|
+
|
|
87
|
+
### Verify Installation
|
|
88
|
+
|
|
89
|
+
In your MCP client, try running:
|
|
90
|
+
```
|
|
91
|
+
get_server_status
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
You should see a response showing the server is running.
|
|
95
|
+
|
|
96
|
+
### Available Tools
|
|
97
|
+
|
|
98
|
+
This MCP server provides the following tools:
|
|
99
|
+
|
|
100
|
+
#### Static Analysis (No IDE Required)
|
|
101
|
+
- `getModuleName` - Extract module name from PureScript file
|
|
102
|
+
- `getImports` - List all imports from a module
|
|
103
|
+
- `getAllFunctionNames` - Get all function definitions
|
|
104
|
+
- `getExports` - List exported values
|
|
105
|
+
- `getFunctionSignature` - Get type signature for a function
|
|
106
|
+
- `getDependencyGraph` - Generate module dependency graph
|
|
107
|
+
|
|
108
|
+
#### PureScript IDE Integration
|
|
109
|
+
- `start_purs_ide_server` - Start a PureScript IDE server
|
|
110
|
+
- `stop_purs_ide_server` - Stop the IDE server
|
|
111
|
+
- `pursIdeLoad` - Load modules into IDE
|
|
112
|
+
- `pursIdeType` - Get type information
|
|
113
|
+
- `pursIdeComplete` - Get completion suggestions
|
|
114
|
+
- `pursIdeUsages` - Find where a symbol is used
|
|
115
|
+
- `pursIdeCaseSplit` - Generate case splits
|
|
116
|
+
- `pursIdeAddClause` - Add function clause
|
|
117
|
+
- `pursIdeImport` - Add imports
|
|
118
|
+
|
|
119
|
+
### Basic Workflow
|
|
120
|
+
|
|
121
|
+
1. **Check status**: `get_server_status`
|
|
122
|
+
2. **For simple analysis**: Use static analysis tools directly
|
|
123
|
+
3. **For advanced features**:
|
|
124
|
+
- `start_purs_ide_server` with your project path
|
|
125
|
+
- `pursIdeLoad` to load modules
|
|
126
|
+
- Use `pursIdeType`, `pursIdeUsages`, etc.
|
|
127
|
+
|
|
128
|
+
## Requirements
|
|
129
|
+
|
|
130
|
+
- **Node.js** >= 14.0.0
|
|
131
|
+
- **PureScript compiler** (`purs`) - Required only if using IDE features
|
|
132
|
+
- **Your PureScript project** - With compiled output for IDE features
|
|
133
|
+
|
|
134
|
+
## Troubleshooting
|
|
135
|
+
|
|
136
|
+
**Server won't start**: Check that Node.js is installed and dependencies are installed (`npm install`)
|
|
137
|
+
|
|
138
|
+
**Tools not working**: Run `get_server_status` to see what's available
|
|
139
|
+
|
|
140
|
+
**Path errors**: Ensure you use absolute paths in your MCP configuration
|
|
141
|
+
|
|
142
|
+
**Multiple servers**: Only run one PureScript IDE server at a time to avoid port conflicts
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
152
|
+
|
|
153
|
+
## Support
|
|
154
|
+
|
|
155
|
+
- **Issues**: [GitHub Issues](https://github.com/avi892nash/purescript-mcp-tools/issues)
|
|
156
|
+
- **Discussions**: [GitHub Discussions](https://github.com/avi892nash/purescript-mcp-tools/discussions)
|
|
157
|
+
|
|
158
|
+
## Acknowledgments
|
|
159
|
+
|
|
160
|
+
This server implements the [Model Context Protocol](https://modelcontextprotocol.io/) and provides comprehensive PureScript development assistance to AI tools.
|