- Implement `grokkit mcp` command to run as MCP server over stdio - Export analysis, docs, and testgen functions for MCP tools - Add tools: lint_code, analyze_code, generate_docs, generate_tests, generate_commit_msg, run_recipe - Register resources: recipes://local, recipes://global, prompts://language - Update README and add user guide for MCP - Add MCP config options and dependencies
2.0 KiB
MCP Server Mode (grokkit mcp)
Grokkit can run as an MCP (Model Context Protocol) server, allowing AI coding agents like Claude Code, Cursor, or other MCP-compatible clients to call Grokkit tools directly during their workflows.
What is MCP?
MCP is a protocol that lets LLMs call external tools and access resources in a standardized way. By running grokkit mcp, you turn Grokkit into a service that other AI tools can use.
Starting the MCP Server
grokkit mcp
This starts the server over stdio (standard input/output), which is the default transport used by Claude Code and most MCP clients.
The server will run until the client disconnects.
Available Tools
When running in MCP mode, the following tools are available:
lint_code— Run linter on a file and return resultsanalyze_code— Deep project analysis with educational reportgenerate_docs— Generate documentation comments for a source filegenerate_tests— Generate unit tests for supported languagesgenerate_commit_msg— Generate conventional commit message from staged changesrun_recipe— Execute a named recipe from.grokkit/recipes/
Configuration
You can control MCP behavior in your config file (~/.config/grokkit/config.toml or ./config.toml):
[mcp]
enabled = true
tools = ["lint_code", "analyze_code", "generate_docs"]
resources = ["recipes://local", "prompts://language"]
Example Usage with Claude Code
Once grokkit mcp is running, you can tell Claude Code:
"Use the grokkit MCP server to lint this file and then generate tests for it."
Claude can then call the tools directly.
Resources
MCP also exposes resources:
recipes://local— List of local recipesrecipes://global— List of global recipesprompts://language— Available language prompts
See also:
- Developer Guide for technical details
- Main README for installation