Chatwerk provides AI tool integration for the QueryPackwerk gem. It adds a Model Context Protocol (MCP) server that allows AI tools like Cursor IDE to access information about your Packwerk packages, dependencies, and violations.
Note
This is an early prerelease version. We'll continue to update it as we develop. Contributions and feedback are welcome!
Install the gem, either add in to your packwerk'd application's Gemfile:
$ bundle add chatwerk
$ bundle installor install it on its own:
$ gem install chatwerkYou can test the inspector to see if it's working
$ chatwerk inspectTo use Chatwerk with Cursor:
-
In Cursor, open Settings > MCP
-
Add a new MCP connection as a command Name:
chatwerkCommand:chatwerk mcp -
Ask Cursor to check all the tools on packwerk. Give it an example pack name (partial strings work)
Once connected, you can ask Cursor questions about your Packwerk structure:
- "What are all the packages in this codebase?"
- "Tell me about the dependencies of package X"
- "What packages depend on package Y?"
- "Show me all the violations for package Z"
- "How difficult would it be to separate package X from its dependencies?"
- "What code patterns are used to access Constant on package Y?"
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests.
Run bin/inspect
Bug reports and pull requests are welcome on GitHub at https://github.com/rubyatscale/chatwerk.
The gem is available as open source under the terms of the MIT License.