Skip to content

feat: Add MCP server settings tab#89

Merged
nfebe merged 2 commits into
mainfrom
feat/mcp-settings
Jul 21, 2026
Merged

feat: Add MCP server settings tab#89
nfebe merged 2 commits into
mainfrom
feat/mcp-settings

Conversation

@nfebe

@nfebe nfebe commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The agent gained an MCP server (flatrun/agent#186); this adds its settings surface. Operators can turn it on or off and, when on, see the endpoint and how external clients connect. The toggle applies live through the config API, so no restart is needed.

Operators can now enable or disable the agent's MCP server from settings
and, when it is on, see the endpoint and how external clients connect.
The toggle takes effect immediately without restarting the agent.
@sourceant

sourceant Bot commented Jul 21, 2026

Copy link
Copy Markdown

Code Review Summary

This PR successfully adds a new settings tab for the Model Context Protocol (MCP) server. It includes the necessary UI components, reactive state management, and API integration to enable/disable the server and view connection details. The implementation correctly respects user permissions and provides immediate feedback through notifications.

🚀 Key Improvements

  • Added MCP Server configuration tab with live update capability via configApi.
  • Included connection details (Endpoint, Transport, Auth) that update dynamically based on the server status.
  • Updated unit tests in src/views/SettingsView.test.ts to cover the new tab navigation and data structure.

💡 Minor Suggestions

  • Add a 'Copy to clipboard' button next to the MCP endpoint URL to improve the developer experience for external client configuration.
  • Use optional chaining for safer access to API response properties in fetchMcpSettings.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

const savingMcp = ref(false);

const mcpEndpoint = computed(() => {
const base = apiClient.defaults.baseURL || "/api";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To avoid potential double slashes in the URL (e.g., //mcp) if apiClient.defaults.baseURL ends with a slash, normalize the base path before appending the endpoint.

Suggested change
const base = apiClient.defaults.baseURL || "/api";
const base = (apiClient.defaults.baseURL || "/api").replace(/\/+$/, "");
try {
return new URL(`${base}/mcp`, window.location.origin).toString();
} catch {
return `${base}/mcp`;
}

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploying flatrun-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: fea1754
Status: ✅  Deploy successful!
Preview URL: https://8d6ddc2c.flatrun-ui.pages.dev
Branch Preview URL: https://feat-mcp-settings.flatrun-ui.pages.dev

View logs

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@nfebe
nfebe merged commit 5042bf1 into main Jul 21, 2026
5 checks passed
@nfebe
nfebe deleted the feat/mcp-settings branch July 21, 2026 15:51
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.

1 participant