Skip to content

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

Open
AndriiPasternak31 wants to merge 8 commits intoAbilityai:mainfrom
AndriiPasternak31:AndriiPasternak31/feature-76-mcp-url-config
Open

feat: Configurable MCP Server URL in Admin Settings (#76)#161
AndriiPasternak31 wants to merge 8 commits intoAbilityai:mainfrom
AndriiPasternak31:AndriiPasternak31/feature-76-mcp-url-config

Conversation

@AndriiPasternak31
Copy link
Copy Markdown
Contributor

@AndriiPasternak31 AndriiPasternak31 commented Mar 25, 2026

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

AndriiPasternak31 and others added 4 commits March 25, 2026 01: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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@vybe vybe left a comment

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 and others added 2 commits March 25, 2026 15:22
Resolve merge conflicts in changelog.md and feature-flows.md — both
our Abilityai#76 MCP URL config entries and upstream entries (Abilityai#74, Abilityai#100, Abilityai#128, Abilityai#19)
are preserved in chronological order.

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>
@AndriiPasternak31 AndriiPasternak31 requested a review from vybe March 25, 2026 15:37
AndriiPasternak31 and others added 2 commits March 25, 2026 15:59
Resolved conflict in docs/memory/feature-flows.md — both Abilityai#76 (MCP URL
config) and Abilityai#148 (subscription encryption key fix) added entries to the
same Recent Updates table on the same date. Kept both entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolved 4 merge conflicts caused by upstream security fixes (Abilityai#174, Abilityai#175, Abilityai#176, Abilityai#172),
agent event subscriptions (Abilityai#169), and Slack transport management (SLACK-002) landing
on main while this branch had the MCP URL config feature (Abilityai#76):

- changelog.md: Kept both — upstream entries (newer dates) above our Abilityai#76 entry
- feature-flows.md: Added both EVT-001 and Abilityai#76 rows in date order
- settings.py: Merged imports (added Optional from upstream + urlparse from ours)
- Settings.vue: Combined all parallel loads (added loadSlackTransportStatus from upstream to existing Promise.all)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@vybe vybe left a comment

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.

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

2 participants