Skip to content

Add Pi coding agent as a supported MCP client - #6819

Merged
danbarr merged 1 commit into
mainfrom
add-pi-client
Oct 14, 2026
Merged

danbarr merged 1 commit into
mainfrom
add-pi-client

Conversation

@danbarr

@danbarr danbarr commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Pi has had built-in MCP support since 0.99.0. It reads servers from a standard mcpServers JSON file, so it fits ToolHive's existing client model without any new config logic. Users have been asking for it in #6735.

  • Adds a pi client that writes to ~/.pi/agent/mcp.json. thv client status detects Pi through the existing ~/.pi/agent directory check.
  • Writes "type": "http" for streamable HTTP and stdio workloads. SSE is left out of the transport map on purpose, because Pi rejects "type": "sse".
  • Enables skills using Pi's own ~/.pi/agent/skills (user) and .pi/skills (project) directories, rather than the shared .agents/skills location that several other clients already use.
  • Regenerates the CLI docs, swagger/OpenAPI and the Go SDK.

Closes #6735

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Built thv and, with an isolated HOME containing ~/.pi/agent, confirmed that thv client status shows Pi as installed and that thv client register pi registers it. Separately, upserted streamable HTTP, stdio and SSE entries into a freshly created Pi config through the client manager. The resulting mcp.json matched the shape in Pi's docs: {"url": ..., "type": "http"} for the first two and {"url": ...} for SSE.

Does this introduce a user-facing change?

Yes. thv client register pi and thv client setup now support the Pi coding agent, including skill installation into Pi's skills directories.

Special notes for reviewers

SSE workloads are written without a type field. Pi then treats them as streamable HTTP and fails to connect. Writing "type": "sse" would make Pi skip the entry outright, so neither option works. The SSE transport is deprecated anyway, so I've left it at that rather than adding per-client SSE filtering. Happy to revisit if we'd rather skip SSE workloads for Pi.

🤖 Generated with Claude Code

Pi has had built-in MCP support since 0.99.0 and reads servers from a
standard mcpServers JSON file at ~/.pi/agent/mcp.json, so it fits the
existing client model without new config logic.

Pi rejects the legacy "sse" type, so SSE is left out of the transport
map and SSE workloads are written without a type field. Skills use
Pi's native ~/.pi/agent/skills and .pi/skills directories rather than
the shared .agents/skills location.

Closes #6735

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size/S Small PR: 100-299 lines changed label Oct 14, 2026
@danbarr
danbarr requested a balanced review from Copilot October 14, 2026 03:41

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.

🟡 Changes recommended

SSE workloads are still written into Pi’s configuration despite being unsupported, producing unusable registrations.

1 open finding
What changed in this PR

Adds Pi as an MCP client with native configuration and skill paths.

Changes:

  • Registers Pi and its transport configuration.
  • Adds Pi skill-path and client tests.
  • Regenerates CLI, OpenAPI, and Go SDK artifacts.
File Description
pkg/​client/​config.go Defines the Pi client integration.
pkg/​client/​config_test.go Adds Pi to client configuration tests.
pkg/​client/​skills_test.go Tests Pi skill paths and support.
docs/​cli/​thv_client_register.md Lists Pi as registerable.
docs/​cli/​thv_client_remove.md Lists Pi as removable.
docs/​server/​docs.go Adds Pi to generated API docs.
docs/​server/​swagger.json Adds Pi to the JSON schema.
docs/​server/​swagger.yaml Adds Pi to the YAML schema.
sdk/​go/​openapi.json Updates the SDK JSON specification.
sdk/​go/​openapi.yaml Updates the SDK YAML specification.
sdk/​go/​client/​oas_json_gen.go Adds Pi JSON decoding.
sdk/​go/​client/​oas_schemas_gen.go Adds the generated Pi enum.
sdk/​go/​client/​oas_validators_gen.go Accepts Pi during validation.
Files not reviewed (4)
  • docs/server/docs.go: Generated file
  • sdk/go/client/oas_json_gen.go: Generated file
  • sdk/go/client/oas_schemas_gen.go: Generated file
  • sdk/go/client/oas_validators_gen.go: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/client/config.go Resolved
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.63%. Comparing base (fa7e344) to head (5a97de4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6819      +/-   ##
==========================================
+ Coverage   79.58%   79.63%   +0.05%     
==========================================
  Files         814      814              
  Lines       82537    82537              
==========================================
+ Hits        65684    65727      +43     
+ Misses      16848    16805      -43     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danbarr
danbarr merged commit e7cc53f into main Oct 14, 2026
51 checks passed
@danbarr
danbarr deleted the add-pi-client branch October 14, 2026 13:37
@aponcedeleonch aponcedeleonch mentioned this pull request Oct 15, 2026
4 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Pi coding agent as a supported MCP client

3 participants