Repository navigation
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
|
The first implementation does not yet satisfy #204 and should not be reviewed as merge-ready. The blocking issue is architectural: MCP arguments are converted into synthetic CLI argv and routed through the CLI parser. That makes CLI parsing the shared layer instead of the API-derived application operation, and it already causes schema/runtime drift for nested, nullable, numeric, and union inputs. Required recovery order:
The existing implementation also needs the snake_case cohost tool name fixed, complete schema parity, truthful bounded-result behavior, and a green native-release workflow. Writes remain enabled by default. Keeping this PR open as a draft while the architecture is corrected. Nothing should merge from the current head.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
partiful mcp lacks a conventional --help path and MCP-layer failure envelopes omit standard CLI meta, creating usability and response-shape inconsistencies.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
cmd/partiful/main.go — partiful mcp currently treats -h/--help as an unknown option (because it runs through… |
|
internal/mcpserver/server.go — The MCP-layer error envelopes (MCP_ARGUMENTS_INVALID, MCP_OUTPUT_INVALID, call timeout/cancel,… |
What changed in this PR
Adds an API-derived MCP stdio server to the existing partiful binary (partiful mcp) by reusing the CLI’s typed operation catalog and execution path, plus supporting runtime limits and parity/SDK black-box tests.
Changes:
- Introduce an MCP stdio server (
internal/mcpserver,cmd/partifulentrypoint) that exposes curated product operations as tools with derived input/output schemas and bounded runtime behavior. - Refactor CLI execution to parse into a shared typed “product operation” invocation used by both CLI and MCP adapters (including dry-run and destructive-confirmation behavior).
- Update tooling/docs/CI for Go/toolchain upgrades and include MCP usage + smoke/verification updates.
| File | Description |
|---|---|
| scripts/smoke-native-cli.sh | Run smoke checks under isolated HOME/config roots for safer native verification. |
| README.md | Document MCP stdio server usage, flags, and runtime safeguards; update release rehearsal snippet. |
| internal/mcpserver/server.go | Implement MCP server option parsing, tool filtering, schema validation, pacing, concurrency, and output bounds. |
| internal/mcpserver/server_test.go | Unit tests for MCP option parsing and tool filtering behavior. |
| internal/mcpserver/server_runtime_test.go | In-memory runtime tests covering schema validation, pacing, limits, cancellation/timeout, and tool parity basics. |
| internal/app/rsvp.go | Refactor RSVP get execution to accept typed inputs (no argv parsing inside executor). |
| internal/app/rsvp_set.go | Refactor RSVP set execution to accept typed options (no argv parsing inside executor). |
| internal/app/posters.go | Extract posters execution into shared operation function and add truncation metadata support. |
| internal/app/operation.go | Add shared typed product invocation model and dispatch for CLI + MCP adapters. |
| internal/app/mcp.go | Add MCP tool catalog derivation, input/output schema projection, and MCP argument decoding into typed invocations. |
| internal/app/mcp_operation_test.go | Verify CLI and MCP adapters generate identical typed invocations for all exposed tools. |
| internal/app/mcp_execution_test.go | Parity + safety tests for MCP execution behavior (dry-run, auth, redaction, bounds, confirmations). |
| internal/app/mcp_catalog_test.go | Validate curated MCP tool set and ensure CLI-only fields aren’t exposed via tool schemas. |
| internal/app/guests.go | Refactor guest list/invite executors to accept typed inputs and emit truncation metadata. |
| internal/app/events.go | Refactor event list/get executors to accept typed inputs and emit truncation metadata. |
| internal/app/event_write.go | Refactor event write executors to accept typed inputs; route confirmation through new execution hook. |
| internal/app/contacts.go | Extract contacts execution into shared operation function and add truncation metadata support. |
| internal/app/confirmation.go | Refactor mutation execution confirmation handling to support CLI-only prompting and MCP non-interactive behavior. |
| internal/app/cohosts.go | Refactor cohost executors to accept typed inputs and use shared confirmation hook. |
| internal/app/blasts.go | Refactor blast send executor to accept prepared typed input; split message preparation into helper. |
| internal/app/app.go | Route product operations through shared parse+invoke path; extend page metadata for truncation; refactor confirmation plumbing. |
| go.sum | Add/upgrade module sums for MCP SDK, jsonschema, and updated x/* dependencies. |
| go.mod | Bump Go version and add MCP/jsonschema dependencies (plus indirects). |
| docs/index.html | Update website installation/verification command to new toolchain + GoReleaser versions. |
| docs/CONTRIBUTING.md | Update contributor verification command to new toolchain + GoReleaser versions. |
| cmd/partiful/mcp_test.go | Black-box stdio tests using the official MCP SDK + lifecycle/stdio behavior checks. |
| cmd/partiful/main.go | Add partiful mcp entrypoint and dependency wiring; --list-tools support. |
| .github/workflows/release.yml | Bump CI Go version and GoReleaser install path/version. |
| .github/workflows/native-release-verify.yml | Bump CI Go version and GoReleaser install path/version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
--read-only currently does not prevent credential refresh persistence on protected read tools, which undermines the intended “no local credential mutation” safety surface.
Review tier: Lite
Findings: None
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
internal/mcpserver/server.go — The MCP-layer error envelopes (MCP_ARGUMENTS_INVALID, MCP_OUTPUT_INVALID, call timeout/cancel,… View resolved comment |
|
cmd/partiful/main.go — partiful mcp currently treats -h/--help as an unknown option (because it runs through… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
internal/mcpserver/server.go:236
--read-onlycurrently filters tools based onapp.MCPDefinition.ReadOnlybut does not prevent refresh-token persistence for protected read tools. Protected reads (e.g.,contacts_list,events_list,events_get,rsvp_get) still callacquireProtectedSession, which usesauth.AcquireSession(persistRefresh=true) and will write updated credentials to disk on refresh, mutating local credential state even in read-only mode.
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
partiful mcp help currently fails when combined with other flags, and the docs-site rehearsal snippet sets a global EXIT trap without a subshell, both of which should be corrected before approval.
Review tier: Lite
Findings: None
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
docs/index.html:479
- The docs site command snippet sets an
EXITtrap in the caller’s shell (trap 'rm -rf "$gobin"' EXIT) without a subshell. If users paste this, it can override an existing EXIT trap (and the cleanup won’t run until their shell exits). Wrapping the sequence in( ... )(like README/CONTRIBUTING now do) scopes the trap and avoids surprising shell-side effects.
cmd/partiful/main.go:55
partiful mcphelp only works when-h/--helpis the only flag (len(argv)==1). If a user runspartiful mcp --help --read-only(or similar),--helpfalls through toParseOptionsand becomes an "unknown mcp option", exiting 2 instead of showing usage. Help flags should be recognized regardless of what other flags are present, and should short-circuit before starting the MCP transport.
func runMCP(ctx context.Context, argv []string, dependencies app.Dependencies) error {
if len(argv) == 1 && (argv[0] == "-h" || argv[0] == "--help") {
_, err := io.WriteString(os.Stdout, mcpserver.HelpText())
return err
}
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
cmd/partiful/mcp_test.go spawns subprocesses with only HOME set, which can read/write real user config on Windows (os.UserConfigDir via APPDATA/LOCALAPPDATA), making tests non-hermetic cross-platform.
Review tier: Lite
Findings: None
Suppressed comments (4)
Previously missed (1) — in code that hasn't changed since the last review.
cmd/partiful/mcp_test.go:30
- The MCP process only sets HOME for isolation, but auth.DefaultCredentialsPath uses os.UserConfigDir (APPDATA/LOCALAPPDATA on Windows). This can cause the test to read/write real user config when run on Windows. Set XDG_CONFIG_HOME/APPDATA/LOCALAPPDATA alongside HOME so the subprocess is hermetic across platforms.
This issue also appears in the following locations of the same file:
- line 135
- line 227
- line 268
cmd/partiful/mcp_test.go:271
- startRawMCP sets only HOME for the subprocess, but config resolution on Windows uses APPDATA/LOCALAPPDATA via os.UserConfigDir. Also, using t.TempDir() directly in the Env assignment prevents reusing the same directory for all vars. Set HOME/XDG_CONFIG_HOME/APPDATA/LOCALAPPDATA from a single temp dir to avoid touching real user config on Windows.
func startRawMCP(t *testing.T, binary string) *rawMCPProcess {
t.Helper()
command := exec.Command(binary, "mcp", "--request-interval", "1ms")
command.Env = append(os.Environ(), "HOME="+t.TempDir())
cmd/partiful/mcp_test.go:137
- This subprocess only sets HOME, but os.UserConfigDir (used by auth.DefaultCredentialsPath) reads APPDATA/LOCALAPPDATA on Windows. Also, calling t.TempDir() inside Env assignment makes it hard to reuse the same directory for all relevant vars. Create one temp dir and set HOME/XDG_CONFIG_HOME/APPDATA/LOCALAPPDATA consistently.
var stdout, stderr bytes.Buffer
command := exec.Command(binary, append([]string{"mcp"}, test.argv...)...)
command.Env = append(os.Environ(), "HOME="+t.TempDir())
cmd/partiful/mcp_test.go:229
- This subprocess only sets HOME, but auth.DefaultCredentialsPath uses os.UserConfigDir, which depends on APPDATA/LOCALAPPDATA on Windows. Use a single temp dir and set HOME/XDG_CONFIG_HOME/APPDATA/LOCALAPPDATA so the test remains hermetic on all platforms.
var stdout, stderr bytes.Buffer
command := exec.Command(binary, "mcp", "--invalid-option")
command.Env = append(os.Environ(), "HOME="+t.TempDir())
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It introduces a new MCP protocol surface and refactors core execution/auth/persistence pathways, warranting final human security/correctness review despite strong automated test coverage.
Review tier: Lite
Findings: None
81de1eb to
ff9bdb4
Compare
Replace the MCP-to-argv bridge with shared typed product operations used by both CLI and MCP adapters. Add curated read/write tools, schema validation, privacy-safe errors, runtime bounds, lifecycle handling, and parity coverage. Keep writes enabled by default with read-only and allow-tool narrowing.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Main reads --no-input into a local flag and confirms destructive commands through a callback. The rebased login path still referenced execution.NoInput, which that struct no longer has. Co-authored-by: Kaleb Cole <[email protected]>
e1c20bd to
8ab93d8
Compare
|
Triage bot: held for Kaleb. An MCP server is a second product interface and is on the hold list. Separate from the architecture blockers already noted above. Also has merge conflicts with main. Not merging. |

Summary
partiful mcpusing the officialgithub.com/modelcontextprotocol/go-sdkover stdio--read-onlyand repeatable/comma-separated--allow-tool; add--list-toolsValidation
go mod verifygo test -count=1 ./...go test -race -count=1 ./...go vet ./...go build ./...git diff --checkscripts/pii-guard.shStack
This PR targets
fix/issue-201-dry-run-confirmationat985013b. Retarget it tomainonly after #202 and #203 land.Closes #204 after merge.
Summary
partiful mcpusing the officialgithub.com/modelcontextprotocol/go-sdkover stdio--read-onlyand repeatable/comma-separated--allow-tool; add--list-toolsValidation
go test ./...go test -race ./...go vet ./...go build ./...Rebase
#202 and #203 are already on main. This branch is rebased onto current main.
partiful mcp --helpstill prints local usage and returns before the stdio server, and MCP-generated errors still includecliVersionplus the contract revisions. The rebase also keeps auth login's--no-inputcheck on the local flag, becausemutationExecutionnow carries a confirmation callback instead of aNoInputfield.Closes #204 after merge.