analyze_git_diffLABSCO SUMMARY
A different model reviewing the same code, with Ollama as the no-key option.
Four providers with per-provider tuning means you can run security reviews on a hosted model and keep everything else on a local Ollama instance where no code leaves the machine. The analyze_uncommitted_work tool is the one with the clearest daily use: it reads the working tree, tells you whether the change is ready, and proposes how to split it.
What it is
An MCP server that reviews code using a different model from the one you are talking to. Point it at a diff, a commit SHA or the working tree and it sends the content to a provider you configured — OpenAI, Google, Mistral, or Ollama running locally — and returns the analysis. The premise is disagreement: a second opinion from another model is worth more than the same model checking itself.
What you get
- A git diff read and explained, optionally summarised, with the provider and model overridable per call —
analyze_git_diff - A code review focused on
security,performance,styleorall, with temperature tuned per focus — 0.1 for security reviews, 0.2 for general review —review_code - A commit assessed for message quality and adherence to practice, defaulting to HEAD —
analyze_commit - Uncommitted work analysed before you commit: what changed, whether it is coherent, suggested commit messages, and whether it should be split — with
staged_onlyto look at just the index —analyze_uncommitted_work - Repository facts with no model call at all —
get_repo_info - Token budget scaled to the input rather than fixed: 4096 for diffs under 5KB up to 32768 for diffs over 500KB, with automatic chunking past 10MB or 1000 files
Requirements
Go 1.20 or higher and git; build with go build -o bin/second-opinion and point your client at the binary. Configuration is a ~/.second-opinion.json in your home directory, which takes precedence, or environment variables — DEFAULT_PROVIDER plus the key for whichever you chose (OPENAI_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEY), or OLLAMA_ENDPOINT for a local model that needs no key. Repository paths are validated and restricted to the current working directory and below, commit SHAs are validated before use, and every provider call has a 30-second timeout.
Setup effort
Build from source — git clone https://github.com/dshills/second-opinion.git && cd second-opinion
USE CASES
Deciding whether your working tree is ready to commit
Have the whole uncommitted change summarised — files touched, what kind of change it is, whether it is complete — plus a suggested message and advice on splitting.
Getting a security-focused read on a piece of code
Review with the security focus, which runs at the lowest temperature for precision, rather than a general pass that mentions everything equally.
Understanding a commit someone else wrote
Analyse the commit by SHA to get the message quality, the diff explanation and the practice notes together.
Reviewing without sending code to a vendor
Set the provider to Ollama with a local endpoint and no API key, and the analysis stays on your machine.
Orienting in an unfamiliar repository
Pull repository information with no model call and no token cost before deciding what is worth reviewing.
5 tools
Listed in project docs. Your client may show a different list.
review_codeanalyze_commitanalyze_uncommitted_workget_repo_infoBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- Go 1.20 or later
- One provider configured: OPENAI_API_KEY, GOOGLE_API_KEY or MISTRAL_API_KEY — or a local Ollama server, which needs no key
Where it runs
Both documented setups run the server on your machine.
INSTALLATION
Connect your client
You clone and build this one yourself.
Server setup
Prerequisites: Go 1.20 or higher and Git
git clone https://github.com/dshills/second-opinion.git && cd second-opinion
go mod tidy
go build -o bin/second-opinionConfigure credentials by ONE of two methods (JSON takes priority): create ~/.second-opinion.json with a default_provider and per-provider api_key/model blocks, OR cp .env.example .env and add the provider keys
Edit Claude Desktop's config file for your OS (macOS ~/Library/Application Support/Claude/claude_desktop_config.json, Windows %APPDATA%\Claude\claude_desktop_config.json, Linux ~/.config/Claude/claude_desktop_config.json) and add the mcpServers block pointing at bin/second-opinion
Restart Claude Desktop for the changes to take effect
Verify: "second-opinion" appears in the MCP servers list
MCP Clients
Claude Desktop
{
"mcpServers": {
"second-opinion": {
"command": "<YOUR_PATH_TO_SECOND_OPINION>/bin/second-opinion"
}
}
}The plain Claude Desktop block sets no provider and no key: the server reads DEFAULT_PROVIDER and the provider API keys from ~/.second-opinion.json or the .env file in the credentials step. The OpenAI block sets them in env instead; to use Google, Mistral or Ollama that way, change DEFAULT_PROVIDER and the key and model variables to match.
Claude Desktop — OpenAI API Key
{
"mcpServers": {
"second-opinion": {
"command": "<YOUR_PATH_TO_SECOND_OPINION>/bin/second-opinion",
"env": {
"DEFAULT_PROVIDER": "openai",
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>",
"OPENAI_MODEL": "gpt-5-mini",
"LLM_TEMPERATURE": "0.3",
"LLM_MAX_TOKENS": "4096"
}
}
}
}The plain Claude Desktop block sets no provider and no key: the server reads DEFAULT_PROVIDER and the provider API keys from ~/.second-opinion.json or the .env file in the credentials step. The OpenAI block sets them in env instead; to use Google, Mistral or Ollama that way, change DEFAULT_PROVIDER and the key and model variables to match.