add mcp server - #2064
Merged
Merged
Conversation
Add a �itfun mcp add subcommand that walks the user through a three-step wizard (name, local/remote type, command/URL) and persists the resulting MCPServerConfig via MCPConfigService. - McpAction::Add clap variant with --name/--type/--command/--url/--non-interactive flags - management::add_mcp_server plus helpers (RawModeGuard, select_server_type, render_type_prompt, read_required_field) implementing the wizard with raw-mode TTY selection and a non-interactive fallback - Wire the Add dispatch in the Commands::Mcp match in main.rs
xielixing
pushed a commit
to xielixing/BitFun
that referenced
this pull request
Aug 6, 2026
A fresh user's repository has no .loopx control plane, which previously surfaced as a raw "Failed to read LoopX Issue-Fix state" error banner the moment the panel opened. Pre-bootstrap is a normal state, not an error: status/poll now return null for unconnected repositories, the header says "not connected yet — select issues and press Start", and the Start command runs # LoopX Bootstrap - ok: `True` - dry_run: `False` - project: `C:\codeagent\BitFun` - goal_id: `bitfun-goal` - registry: `C:\codeagent\BitFun\.loopx\registry.json` - state_file: `C:\codeagent\BitFun\.codex\goals\bitfun-goal\ACTIVE_GOAL_STATE.md` - goal_doc: `None` - goal_doc_exists: `False` - runtime_root: `C:\Users\huawei\.codex\loopx` - registry_goal_action: `kept-existing` - state_action: `kept-existing` - execution_profile: `cadence=bounded_progress_segment minimum=multi_surface_or_implementation include=coherent_artifact,targeted_validation,state_writeback spend_rule=spend_only_after_artifact_validation_writeback small_streak_threshold=2` - onboarding_acceptance_required: `True` - autonomous_advance_choice_required: `True` - codex_app_heartbeat: `ask` - heartbeat_opt_in_required: `True` - host_loop_activation_required: `True` - onboarding_todos_written: `False` - global_sync: `True` ## Actions - `C:\codeagent\BitFun\.loopx\registry.json`: wrote (kept-existing) - `C:\codeagent\BitFun\.codex\goals\bitfun-goal\ACTIVE_GOAL_STATE.md`: kept-existing () - `C:\Users\huawei\.codex\loopx\registry.global.json`: synced (bitfun-goal) ## Onboarding Scan - schema: `loopx_project_onboarding_v0` - git_repo: `True` - status_path_count: `10` - recent_commits: `5` - signal_files: `README.md, AGENTS.md, CONTRIBUTING.md, package.json, Cargo.toml` - raw_file_bodies_read: `False` - status_sample: - `A BitFun-Installer/src-tauri/Cargo.lock` - `M src/apps/desktop/src/api/issue_fix_api.rs` - `M src/crates/services/services-integrations/src/loopx_issue_fix/autonomous.rs` - `M src/web-ui/src/app/components/panels/issue-fix/IssueFixPanel.tsx` - `M src/web-ui/src/infrastructure/api/service-api/IssueFixAPI.ts` - recent_commit_sample: - `7a0db930d` feat(issue-fix): bundled LoopX sidecar and three-tier readiness probe - `441cfc424` Merge remote-tracking branch 'origin/main' into feat/loopx-issue-fix - `386d352a3` fix(desktop): also shrink oversized restored windows into the work area - `ddf07a48d` fix(issue-fix): make 'Open panel' work from any scene - `8fe67c5cb` Merge pull request GCWing#2064 from ldc111/main ## Proposed Onboarding Candidates 1. [P1] Inspect current uncommitted changes (A BitFun-Installer/src-tauri/Cargo.lock, M src/apps/desktop/src/api/issue_fix_api.rs, M src/crates/services/services-integrations/src/loopx_issue_fix/autonomous.rs, M src/web-ui/src/app/components/panels/issue-fix/IssueFixPanel.tsx, M src/web-ui/src/infrastructure/api/service-api/IssueFixAPI.ts) and decide what belongs in the first LoopX segment before editing. - reason: The repo already has local changes, so the first safe step is ownership and scope classification. - metadata: `advancement_task:repo_status_review` 2. [P1] Summarize the last 5 commits and extract the safest next bounded project follow-up. - reason: Recent commits are a fast signal of current project direction without reading private bodies. - metadata: `advancement_task:commit_summary` 3. [P1] Identify the fastest validation command from package.json, Cargo.toml and record whether it is safe to run now. - reason: Validation entrypoints are visible from top-level project metadata. - metadata: `advancement_task:validation_plan` 4. [P2] Build a compact read-only project map from README.md, AGENTS.md, CONTRIBUTING.md, package.json, Cargo.toml and note authority sources, risks, and first useful handoff. - reason: Top-level project files can seed a useful map before any implementation work. - metadata: `advancement_task:read_only_map` ## Accept Candidate Commands Run only the commands for candidates the user accepts, then refresh state. - `loopx --registry '.loopx\registry.json' todo add --goal-id bitfun-goal --role agent --text '[P1] Inspect current uncommitted changes (A BitFun-Installer/src-tauri/Cargo.lock, M src/apps/desktop/src/api/issue_fix_api.rs, M src/crates/services/services-integrations/src/loopx_issue_fix/autonomous.rs, M src/web-ui/src/app/components/panels/issue-fix/IssueFixPanel.tsx, M src/web-ui/src/infrastructure/api/service-api/IssueFixAPI.ts) and decide what belongs in the first LoopX segment before editing.' --task-class advancement_task --action-kind repo_status_review` - `loopx --registry '.loopx\registry.json' todo add --goal-id bitfun-goal --role agent --text '[P1] Summarize the last 5 commits and extract the safest next bounded project follow-up.' --task-class advancement_task --action-kind commit_summary` - `loopx --registry '.loopx\registry.json' todo add --goal-id bitfun-goal --role agent --text '[P1] Identify the fastest validation command from package.json, Cargo.toml and record whether it is safe to run now.' --task-class advancement_task --action-kind validation_plan` - `loopx --registry '.loopx\registry.json' todo add --goal-id bitfun-goal --role agent --text '[P2] Build a compact read-only project map from README.md, AGENTS.md, CONTRIBUTING.md, package.json, Cargo.toml and note authority sources, risks, and first useful handoff.' --task-class advancement_task --action-kind read_only_map` ## Autonomy And Heartbeat Choice - heartbeat_opt_in_instruction: Ask the user whether to enable the Codex App heartbeat. heartbeat=yes means create or update a recurring Codex App automation from an identity-scoped `loopx heartbeat-prompt --thin` task body; heartbeat=no means keep the goal manual or on-demand. - Ask the user whether Codex may start autonomous advancement. If autonomous=yes, run the quota guard and execute the first accepted Agent Todo; if autonomous=no, stop after writing accepted todos and refresh-state. ## Next Commands - `loopx --registry .loopx\registry.json registry` - `loopx --registry .loopx\registry.json status` - `loopx --registry .loopx\registry.json check --scan-root C:\codeagent\BitFun` - `loopx --format json --registry C:\Users\huawei\.codex\loopx\registry.global.json quota should-run --goal-id bitfun-goal --runtime-profile generic_cli` - `loopx --registry .loopx\registry.json refresh-state --goal-id bitfun-goal` - `loopx --registry C:\Users\huawei\.codex\loopx\registry.global.json status` - `loopx --registry .loopx\registry.json history --goal-id bitfun-goal` ## Install / Update Hint If this local LoopX install is missing or stale, rerun the no-clone installer, refresh PATH, and confirm with loopx doctor before continuing project delivery. ```bash curl -fsSL https://raw.githubusercontent.com/huangruiteng/loopx/main/scripts/install-from-github.sh | bash export PATH="$HOME/.local/bin:$PATH" loopx doctor ``` ## Boundary Note Add .loopx/ and .codex/goals/ to the project .gitignore if the goal state contains private evidence. (BitFun's continuous-repair objective, controller role) plus before writing the first intake todos. Verified end to end on a fresh git repo with the PyInstaller sidecar: bootstrap -> register -> intake -> todo projection -> compact heartbeat generation all succeed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a �itfun mcp add subcommand that walks the user through a three-step wizard (name, local/remote type, command/URL) and persists the resulting MCPServerConfig via MCPConfigService.