feat(serve): optional project_path for multi-project MCP serving#1594
Closed
joanfgarcia wants to merge 1 commit into
Closed
feat(serve): optional project_path for multi-project MCP serving#1594joanfgarcia wants to merge 1 commit into
joanfgarcia wants to merge 1 commit into
Conversation
Add an optional project_path to every MCP tool so one server process can answer against many projects. Omitted -> the server's default graph (fully backward-compatible); an absolute project_path -> that project's <GRAPHIFY_OUT>/graph.json, routed per call. Implementation (all in _build_server): - _ctx_cache + _load_ctx(): per-graph context cache with mtime+size hot-reload, unified across the default graph and every project graph. Unlike _load_graph it raises instead of sys.exit on a bad file. - _resolve_graph_path()/_select_graph(): map project_path to a graph.json and rebind G/communities/active_graph_path per call. No hot-path lock: select+handler run in one synchronous span of the call_tool coroutine. - Tolerant startup: serve with no default graph (pure multi-project mode) instead of exiting; a bad project_path is a tool error, not a crash. - project_path injected as an optional (non-required) field on all tools. Tests: 3 new HTTP-transport tests (optional-on-every-tool, routing, bad-path-no-crash). Full serve suite green (91 passed).
Collaborator
|
Merged into |
safishamsi
added a commit
that referenced
this pull request
Jul 2, 2026
Two 0.9.4 regressions (CLI cross-file indirect_call, stale community labels on re-cluster), the case-folding god-node fix (#1581), ~15 language extractor fixes (Ruby/Groovy/Elixir/Fortran/Rust/Julia/SystemVerilog/Scala/PowerShell/ ObjC/PHP/C#/C++/Swift), merge-graphs mixed-type handling (#1606), Swift singleton-into-local resolution (#1604), Homebrew python@ shebang (#1586), hooks foreground-stall perf (#1601), serve query stopwords (#1597) and multi-project MCP serving (#1594), plus JSON-loading hardening, dedup collision warning, and Windows hook worker limit. Built wheel validated in a clean venv: CLI reports 0.9.5, import resolves to the installed package, the case-folding and Swift-singleton fixes verified, and a real `graphify extract` produces indirect_call + inherits edges end-to-end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 an optional project_path to every MCP tool so one server process can answer against many projects. Omitted -> the server's default graph (fully backward-compatible); an absolute project_path -> that project's <GRAPHIFY_OUT>/graph.json, routed per call.
Implementation (all in _build_server):
Tests: 3 new HTTP-transport tests (optional-on-every-tool, routing, bad-path-no-crash). Full serve suite green (91 passed).