Skip to content

0.6.0#19

Merged
Nek-12 merged 14 commits intomainfrom
release/0.6.0
Jan 31, 2026
Merged

0.6.0#19
Nek-12 merged 14 commits intomainfrom
release/0.6.0

Conversation

@Nek-12
Copy link
Member

@Nek-12 Nek-12 commented Jan 31, 2026

Release 0.6.0

Closes #18

Summary by CodeRabbit

  • New Features

    • MCP server support with a new CLI subcommand and configurable tools (search, cat, deps, fetch, resolve, where); added --tools flag.
    • Extended --lines input to accept multiple separators (comma, colon, dash, dot-dot, semicolon).
  • Bug Fixes

    • Empty files inside archives are now correctly discoverable.
  • Documentation

    • Added MCP guidance, CLI docs, release workflow, and a documented decision about tool output handling.
  • Tests

    • New unit and integration tests for MCP tooling and archive edge cases.
  • Chores

    • Bumped version to 0.6.0; added an issue auto-assign workflow and updated dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Warning

Rate limit exceeded

@Nek-12 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds an MCP (Model Context Protocol) server and toolset (search, cat, deps, fetch, resolve, where), CLI wiring (ksrc mcp), input schemas and handlers, many tests and helpers, docs and release workflow, a dependency update, version bump to 0.6.0, and an issues auto-assign GitHub Action.

Changes

Cohort / File(s) Summary
Version & Plugin
VERSION, .claude-plugin/plugin.json
Bump package/plugin version from 0.5.2 to 0.6.0.
MCP Core
internal/mcpserver/server.go, internal/mcpserver/tools.go, internal/mcpserver/helpers.go
Add MCP server entrypoint, ToolSet API (parsing/enabled checks), and small helpers for CSV/list/defaulting, diagnostics, and coord filtering.
MCP Handlers
internal/mcpserver/handlers.go
Implement tool handlers and JSON-schema inputs for search, cat, deps, fetch, resolve, where plus helper functions (jar lookup, ripgrep integration, standardized text/error responses).
MCP Tests & Integration
internal/mcpserver/tools_test.go, internal/mcpserver/integration_test.go, internal/mcpserver/handlers_empty_test.go
Unit tests for tool parsing, integration test exercising search→cat via MCP, and tests ensuring empty-file-in-jar handling.
CLI: command & wiring
internal/cli/mcp.go, internal/cli/root.go
Add ksrc mcp Cobra command with --tools flag and register it in root.
CLI: cat behavior & tests
internal/cli/cat.go, internal/cli/cat_empty_test.go
Allow empty inner files in jars (simplified existence check); extend --lines help to accept multiple formats; add test for empty-file-in-jar behavior.
Line Range Parsing
internal/cat/cat.go, internal/cat/cat_test.go
Introduce tolerant splitLineRange supporting , : - ; .. and table-driven tests including invalid cases.
MCP helpers & small utils
internal/mcpserver/..., internal/cli/... (test helpers)
Add zip/jar test helpers (writeZipFile), diagnostics and formatting helpers used across tests and handlers.
Docs & Release
README.md, AGENTS.md, docs/cli-api.md, docs/decisions.md, docs/release-workflow.md
Document MCP usage and ksrc mcp, update agent guidance, record decision on tool output typing, and add release workflow documentation.
Dependencies
go.mod
Add github.com/modelcontextprotocol/go-sdk v1.1.0 and related dependencies; reorganize require blocks.
CI
.github/workflows/auto-assign-issues.yml
Add GitHub Actions workflow to auto-assign newly opened/reopened issues.

Sequence Diagram

sequenceDiagram
    participant Client as MCP Client
    participant Server as ksrc MCP Server
    participant Handler as Tool Handler
    participant Resolver as Resolution Service
    participant Runner as Executor/Runner

    Client->>Server: Call tool (e.g., "search")
    Server->>Handler: Route request to handler
    Handler->>Resolver: Resolve sources (filters/coords)
    Resolver->>Runner: Execute resolution commands
    Runner-->>Resolver: Return resolved sources
    Resolver-->>Handler: Provide sources
    Handler->>Runner: Run tool ops (ripgrep, read jar, etc.)
    Runner-->>Handler: Return output
    Handler-->>Server: Format text/result or error
    Server-->>Client: Return tool result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested labels

autorelease

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '0.6.0' is extremely vague and does not describe the primary change; it only indicates a version bump without clarifying what features or functionality are included in this release. Use a descriptive title that summarizes the main feature, such as 'Add MCP server support for ksrc tools' or 'Expose ksrc tools via Model Context Protocol'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements MCP server support for ksrc tools as requested in issue #18, including a ready-to-use MCP server implementation, comprehensive tool handlers, documentation, and integration tests.
Out of Scope Changes check ✅ Passed All changes are directly related to the PR objectives: MCP server implementation, version bump, documentation updates, and dependency additions for MCP protocol support. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/0.6.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f82d99fbdf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In @.github/workflows/auto-assign-issues.yml:
- Around line 14-18: The workflow currently references the action with a mutable
tag ("uses: pozil/auto-assign-issue@v2"), which should be pinned to a specific
commit SHA to avoid supply-chain risk; replace the tag with the full commit SHA
for pozil/auto-assign-issue (e.g., "uses: pozil/auto-assign-issue@<commit-sha>")
and keep the existing inputs (repo-token and assignees: Nek-12) unchanged—obtain
the SHA from the action repo's commit history and update the uses line
accordingly.

In `@go.mod`:
- Around line 5-15: Update the two outdated module requirements in go.mod:
replace golang.org/x/oauth2 v0.30.0 and github.com/yosida95/uritemplate/v3
v3.0.2 with their current stable releases (e.g., oauth2 v0.34.0 and the latest
uritemplate v3.x), then run module resolution to verify compatibility and update
the lockfile (ensure this change is reflected in the require block referencing
those module paths).

In `@internal/cat/cat.go`:
- Around line 40-43: The splitLineRange function currently uses
strings.NewReplacer which blindly removes "-" and can strip negative signs;
replace this with regex-based parsing in splitLineRange that extracts signed
integers (e.g., using a pattern like -?\d+) or matches an explicit two-number
range pattern (e.g., optional sign + digits, separator, optional sign + digits).
Validate that exactly two numeric tokens are found and return them; do not
globally replace separators so negative signs remain intact. Use the function
name splitLineRange to locate and update the implementation accordingly.

In `@internal/mcpserver/handlers.go`:
- Line 535: The error string in the return statement mistakenly includes
coord.String() twice and contains a backtick typo; update the fmt.Errorf call in
internal/mcpserver/handlers.go so the coordinate is included only once (remove
the duplicate %s/coord.String()) and change `` `fetch() `` to `` `fetch` `` in
the message, ensuring the final format string and single coord.String() argument
match.
- Around line 389-423: The file-id branch that handles resolve.ParseFileID
currently calls service.ResolveSources but never emits diagnostics; after
calling service.ResolveSources (in the block handling arg containing "!/")
invoke emitDiagnostics(result.Meta, s.verbose) immediately after the
ResolveSources return (and before checking len(result.Sources) or calling
findJarByCoord) so verbose diagnostics are produced consistently with the
coordinate and path-lookup branches.
🧹 Nitpick comments (2)
internal/cli/mcp.go (1)

13-27: Prefer cmd.Context() and disallow extra args.

Using cmd.Context() preserves cancellation signals, and cobra.NoArgs prevents silent acceptance of unexpected args.

♻️ Proposed change
 	cmd := &cobra.Command{
 		Use:   "mcp",
 		Short: "Run MCP server over stdio",
+		Args:  cobra.NoArgs,
 		RunE: func(cmd *cobra.Command, args []string) error {
+			ctx := cmd.Context()
+			if ctx == nil {
+				ctx = context.Background()
+			}
 			set, err := mcpserver.ParseTools(tools)
 			if err != nil {
 				return err
 			}
-			return mcpserver.Run(context.Background(), mcpserver.Options{
+			return mcpserver.Run(ctx, mcpserver.Options{
 				Runner:  app.Runner,
 				Verbose: app.Verbose,
 				Tools:   set,
 				Version: versionString(),
 			})
 		},
 	}
internal/mcpserver/handlers.go (1)

69-71: Consider removing the identity function or documenting its purpose.

toolName currently returns its input unchanged. If this is a placeholder for future namespacing/prefixing, consider adding a comment. Otherwise, it can be inlined at call sites.

Nek-12 and others added 3 commits January 31, 2026 19:14
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@internal/mcpserver/handlers.go`:
- Around line 250-257: The handleCat flow omits emitting diagnostics after
resolving sources; after calling Service.ResolveSources (variable result) add a
call to emitDiagnostics(result.Meta, s.verbose) (as done in other handlers)
immediately after the error check and before checking result.Sources (i.e.,
before the existing len(result.Sources) == 0 branch) so verbose diagnostics are
emitted for cat operations.
🧹 Nitpick comments (1)
internal/mcpserver/handlers.go (1)

69-71: Consider removing the identity function or adding a comment.

toolName currently returns its input unchanged. If this is a placeholder for future namespacing (e.g., prefixing with ksrc_), consider adding a comment explaining the intent. Otherwise, it can be removed and tool names used directly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@internal/mcpserver/handlers.go`:
- Around line 515-523: In decodeInput[T any], guard against a nil Params pointer
before dereferencing it: update the early-return condition in the decodeInput
function to check req.Params is not nil (i.e., ensure you check req == nil ||
req.Params == nil || req.Params.Arguments == nil) so you don't access
req.Params.Arguments when Params is nil; this prevents a potential panic during
json.Unmarshal handling.

@Nek-12 Nek-12 merged commit c12d802 into main Jan 31, 2026
5 checks passed
@Nek-12 Nek-12 deleted the release/0.6.0 branch January 31, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose ksrc tools as an MCP

1 participant