Skip to content

feat: mcp stdio server and harness install - #20

Merged
Microck merged 21 commits into
mainfrom
feat/mcp-server
Sep 16, 2026
Merged

Microck merged 21 commits into
mainfrom
feat/mcp-server

Conversation

@Microck

@Microck Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner

wallapop mcp runs a Model Context Protocol server on stdin/stdout, and wallapop mcp install claude-code|codex|cursor puts it in the harness config.

how it works

every tool is defined as a CLI argv and runs that command in-process. so the tool output is literally what the command prints, not a second rendering that can drift from it. a command that fails comes back as a tool error whose text is the --error-format json envelope, exit code and all. a call the protocol itself refuses (unknown tool, wrong argument type, missing required one) is a jsonrpc -32602, since no command ran.

transport is newline-delimited jsonrpc 2.0, hand written like the rest of the client. no MCP SDK, same reason there is no pubnub SDK. methods: initialize, ping, tools/list, tools/call. protocol revisions 2024-11-05, 2025-03-26 and 2025-06-18 are answered.

tools

search, item_show, user_show, watch_check. arguments are the command flags with underscores (max_price, next_page for --next), condition is an array, filter an object. unknown argument names are refused instead of silently dropped.

not exposed, and refused by name with the reason: item reserve, item sold, item delete, item create, item edit. destructive and money-adjacent stuff stays with the person at the terminal.

what is deliberately left out

the chat tools (chat_list, chat_show, chat_send, chat_start) are written but gated behind one constant, chatToolsEnabled in internal/mcp/tools.go. #8 is blocked by #3 (chat ships after live receive is verified), so until #3 lands, asking for one of them says exactly that instead of pretending the name was a typo. flipping the constant to true is the whole change. their argv mapping is unit tested, since the transport tests cannot reach them while they are off.

chat open, chat archive, me *, alert list, category list and the config/doctor commands are not tools either. #8 lists eight tools, so that is what this implements.

install

writes ~/.claude.json (or $CLAUDE_CONFIG_DIR), ~/.codex/config.toml (or $CODEX_HOME), ~/.cursor/mcp.json. the command is the running executable, args are mcp plus --profile NAME when one was given, so an installed server keeps acting as that account. other entries survive, and codex's TOML is edited as text so comments and key order survive too. prints {harness,path,action,command,args} with action added, updated or unchanged, so the second run is a no-op that says so.

tests

internal/cli/mcp_test.go drives the real server through the stdio transport (pipes into cli.Execute) against the existing fake wallapop: handshake, tool listing, refusals, argument validation, --profile pass-through, watch_check state, and a byte comparison of each tool's output against the same command run through the CLI. install is covered per harness: added, unchanged on a rerun with the file untouched, updated with a profile, and other entries and comments preserved.

go build, go vet, gofmt, staticcheck and go test ./... are clean.

docs

docs/cli-spec.md gets an ### mcp section, the command tree line, the layout and stack lines, and loses "MCP server (v2)" from "not in v1". the embedded skills doc gets an MCP section.

Closes #8

Adds `wallapop mcp`, a Model Context Protocol server on stdin/stdout, and
`wallapop mcp install claude-code|codex|cursor`.

Each tool is defined as a CLI argv and runs the command in-process, so a
tool returns the same JSON the command prints and a failure returns the
error envelope with its exit code. Tools: search, item_show, user_show,
watch_check. Reserve, sold, delete, create and edit are not exposed and
name their reason when asked for. The chat tools are written but gated
behind one constant until issue #3 verifies live receive.

Install writes the entry into ~/.claude.json, ~/.codex/config.toml or
~/.cursor/mcp.json, keeps other entries and codex's comments, and reports
added, updated or unchanged.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 994e30ca-965e-4970-a325-0a225ce6424f


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T21:46:52.235176Z ba43dfc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 721b5c677d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/mcp.go Resolved
Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Pull request base or head changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1daca2de14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/mcp.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f22459c91e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/mcp.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b829de49ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b73c2f8c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/tools.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b26409a728

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: adf249f437

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45d0dd6f2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f676891ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/mcp.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b13425140

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/mcp.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc363e1cd9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dc62f6802

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/install.go Resolved
Comment thread internal/mcp/install.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: ff5332acba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

Follow-up in bf66585: table-valued command/args are now detected from the parsed document before any rewrite and refused with the existing will-not-rewrite message (the parse-error wording no longer fires for this case); the file stays byte-identical. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf6658555d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/mcp.go Resolved
@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

Fixed in the new commit: the installer now persists the profile resolved from WALLAPOP_PROFILE or --profile (via config.ResolveProfile) whenever it is not the unqualified default, and stays unpinned for a bare default install. Verified live: env-selected install writes args ["mcp","--profile","work"], plain install stays ["mcp"]. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ca06a9e2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/mcp.go
// flag and WALLAPOP_PROFILE both select one; a bare install stays
// unpinned so the config default keeps applying.
serverArgs := []string{"mcp"}
if resolved := config.ResolveProfile(a.flagProfile, a.Cfg); resolved != "" && resolved != "default" {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track whether the profile was explicitly selected

ResolveProfile also returns Cfg.DefaultProfile, so this value comparison cannot distinguish an explicit flag/environment selection from the config fallback. If default_profile = "work", a bare install incorrectly writes --profile work and stops following later default-profile changes; conversely, an explicit --profile default or WALLAPOP_PROFILE=default is omitted and may run as another configured default. Persist the profile based on whether --profile or WALLAPOP_PROFILE supplied it, rather than whether the resolved name equals "default".

Useful? React with 👍 / 👎.

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

@codex review

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@Microck

Microck commented Sep 16, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Union Alpha responding on behalf of Microck

Rebased onto main (ba43dfc, additive docs merge only). @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 5ca06a9e2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Microck
Microck merged commit 5529390 into main Sep 16, 2026
1 check passed
@Microck
Microck deleted the feat/mcp-server branch September 16, 2026 21:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba43dfcb08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/mcp/tools.go
// receive against a second account before an agent is handed a send button:
// a tool that sends into the void is worse than no tool. Flip this to true
// when #3 lands and the chat tools ship; nothing else changes.
const chatToolsEnabled = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enable chat tools now that receive is verified

The gate's stated prerequisite has already landed in the target's parent: docs/cli-spec.md:478-480 records successful end-to-end PubNub receive verification, and the corresponding mainline commit closes issue #3. Leaving this false makes listTools omit chat_list, chat_show, chat_send, and chat_start, while lookupTool rejects every call, so half of the implemented MCP tool set remains universally unavailable even though the comment says to flip the gate when #3 lands.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP stdio server and harness install

1 participant