Skip to content

Add MCP read parity file view#148

Merged
lzehrung merged 3 commits into
mainfrom
p1/read-parity-file-view
Jul 10, 2026
Merged

Add MCP read parity file view#148
lzehrung merged 3 commits into
mainfrom
p1/read-parity-file-view

Conversation

@lzehrung

@lzehrung lzehrung commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Expands MCP get_file to return schema-versioned, line-numbered file views with offset/limit pagination.
  • Keeps live bounded file bytes while adding optional direct graph context for indexed source files.
  • Documents the number<TAB>line format and MCP usage guidance.

Verification

  • rtk npx vitest run tests/mcp-server.test.ts
  • rtk npm run build
  • rtk npm run check

@lzehrung lzehrung marked this pull request as ready for review July 9, 2026 15:37
@lzehrung lzehrung requested a review from Copilot July 9, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the MCP get_file tool to return a schema-versioned, line-numbered file view with offset/limit pagination, while optionally attaching direct graph context (importers/imports/symbols) for indexed files. It also updates MCP documentation/skill guidance and adds tests covering the new response shape.

Changes:

  • Extend get_file tool schema with offset/limit (line pagination) and includeGraphContext, plus new default/max line limits.
  • Implement a schema-versioned get_file response that includes content in number<TAB>line format, pagination metadata, and optional graph context.
  • Update docs/skill guidance and reformat generated coverage markdown; add/adjust tests for the new get_file behavior.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/mcp-server.test.ts Adds/updates tests for line-numbered get_file output, pagination, and optional graph context.
src/mcp/tools.ts Extends the MCP tool schema for get_file and introduces file-line bounds constants.
src/mcp/server.ts Implements line pagination/formatting and optional graph context in the get_file handler and response type.
docs/mcp.md Documents the new get_file behavior, output format, and bounding controls.
docs/coverage/native.md Coverage markdown table formatting update (generated output).
docs/coverage/js.md Coverage markdown table formatting update (generated output).
codegraph-skill/codegraph/SKILL.md Updates skill guidance to include get_file usage and its output format/context fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mcp/server.ts
Comment thread src/mcp/server.ts Outdated
Comment thread src/mcp/server.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • src/mcp/server.ts
  • src/mcp/tools.ts
  • tests/mcp-server.test.ts
  • docs/mcp.md
  • codegraph-skill/codegraph/SKILL.md
  • docs/coverage/js.md
  • docs/coverage/native.md
Previous Review Summary (commit 98f27bd)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 98f27bd)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/mcp/server.ts 155 nextOffset can create an infinite pagination loop when file text is truncated by maxBytes
Files Reviewed (7 files)
  • src/mcp/server.ts - 1 issue
  • src/mcp/tools.ts - no issues
  • tests/mcp-server.test.ts - no issues
  • docs/mcp.md - no issues
  • codegraph-skill/codegraph/SKILL.md - no issues
  • docs/coverage/js.md - no issues
  • docs/coverage/native.md - no issues

Fix these issues in Kilo Cloud


Reviewed by kimi-k2.6 · Input: 265.1K · Output: 8.7K · Cached: 284.6K

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Comment thread src/mcp/server.ts Outdated
Comment thread src/mcp/server.ts Outdated
Comment thread docs/mcp.md Outdated
@lzehrung lzehrung force-pushed the p1/read-parity-file-view branch from 98f27bd to ecb0ca1 Compare July 10, 2026 06:27
@lzehrung lzehrung changed the base branch from p1/extension-mapping to main July 10, 2026 06:27
@lzehrung lzehrung requested a review from Copilot July 10, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@lzehrung lzehrung merged commit 4955811 into main Jul 10, 2026
2 checks passed
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.

2 participants