Skip to content

feat: Configurable MCP Server URL in Admin Settings (#76) - #161

Merged
vybe merged 5 commits into
Abilityai:mainfrom
AndriiPasternak31:AndriiPasternak31/feature-76-mcp-url-config
Apr 22, 2026
Merged

feat: Configurable MCP Server URL in Admin Settings (#76)#161
vybe merged 5 commits into
Abilityai:mainfrom
AndriiPasternak31:AndriiPasternak31/feature-76-mcp-url-config

Conversation

@AndriiPasternak31

@AndriiPasternak31 AndriiPasternak31 commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Admin can now configure the MCP server URL in Settings (for production deployments proxied through nginx)
  • API Keys page shows the configured URL in connection snippets (or auto-detects from hostname)
  • Single endpoint with split auth: GET for any user, PUT/DELETE admin-only
  • URL validation: must be http/https and end with /mcp

Changes

  • src/backend/routers/settings.py — GET/PUT/DELETE /api/settings/mcp-url endpoints
  • src/frontend/src/views/Settings.vue — MCP URL config section with badge, save/reset
  • src/frontend/src/views/ApiKeys.vue — Fetch configured URL on mount
  • tests/test_settings.py — 9 new tests (TestMcpUrlSettings)
  • docs/memory/changelog.md — Change entry
  • docs/memory/feature-flows/ — Updated platform-settings.md and api-keys-page.md

Test Plan

  • New tests pass: pytest tests/test_settings.py::TestMcpUrlSettings -v
  • Existing tests unaffected: pytest tests/test_settings.py -v
  • Manual: Settings → enter custom URL → Save → API Keys shows it
  • Manual: Settings → Reset → API Keys reverts to auto-detect
  • Validation: invalid URLs rejected with clear error

Closes #76

Generated with Claude Code

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR requires the following changes before merge:

  • Add requirement entry to docs/memory/requirements.md (e.g., under section 5 Platform Settings or section 7 MCP Integration)
  • Add GET/PUT/DELETE /api/settings/mcp-url endpoints to docs/memory/architecture.md settings API table

Code and tests look good — just need the documentation updates per Trinity methodology (new feature = changelog + requirements + architecture).

@AndriiPasternak31
AndriiPasternak31 requested a review from vybe March 25, 2026 15:37

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Validation: APPROVED (with rebase required)

Code review passed — the implementation is clean, well-tested, and fully documented. However, the branch has 101 merge conflicts with main due to fork divergence and can't be merged in its current state.

Required before merge

  • Rebase onto current main to resolve conflicts

How to rebase

git remote add upstream https://github.com/abilityai/trinity.git
git fetch upstream
git rebase upstream/main
# Resolve any conflicts, then:
git push --force-with-lease

The actual feature changes (settings.py, ApiKeys.vue, Settings.vue, test_settings.py) are small and focused — most conflicts will be in files your branch didn't touch, so accepting the upstream version (git checkout --theirs <file>) should work for those.

Once rebased, this is ready to merge. The code, tests, docs, and security all look good.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please rebase this branch onto main to resolve any conflicts and incorporate recent changes.

Once rebased, request re-review.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Validated via /validate-pr. Complete documentation (requirements, architecture, feature flows, changelog), 9 comprehensive tests, clean implementation following existing patterns.

@AndriiPasternak31
AndriiPasternak31 force-pushed the AndriiPasternak31/feature-76-mcp-url-config branch from 274d981 to fb9a0ab Compare April 19, 2026 00:51
@AndriiPasternak31

Copy link
Copy Markdown
Contributor Author

Rebased onto mainmergeable: CLEAN. Conflict resolution summary:

Settings.vue — 4 conflict regions, all "both sides added adjacent new content" patterns (User Management section from ROLE-001 + my MCP URL section; usersList state + mcpUrlConfig state; serial loads + my parallel load; role/user functions + MCP URL functions). Union-merged: kept both sides with correct div closure for the template conflict. The loadSlackTransportStatus loader (new on upstream) was folded into the parallel Promise.all([...]) introduced by the simplify commit.

settings.py — single import-line conflict (upstream added Optional to typing, I added urlparse from urllib.parse). Kept both.

docs/memory/feature-flows.md — single row conflict on the Recent Updates table. Inserted the #76 row at its chronological position.

docs/archive/memory/changelog.md — resolved to upstream. The changelog was deprecated on main (7792127, git history is now the source of truth), so the b6e93b3 commit that polished the changelog entry became empty and was dropped during rebase.

Post-rebase doc fix (fb9a0ab) — the platform-settings.md table referenced Settings.vue lines 827-889 for the MCP URL section, computed against the old file. After rebase the section sits at lines 1089-1149; updated the reference. Did not touch other pre-existing stale line references in the same table (out of scope).

Final branch: 5 commits, no production behavior change vs the pre-rebase branch. Re-running /validate-pr should reproduce the previous APPROVED result.

AndriiPasternak31 and others added 5 commits April 19, 2026 14:04
The MCP server URL on the API Keys page was hardcoded to
http://{hostname}:8080/mcp, which is wrong for production deployments
proxied through nginx. Admins can now override it via Settings.

- Backend: GET/PUT/DELETE /api/settings/mcp-url (GET: any auth user,
  PUT/DELETE: admin-only, URL validation for http(s):// + /mcp suffix)
- Settings.vue: MCP URL config section with custom/auto-detect badge
- ApiKeys.vue: Fetches configured URL on mount, falls back to auto-detect
- Tests: 9 new tests in TestMcpUrlSettings class

Closes Abilityai#76

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…axios

- Move urlparse import to module level (PEP 8)
- Extract _submitMcpUrl helper to eliminate save/reset duplication
- Use dynamic success message (save vs reset)
- Parallelize independent API calls in Settings.vue and ApiKeys.vue
- Switch fetchMcpUrl to axios for consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- platform-settings.md: added MCP URL endpoints, Settings.vue section, user story
- api-keys-page.md: updated onMounted flow with fetchMcpUrl + Promise.all
- feature-flows.md: added recent update entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add requirement entry (7.4 MCP-URL-001) and Platform Settings API
table per PR review feedback — completing Trinity methodology docs
(changelog + requirements + architecture).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Settings.vue line numbers shifted as new sections (User Management, etc.)
landed upstream. Update the platform-settings.md table to point at the
current location (1089-1149) for the MCP Server URL section added by Abilityai#76.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AndriiPasternak31
AndriiPasternak31 force-pushed the AndriiPasternak31/feature-76-mcp-url-config branch from fb9a0ab to eee8613 Compare April 19, 2026 13:05
@AndriiPasternak31

Copy link
Copy Markdown
Contributor Author

Rebased again onto main (now at 65cdd91) — mergeable: CLEAN.

7 new upstream commits since the last rebase. One conflict on docs/memory/feature-flows.md: the previous rebase accidentally committed a stray <<<<<<< HEAD marker in commit 68c7de0; cleaned up that marker and union-merged the two new 2026-04-19 rows (#211, #378) above the existing Recent Updates list. #76 row still at its chronological 2026-03-25 position.

Five commits preserved; no code changes, docs-only tweaks. Ready for re-review.

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.

Configurable MCP Server URL in Admin Settings

3 participants