Repository navigation
Description
Problem Statement
partiful-cli has a working Go CLI over the reviewed Partiful API contract, but it does not yet expose those capabilities as MCP tools. A separate historical repository explored MCP, but its implementation is an incomplete evidence-gated prototype and cannot be transplanted safely. It duplicates output serialization, publishes tools that are not executable, omits MCP output schemas, uses a stale hand-written protocol server, and can drift from CLI behavior.
The maintained CLI must remain the product authority. Adding MCP must not create a second implementation of Partiful authentication, validation, transport calls, redaction, dry-run behavior, mutation dispatch, or error handling.
Solution
Add an MCP stdio server to the existing partiful binary as partiful mcp. The CLI and MCP adapters must invoke one API-derived application operation model. Each operation has one input contract, one result contract, one validation path, one authentication path, one remote transport path, one privacy projection, and one mutation truth model.
All supported product tools, including writes, are exposed by default. This is an intentional owner decision: launching the local stdio MCP server with the user's Partiful credentials grants the connected client the same product capabilities as running the CLI. MCP annotations must describe risk accurately, but they are not an authorization mechanism. Operators can optionally narrow the surface with --read-only and repeatable/comma-separated --allow-tool filters.
Mutations execute once after validation. dry_run: true previews without target mutation or local credential persistence. There are no plan tokens, apply phases, confirmation tokens, or persisted approval records. CLI TTY confirmation remains a CLI interaction policy; MCP never waits for terminal input. For an MCP call, deliberate invocation of an exposed tool is the execution request, subject to server startup policy and normal application validation.
User Stories
- As an MCP user, I want to start the server with
partiful mcp, so that the installed CLI and MCP implementation always have the same version. - As an MCP client, I want typed Partiful tools, so that I do not construct shell commands or raw API requests.
- As a user, I want MCP and CLI to call the same application operation, so that bug fixes and API changes apply to both interfaces.
- As a user, I want all supported read and write tools available by default, so that the local MCP server is useful without extra startup flags.
- As a cautious operator, I want
--read-only, so that I can expose only operations that do not mutate Partiful or local credentials. - As an operator, I want
--allow-toolfilters, so that I can expose a smaller task-specific capability set. - As an operator, I want invalid or empty filters to fail at startup, so that a typo cannot silently produce an unintended capability surface.
- As an MCP client, I want
tools/listto contain only enabled and implemented tools, so that discovery is truthful. - As an MCP client, I want input schemas derived from the same command contract as the CLI, so that required fields, enums, limits, and unknown-field behavior stay consistent.
- As an MCP client, I want output schemas for structured results, so that I can validate successful responses.
- As an MCP client, I want structured errors with the same types, codes, retryability, and safe details as the CLI, so that recovery behavior is consistent.
- As a user, I want MCP writes to retain all CLI validation, permission checks, current-state reads, and protocol checks, so that MCP is not a less safe bypass.
- As a user, I want
dry_run: trueon mutation tools, so that an agent can preview the normalized operation without changing target state. - As a user, I want dry runs to make zero target mutation calls and zero local credential writes, so that previewing cannot alter Partiful or credential storage.
- As a user, I accept that protected dry runs can perform authentication and read-only preflight requests when required for an accurate preview.
- As a user, I want private identifiers, credentials, and message bodies omitted from previews and errors, so that MCP context does not receive unnecessary secrets.
- As a user, I want remote/user-authored text treated as untrusted content, so that event and guest content cannot masquerade as tool instructions.
- As a user, I want mutations dispatched at most once with no blind retry after an ambiguous result, so that the agent does not duplicate events, invitations, RSVP changes, cohost changes, or blasts.
- As a user, I want cancellation and shutdown to preserve mutation uncertainty, so that cancellation is never reported as proof that a dispatched write did not occur.
- As a user, I want interactive login to remain CLI-only, so that the MCP server never asks for phone numbers or verification codes over tool calls.
- As an unauthenticated MCP client, I want protected calls to return an actionable error directing me to
partiful auth login. - As a user, I want MCP to reuse the CLI credential store and refresh coordination, so that there is one active session and no parallel credential system.
- As an MCP host, I want bounded output, pagination, per-call timeouts, and bounded concurrency, so that one tool call cannot exhaust the process or model context.
- As a maintainer, I want protocol handling delegated to the official Go MCP SDK, so that protocol evolution does not require maintaining handwritten JSON-RPC.
- As a maintainer, I want parity tests across every exposed operation, so that CLI and MCP cannot silently diverge.
Implementation Decisions
- The maintained
partiful-clirepository is the only implementation repository. The historicalKalebCole/partifulrepository is design evidence only. - The reviewed Partiful API contract and shared application operations are the implementation source of truth. CLI and MCP are thin adapters.
- Refactor the existing CLI execution path only as much as needed to separate argument parsing and terminal rendering from typed operation invocation. Preserve existing CLI behavior and JSON contracts.
- Do not translate MCP arguments into CLI argv, expose a generic command runner, or shell out to the CLI.
- Use one explicit public result projection for both adapters. Do not create separate reflection serializers.
- Add MCP as
partiful mcpin the existing binary. Do not publish a secondpartiful-mcpexecutable. - Use the current official
github.com/modelcontextprotocol/go-sdk, with the protocol versions and stdio lifecycle supported by that SDK. - The first release supports stdio only. HTTP, SSE, daemon mode, and remote hosting are separate future decisions.
- Expose the supported product operations for events, guests, RSVPs, contacts, cohosts, blasts, and posters. Do not expose
auth.login,auth.logout,schema,doctor,version, raw Firebase/Firestore/callable operations, or generic shell execution as model-callable tools. - Write tools are enabled by default.
--read-onlyremoves all tools that can mutate Partiful or local credential state.--allow-toolnarrows the default or read-only set and can never add an unknown or otherwise excluded tool. - Provide
partiful mcp --list-toolsso the operator can inspect the exact resulting tool surface without starting the protocol server. - MCP tool names use stable snake_case resource-action names derived from the operation catalog.
- Publish
inputSchema,outputSchema, and accurate MCP annotations from the shared operation metadata. - Keep separate safety concepts: read-only, external write, destructive update, consequential human contact, and CLI-confirmation-required. Do not derive every policy from one destructive boolean.
- CLI confirmation remains active for
events.cancel,cohosts.remove,cohosts.revoke-invite, andcohosts.link.revoke. MCP does not invoke a TTY confirmer. MCP annotations and startup filtering describe/control its interface; normal application validation remains mandatory. - MCP tool calls return the existing CLI JSON envelope semantics as structured content, including the same domain
data, safemeta, and classified error object. Include a serialized JSON text content block for compatibility. - Validate successful structured content against the advertised output schema before returning it.
- Mutation tools accept
dry_run. Do not expose CLI-only--forceor--no-inputas MCP arguments. - Preserve current dry-run behavior: zero target mutations, no local credential persistence, redacted private data, and read-only preflight where the operation requires it.
- Use the existing credential path, cursor key, refresh logic, API clients, validation, redaction, and one-attempt mutation implementation. Do not introduce a second store, installation secret, account model, evidence gate, or login flow.
- Bound each call by configurable timeout, concurrency, item count, and encoded output bytes. Return explicit truncation and continuation information rather than silently cutting output.
- Unsupported or unverified operations are absent from
tools/list. Development evidence status belongs in tests and CI, not runtime authorization. - Remote/user-authored strings remain structured data and must not be promoted into protocol instructions or trusted server guidance.
Testing Decisions
- Prefer black-box tests through the compiled
partiful mcpstdio entrypoint, backed by injected/fake HTTP transport and isolated credential storage. - Add a catalog parity test proving every exposed MCP tool maps to exactly one existing application operation and every exclusion is explicit.
- For every exposed tool, compare equivalent CLI and MCP inputs after parsing and confirm they reach the same typed operation input.
- For representative reads and every mutation class, compare CLI JSON and MCP structured results semantically, including embedded structs, wrappers, nullable values, collection metadata, and all RSVP branches.
- Validate every successful MCP structured result against its advertised
outputSchema. - Verify unknown fields, wrong types, missing required fields, conflicting selectors, and malformed union branches fail before remote dispatch.
- Verify all intended read and write tools are present by default.
- Verify
--read-onlyexcludes every write tool. - Verify exact and wildcard
--allow-toolfilters only narrow the enabled surface and reject unknown selectors. - Verify MCP never opens, waits for, or bypasses a TTY prompt.
- Verify all four CLI destructive confirmations continue to work unchanged.
- Verify mutation dry runs perform no mutation call and no credential write, while permitting required read-only preflight.
- Verify normal writes perform exactly one mutation attempt and ambiguous outcomes are not retried.
- Verify credentials, raw user/contact IDs, private messages, and backend bodies do not appear in tool definitions, previews, results, errors, or diagnostics.
- Verify output limits and continuation metadata with oversized collections and oversized remote strings.
- Verify request cancellation, duplicate request IDs, EOF, SIGINT/SIGTERM, timeout, concurrency limits, and protocol-only stdout.
- Run the repository's complete Go test, race, vet, build, module verification, PII guard, and native release checks.
- Smoke-test the built server with at least one real MCP SDK client: initialize/discover, call a public read, observe an auth-required protected call, dry-run a mutation, and inspect the enabled tool set. Do not perform live mutations in automated verification.
Out of Scope
- Plan tokens, apply phases, confirmation tokens, persisted approvals, or stale-plan handling
- Interactive authentication through MCP
- HTTP/SSE/remote MCP transport
- A second MCP executable
- MCP-only business operations
- Generic CLI argv execution or raw API/Firebase tools
- Replacing the current credential store or authentication flow
- Importing runtime evidence gates or placeholder transports from
KalebCole/partiful - SQLite sync/search/context systems from generic Printing Press output
- Landing-page CLI/MCP mode work tracked by Add a CLI/MCP mode toggle to the landing page #195
- Sandcastle orchestration tracked by Add Sandcastle orchestration for future MCP development #198
- Autonomous merge or release
Further Notes
Printing Press was reviewed at KalebCole/cli-printing-press commit 2c57c2ed55002e48baae54c094b47e7c609ff09d. Useful precedents are typed tools, strict argument handling, framework-command exclusions, shared config/auth paths, output bounds, rate limiting, pagination, and protocol-only stdout. Its defaults are not binding here: Partiful needs shared application operations rather than separately generated endpoint behavior, real structured results/output schemas, and the official MCP SDK.
The historical KalebCole/partiful repository was reviewed at 77d54d0728c23b661c5eaa82e70fa6db3c4f1a09. Do not transplant its hand-written MCP server, runtime evidence gates, placeholder transports, exact 24/23 count invariant, reflection serializers, unstable process-local cursor key, or separate credential architecture.
Dependencies: land #202, then retarget and land #203. MCP implementation should begin from the resulting main history or be explicitly stacked on #203 until those prerequisites merge.
- hermes 🤖
Activity
KalebCole commentedon Sep 5, 2026
Printing Press comparison
Reviewed
KalebCole/cli-printing-pressat2c57c2ed55002e48baae54c094b47e7c609ff09d.Printing Press confirms the owner decision that supported MCP write tools can be exposed by default. It registers generated endpoint tools without a mandatory
--allow-writegate and relies on accurate MCP annotations plus host-level approval UX. Issue #204 therefore continues to require writes by default;--read-onlyand--allow-toolare optional narrowing controls only.Reuse these Printing Press decisions:
Do not copy these implementation choices:
structuredContentplusoutputSchemacontract. Partiful must provide and validate both.partiful mcpmode in the same release binary.mark3labs/mcp-go. Partiful will use the current officialmodelcontextprotocol/go-sdkunless a documented compatibility blocker requires reconsideration.This comparison does not change the write-default requirement. It tightens the DRY requirement: the API-derived application operation, not generated sibling handlers or the CLI argv layer, is the single behavior source.
KalebCole commentedon Nov 14, 2026
Triage bot: held for Kaleb. An MCP server is a second product interface and is on the hold list. See #205.