Conversation
Wires the CodeGraph MCP server into Pi via its mcp.json: - global: <agent-dir>/mcp.json + <agent-dir>/AGENTS.md - local: <cwd>/.pi/mcp.json + <cwd>/AGENTS.md <agent-dir> defaults to ~/.pi/agent and is overridable via PI_CODING_AGENT_DIR, mirroring how Pi itself resolves it. Sets exposure: "direct" on the MCP entry so codegraph_explore is declared as a native tool instead of being hidden behind Pi's default codemode exposure.
roymina
force-pushed
the
feat/pi-agent-target
branch
from
September 30, 2026 02:32
37ac40f to
ac9ec7c
Compare
This branch has not been deployed
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.
Adds Pi (
@earendil-works/pi-coding-agent) as an installer target, socodegraph install --target=piwires the CodeGraph MCP server into Pi the same way the existing targets do.~/.pi/agent/mcp.json<cwd>/.pi/mcp.json~/.pi/agent/AGENTS.md<cwd>/AGENTS.mdThe agent directory is resolved the way Pi resolves it —
PI_CODING_AGENT_DIRwhen set, otherwise~/.pi/agent— so the install can't silently write to a directory Pi never reads.Why
exposure: "direct"Pi defaults every MCP server to
codemode, where the server's tools are callable from codemode scripts but are not declared to the model. The CodeGraph guidance tells the agent to callcodegraph_exploreby name, so the entry sets"exposure": "direct"to put it on the native tool list. CodeGraph exposes a single tool by default, so there's no tool-list bloat to trade off (codemode stays available as a fallback).Changes
src/installer/targets/pi.ts— the new targetsrc/installer/targets/registry.ts,src/installer/targets/types.ts— registerpisrc/bin/codegraph.ts,src/installer/index.ts— help/header text__tests__/installer-targets.test.ts— 6 Pi tests (global/local install, idempotent re-run, sibling-server preservation, uninstall round-trip,PI_CODING_AGENT_DIRoverride); the parameterized contract suite covers Pi automatically once it's inALL_TARGETSREADME.md,CHANGELOG.mdTesting
npx tsc— cleannpx vitest run __tests__/installer-targets.test.ts— 265 passed, 10 skippedcodegraph install --target=pi --location=global --yespreserved the three pre-existing servers in~/.pi/agent/mcp.json, wrote theAGENTS.mdblock, and a re-run reportedUnchanged;codegraph uninstall --target=pi --keep-clireversed it cleanly.pi mcp list→codegraph: connected, 1 tool (direct, global)→codegraph_explore.initialize+tools/listagainstcodegraph serve --mcp) returnsserverInfo codegraph 1.6.1andtools: ["codegraph_explore"].Happy to adjust the naming, the file layout, or the
exposurechoice.