RO

rokasklive/opengrok-go-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 4 forks 质量 79 趋势 22Apache-2.0

opengrok MCP but in Go

概览

I have seen things you people wouldn’t grep. — Senior Architect, probably. Agent-oriented MCP server for searching, navigating, and reading code through OpenGrok. It turns OpenGrok into a safer code-intelligence surface for LLM agents: - capability-gated tools that only appear when the backing OpenGrok feature works - paginated search and file reads with stable cursors - citation URLs on code results so answers can point back to source - warnings for broad, heuristic, truncated, or best-effort results (warnings[] codes plus a legacy warning string) - automatic context expansion around search hits with explicit limits - full, compact, and experimental gateway tool surfaces for different agent styles If you are an AI agent reading this repository, start with AGENTS.md for project constraints and agent workflow guidance. this MCP server is still evolving. Some tools, responses, and configuration paths may be broken or change before a stable 1.0 release.

README

以下为原文 README 节选,完整内容请查看原文。


Agent-oriented MCP server for searching, navigating, and reading code through OpenGrok.

It turns OpenGrok into a safer code-intelligence surface for LLM agents:

  • capability-gated tools that only appear when the backing OpenGrok feature works
  • paginated search and file reads with stable cursors
  • citation URLs on code results so answers can point back to source
  • warnings for broad, heuristic, truncated, or best-effort results (warnings[] codes plus a legacy warning string)
  • automatic context expansion around search hits with explicit limits
  • full, compact, and experimental gateway tool surfaces for different agent styles

If you are an AI agent reading this repository, start with AGENTS.md for project constraints and agent workflow guidance.

Pre-1.0 note: this MCP server is still evolving. Some tools, responses, and configuration paths may be broken or change before a stable 1.0 release. Please report issues using docs/reporting-issues.md.

When To Use It

Use opengrok-go-mcp when you want an agent to investigate a large indexed codebase without cloning it locally. It works best for finding symbols, reading files, tracing references, narrowing broad searches, and producing answers with source citations.

It is intentionally honest about OpenGrok’s limits. OpenGrok provides full-text search plus ctags definitions, not a full semantic call graph or AST engine. For structural questions, use this server to find the right files and symbols, then verify relationships with language-aware tools when needed.

Client Setup

Required: OPENGROK_MCP_BASE_URL — OpenGrok API base URL ending in /api/v1. On startup the server discovers projects, probes capabilities, and registers only tools that work. A typical reverse-proxied instance needs nothing else.

Copy a block below, replace the URL, restart the client.

The server defaults to OPENGROK_MCP_AGENT_PROFILE=economy (lean payloads, no auto context expansion). Set OPENGROK_MCP_AGENT_PROFILE=rich when you want expanded

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "opengrok": { "command": "/path/to/opengrok-go-mcp", "env": { "OPENGROK_MCP_BASE_URL": "https://your-opengrok-host/source/api/v1" } } } }