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/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "purescript-mcp-tools",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A Model Context Protocol (MCP) server providing PureScript development tools for AI assistants",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"purescript-mcp-tools": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node index.js",
|
|
11
|
+
"test": "cd purescript-test-examples && spago build && cd .. && node run_tests.js",
|
|
12
|
+
"prepublishOnly": "npm test"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"mcp",
|
|
16
|
+
"model-context-protocol",
|
|
17
|
+
"purescript",
|
|
18
|
+
"language-server",
|
|
19
|
+
"ide",
|
|
20
|
+
"ai-tools",
|
|
21
|
+
"claude",
|
|
22
|
+
"llm",
|
|
23
|
+
"code-analysis",
|
|
24
|
+
"developer-tools",
|
|
25
|
+
"mcp-server",
|
|
26
|
+
"ai-assistant"
|
|
27
|
+
],
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "Avinash Verma",
|
|
30
|
+
"url": "https://github.com/avi892nash"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/avi892nash/purescript-mcp-tools.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/avi892nash/purescript-mcp-tools/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/avi892nash/purescript-mcp-tools#readme",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=14.0.0"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"index.js",
|
|
46
|
+
"run_tests.js",
|
|
47
|
+
"tree-sitter-purescript.wasm",
|
|
48
|
+
"purescript-test-examples",
|
|
49
|
+
"README.md",
|
|
50
|
+
"LICENSE"
|
|
51
|
+
],
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"chalk": "^4.1.2",
|
|
54
|
+
"purescript": "^0.15.15",
|
|
55
|
+
"spago": "^0.21.0",
|
|
56
|
+
"web-tree-sitter": "^0.25.5"
|
|
57
|
+
},
|
|
58
|
+
"preferGlobal": true,
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{-
|
|
2
|
+
Welcome to your new Dhall package-set!
|
|
3
|
+
|
|
4
|
+
Below are instructions for how to edit this file for most use
|
|
5
|
+
cases, so that you don't need to know Dhall to use it.
|
|
6
|
+
|
|
7
|
+
## Use Cases
|
|
8
|
+
|
|
9
|
+
Most will want to do one or both of these options:
|
|
10
|
+
1. Override/Patch a package's dependency
|
|
11
|
+
2. Add a package not already in the default package set
|
|
12
|
+
|
|
13
|
+
This file will continue to work whether you use one or both options.
|
|
14
|
+
Instructions for each option are explained below.
|
|
15
|
+
|
|
16
|
+
### Overriding/Patching a package
|
|
17
|
+
|
|
18
|
+
Purpose:
|
|
19
|
+
- Change a package's dependency to a newer/older release than the
|
|
20
|
+
default package set's release
|
|
21
|
+
- Use your own modified version of some dependency that may
|
|
22
|
+
include new API, changed API, removed API by
|
|
23
|
+
using your custom git repo of the library rather than
|
|
24
|
+
the package set's repo
|
|
25
|
+
|
|
26
|
+
Syntax:
|
|
27
|
+
where `entityName` is one of the following:
|
|
28
|
+
- dependencies
|
|
29
|
+
- repo
|
|
30
|
+
- version
|
|
31
|
+
-------------------------------
|
|
32
|
+
let upstream = --
|
|
33
|
+
in upstream
|
|
34
|
+
with packageName.entityName = "new value"
|
|
35
|
+
-------------------------------
|
|
36
|
+
|
|
37
|
+
Example:
|
|
38
|
+
-------------------------------
|
|
39
|
+
let upstream = --
|
|
40
|
+
in upstream
|
|
41
|
+
with halogen.version = "master"
|
|
42
|
+
with halogen.repo = "https://example.com/path/to/git/repo.git"
|
|
43
|
+
|
|
44
|
+
with halogen-vdom.version = "v4.0.0"
|
|
45
|
+
with halogen-vdom.dependencies = [ "extra-dependency" ] # halogen-vdom.dependencies
|
|
46
|
+
-------------------------------
|
|
47
|
+
|
|
48
|
+
### Additions
|
|
49
|
+
|
|
50
|
+
Purpose:
|
|
51
|
+
- Add packages that aren't already included in the default package set
|
|
52
|
+
|
|
53
|
+
Syntax:
|
|
54
|
+
where `<version>` is:
|
|
55
|
+
- a tag (i.e. "v4.0.0")
|
|
56
|
+
- a branch (i.e. "master")
|
|
57
|
+
- commit hash (i.e. "701f3e44aafb1a6459281714858fadf2c4c2a977")
|
|
58
|
+
-------------------------------
|
|
59
|
+
let upstream = --
|
|
60
|
+
in upstream
|
|
61
|
+
with new-package-name =
|
|
62
|
+
{ dependencies =
|
|
63
|
+
[ "dependency1"
|
|
64
|
+
, "dependency2"
|
|
65
|
+
]
|
|
66
|
+
, repo =
|
|
67
|
+
"https://example.com/path/to/git/repo.git"
|
|
68
|
+
, version =
|
|
69
|
+
"<version>"
|
|
70
|
+
}
|
|
71
|
+
-------------------------------
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
-------------------------------
|
|
75
|
+
let upstream = --
|
|
76
|
+
in upstream
|
|
77
|
+
with benchotron =
|
|
78
|
+
{ dependencies =
|
|
79
|
+
[ "arrays"
|
|
80
|
+
, "exists"
|
|
81
|
+
, "profunctor"
|
|
82
|
+
, "strings"
|
|
83
|
+
, "quickcheck"
|
|
84
|
+
, "lcg"
|
|
85
|
+
, "transformers"
|
|
86
|
+
, "foldable-traversable"
|
|
87
|
+
, "exceptions"
|
|
88
|
+
, "node-fs"
|
|
89
|
+
, "node-buffer"
|
|
90
|
+
, "node-readline"
|
|
91
|
+
, "datetime"
|
|
92
|
+
, "now"
|
|
93
|
+
]
|
|
94
|
+
, repo =
|
|
95
|
+
"https://github.com/hdgarrood/purescript-benchotron.git"
|
|
96
|
+
, version =
|
|
97
|
+
"v7.0.0"
|
|
98
|
+
}
|
|
99
|
+
-------------------------------
|
|
100
|
+
-}
|
|
101
|
+
let upstream =
|
|
102
|
+
https://github.com/purescript/package-sets/releases/download/psc-0.15.15-20250523/packages.dhall
|
|
103
|
+
sha256:1274f34a6328069aabf8a149e395c414d80999a73073330c436ba0739615c536
|
|
104
|
+
|
|
105
|
+
in upstream
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{-
|
|
2
|
+
Welcome to a Spago project!
|
|
3
|
+
You can edit this file as you like.
|
|
4
|
+
|
|
5
|
+
Need help? See the following resources:
|
|
6
|
+
- Spago documentation: https://github.com/purescript/spago
|
|
7
|
+
- Dhall language tour: https://docs.dhall-lang.org/tutorials/Language-Tour.html
|
|
8
|
+
|
|
9
|
+
When creating a new Spago project, you can use
|
|
10
|
+
`spago init --no-comments` or `spago init -C`
|
|
11
|
+
to generate this file without the comments in this block.
|
|
12
|
+
-}
|
|
13
|
+
{ name = "my-project"
|
|
14
|
+
, dependencies = [ "console", "effect", "prelude" ]
|
|
15
|
+
, packages = ./packages.dhall
|
|
16
|
+
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Main where
|
|
2
|
+
|
|
3
|
+
import Prelude
|
|
4
|
+
import Effect (Effect)
|
|
5
|
+
import Effect.Console (log)
|
|
6
|
+
import Utils (helperFunction, anotherUtil) -- Import from Utils
|
|
7
|
+
|
|
8
|
+
main :: Effect Unit
|
|
9
|
+
main = do
|
|
10
|
+
log "Hello from PureScript!"
|
|
11
|
+
log "This is a sample file for the purescript-mcp-server."
|
|
12
|
+
helperFunction "called from Main"
|
|
13
|
+
anotherUtil -- This will indirectly call log again via helperFunction
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Utils where
|
|
2
|
+
|
|
3
|
+
import Prelude
|
|
4
|
+
import Effect (Effect)
|
|
5
|
+
import Effect.Console (log)
|
|
6
|
+
-- Intentionally import something from Main if Main were to export a utility
|
|
7
|
+
-- For now, let's assume Main might export a helper or constant in a real scenario
|
|
8
|
+
-- import Main (appVersion) -- Example, will be commented out if Main.appVersion doesn't exist
|
|
9
|
+
|
|
10
|
+
helperFunction :: String -> Effect Unit
|
|
11
|
+
helperFunction msg = do
|
|
12
|
+
log $ "Helper says: " <> msg
|
|
13
|
+
-- log $ "App version: " <> Main.appVersion -- if Main.appVersion was available
|
|
14
|
+
|
|
15
|
+
anotherHelper :: Int -> String
|
|
16
|
+
anotherHelper x = "Number: " <> show x
|
|
17
|
+
|
|
18
|
+
-- This function will call a (hypothetical) function from Main
|
|
19
|
+
-- For testing, let's make Main.main call this, and this call a (new) function in Main
|
|
20
|
+
-- to create a small cycle or at least a deeper call chain.
|
|
21
|
+
-- For now, let's keep it simple: Utils.anotherUtil calls helperFunction.
|
|
22
|
+
anotherUtil :: Effect Unit
|
|
23
|
+
anotherUtil = helperFunction "called from anotherUtil"
|