MCP-T13 + T14: cgraph init-agent + Docker dual-mode#683
Draft
DvirDukhan wants to merge 2 commits into
Draft
Conversation
T13 — agent guidance bundle:
- Add `api/mcp/templates/` shipped as package data (claude_mcp_section.md,
cursorrules.template) with the canonical 8-tool MCP guidance.
- Add `cgraph init-agent [--force]` Typer command that drops
CLAUDE.md and .cursorrules into CWD.
- Update AGENTS.md with the MCP tool table and env-var reference.
T14 — packaging / image dual-mode:
- `start.sh` dispatches on `CGRAPH_MODE` env var (web|mcp). Default
(web) preserves the existing FastAPI behaviour; mcp execs cgraph-mcp.
- `docker-compose.yml` gains an opt-in `code-graph-mcp` service under
the `mcp` profile for stdio attach.
- README quickstart section for both `claude mcp add-json` registration
and Docker compose profile usage.
Tests: 4 new (CliRunner against tmp_path); MCP suite green at 61 passed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Added scripts/mcp_smoke.py — drives cgraph-mcp over real stdio (mcp
SDK ClientSession + StdioServerParameters) and exercises tool
listing, index_repo, search_code, get_callers, impact_analysis.
Findings folded back into claude_mcp_section.md:
- index_repo takes path_or_url (not path) and derives project name
from the folder/URL — agents must read it back from the response.
- Collection-returning tools land their array in
structuredContent.result, not under a {results: [...]} wrapper.
Smoke result on api/ subgraph: 8 tools listed, 6324 nodes / 6228
edges indexed, all calls returned expected payloads.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
MCP-T13 + T14 — agent guidance bundle & Docker dual-mode
Stacked on #682 (T12 auto-init). Closes #661 and #662.
T13 —
cgraph init-agentTwo canonical guidance files now ship as package data under
api/mcp/templates/:claude_mcp_section.md— full 8-tool table + rules of thumb(start with
search_code; prefer structural tools overask;run
impact_analysisbefore refactoring).cursorrules.template— Cursor-flavoured tool-selection rules.New Typer command drops them into the current directory:
AGENTS.mdupdated with the MCP section pointing at this command andthe supported env vars (
CODE_GRAPH_AUTO_INDEX,CGRAPH_MODE).T14 — Dockerised dual-mode
Same image now runs either the FastAPI web app or the MCP stdio
server based on
CGRAPH_MODE:start.shdispatches onCGRAPH_MODE=web|mcp.docker-compose.ymlgains an opt-in
code-graph-mcpservice guarded by themcpprofile (no impact on the default
up). README quickstart coversboth
claude mcp add-jsonand the Docker path.Tests
tests/mcp/test_init_agent.py(write,refuse-overwrite, force-overwrite, package-data sanity).
bash -n start.shclean.Followups
non-trivial and out of scope for this PR.