stimulus-lsp
stimulus-lsp copied to clipboard
Stimulus MCP Server
This pull request introduces a new project, stimulus-mcp-server, which is a basic MCP server implementation for Stimulus.
Currently, it bootstraps a few MCP tools for asking Stimulus-related questions about your application:
-
check-stimulus-usage- Checks if a given app uses Stimulus.js -
get-javascript-bundling-approach- Checks what kind of JavaScript bundling a Ruby on Rails application is using. -
get-stimulus-application-file-path- Get the path of the Stimulus application file -
get-stimulus-application-file-content- Get the content of the Stimulus application file -
get-stimulus-controller-index-file-path- Get the path of the Stimulus controller index file -
get-stimulus-controller-file-content- Get the content of a Stimulus controller file -
get-stimulus-controller-file-path- Get the path of a Stimulus controller file -
get-stimulus-controller-target-names- Get the Stimulus target names of a Stimulus controller -
get-stimulus-controller-action-names- Get the Stimulus action names of a Stimulus controller -
get-stimulus-controller-value-names- Get the Stimulus value names and types of a Stimulus controller -
get-stimulus-controller-classes- Get the Stimulus classes of a Stimulus controller -
get-stimulus-controller-possible-html-attributes- Get all possible and valid HTML attributes of a Stimulus controller -
stimulus-controller-example-usage-documentation- Get the example usage documentation of a Stimulus controller -
check-if-stimulus-controller-exists- Check if a Stimulus controller exists -
check-if-stimulus-controller-is-registered-on-stimulus-application- Check if a Stimulus controller is registered on a Stimulus application -
create-stimulus-controller- Create a new Stimulus controller -
register-stimulus-controller-on-stimulus-application- Register a Stimulus controller on a Stimulus application -
get-stimulus-controller-identifiers- Get a list of valid controller identifiers in an app/project that uses Stimulus
Setup
git clone https://github.com/marcoroth/stimulus-lsp
cd stimulus-lsp/mcp-server
yarn install
yarn build
realpath dist/index.js # use this path for the `args` below
Setting it up with Claude Desktop
Update ~/Library/Application\ Support/Claude/claude_desktop_config.json using the output from the realpath dist/index.js from above:
{
"mcpServers": {
"stimulus": {
"command": "node",
"args": [
"/path/to/stimulus-lsp/mcp-server/dist/index.js"
]
}
}
}
Setting it up with Cursor:
Update ~/.cursor/mcp.json using the output from the realpath dist/index.js from above:
{
"mcpServers": {
"stimulus": {
"command": "node",
"args": [
"/path/to/stimulus-lsp/mcp-server/dist/index.js"
]
}
}
}