Merge/read source mcp tool#1842
Open
kevinoldching wants to merge 2 commits into
Open
Conversation
added 2 commits
July 10, 2026 16:50
…red server The shared HTTP MCP server exposed only the graph.json index — graph queries returned a source_file + source_location pointer but no file content, so clients had to fall back to a local checkout. read_source makes a single shared deployment serve both query and read-original. - read_source tool: node label (resolves source_file + source_location, context window) or repo-relative file + optional start/end range. - Core logic in module-level _read_source_slice (unit-testable without mcp). - New --source-root flag (env GRAPHIFY_SOURCE_ROOT) anchors repo-relative source_file paths for containerised deployments. - Security (F-010): reject absolute paths; enforce resolve() containment; sanitize_label every line; hard cap 500 lines / 64 KiB. - 10 new tests in tests/test_serve.py.
Resolved conflicts between v8's multi-project context cache (_ctx_cache) and feat branch's _source_root inference. Both features are preserved: - v8's per-graph context cache and hot-reload infrastructure - feat's read_source tool with source_root inference and path traversal protection All 90 tests pass including 10 read_source-specific tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add read_source MCP tool to read original source via shared server.