fix: set MCPORTER_CONFIG env for all mcporter subprocess calls#74
fix: set MCPORTER_CONFIG env for all mcporter subprocess calls#74jygzyc wants to merge 1 commit intoPanniantong:mainfrom
Conversation
Panniantong
left a comment
There was a problem hiding this comment.
感谢 PR!想确认一下这个修改解决的具体场景是什么?
mcporter 默认会读取 ~/.mcporter/mcporter.json,正常安装流程(agent-reach install)不需要手动设置 MCPORTER_CONFIG 环境变量。
如果是特定环境下 mcporter 找不到配置文件的问题,能否补充一下复现步骤?这样我们可以判断是在 Agent Reach 层面修还是在 mcporter 层面修。
另外有个顾虑:硬编码 ~/.mcporter/mcporter.json 会影响配置文件不在默认路径的用户(比如 OpenClaw 用户的 mcporter 配置在 workspace 目录下),可能导致 doctor 误报。
我这边经过正常安装流程之后,默认会在 $HOME 目录下新建一个 |
|
Hi @jygzyc 👋 Thanks for the PR! Before we proceed, could you share what specific issue you ran into? Was mcporter unable to find its config file in certain environments? A few thoughts on the current approach:
Could you describe the scenario where this breaks? For example:
Happy to work together on a targeted fix once we understand the root cause 🙂 |
Summary
get_mcporter_env()static method to base Channel class to setMCPORTER_CONFIGenvironment variableexport MCPORTER_CONFIG=~/.mcporter/mcporter.jsoninstructionChanges
base.py: Addget_mcporter_env()methodbosszhipin.py,douyin.py,exa_search.py,linkedin.py,xiaohongshu.py: Passenv=self.get_mcporter_env()to subprocess callssetup-exa.md,setup-xiaohongshu.md,install.md: Add MCPORTER_CONFIG export instructionThis ensures all mcporter commands use the correct config file location.