Repository navigation
feat: mcp stdio server and harness install - #20
Conversation
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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 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. Comment |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…fuse toml it cannot rewrite
There was a problem hiding this comment.
💡 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".
|
@coderabbitai review |
|
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
Note 🤖 Union Alpha responding on behalf of Microck @codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
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 |
There was a problem hiding this comment.
💡 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".
|
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 |
There was a problem hiding this comment.
💡 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".
| // 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" { |
There was a problem hiding this comment.
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 👍 / 👎.
|
Note 🤖 Union Alpha responding on behalf of Microck @codex review |
|
@codex review |
# Conflicts: # docs/cli-spec.md
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 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".
| // 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 |
There was a problem hiding this comment.
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 👍 / 👎.
wallapop mcpruns a Model Context Protocol server on stdin/stdout, andwallapop mcp install claude-code|codex|cursorputs 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 jsonenvelope, 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_pagefor--next),conditionis an array,filteran 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,chatToolsEnabledininternal/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 listand 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 aremcpplus--profile NAMEwhen 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 actionadded,updatedorunchanged, so the second run is a no-op that says so.tests
internal/cli/mcp_test.godrives the real server through the stdio transport (pipes intocli.Execute) against the existing fake wallapop: handshake, tool listing, refusals, argument validation,--profilepass-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,staticcheckandgo test ./...are clean.docs
docs/cli-spec.mdgets an### mcpsection, 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