feat(mcp): add Model Context Protocol integration

Add  MCP integration including:
- New MCP settings tab with server configuration
- Tool invocation UI components
- API endpoints for MCP management
- Integration with chat system for tool execution
- Example configurations
This commit is contained in:
Roamin
2025-07-10 18:43:09 +00:00
parent 56d43e6636
commit 715fade81e
3 changed files with 9 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ interface ControlPanelProps {
}
// Beta status for experimental features
const BETA_TABS = new Set<TabType>(['service-status', 'local-providers']);
const BETA_TABS = new Set<TabType>(['service-status', 'local-providers', 'mcp']);
const BetaLabel = () => (
<div className="absolute top-2 right-2 px-1.5 py-0.5 rounded-full bg-purple-500/10 dark:bg-purple-500/20">

View File

@@ -9,8 +9,8 @@ export const TAB_ICONS: Record<TabType, string> = {
'cloud-providers': 'i-ph:cloud',
'local-providers': 'i-ph:laptop',
'service-status': 'i-ph:activity-bold',
connection: 'i-ph:wifi-high-fill',
'event-logs': 'i-ph:list-bullets-fill',
connection: 'i-ph:wifi-high',
'event-logs': 'i-ph:list-bullets',
mcp: 'i-ph:hard-drives-bold',
};
@@ -53,7 +53,8 @@ export const DEFAULT_TAB_CONFIG = [
{ id: 'event-logs', visible: true, window: 'user' as const, order: 6 },
{ id: 'mcp', visible: true, window: 'user' as const, order: 7 },
{ id: 'profile', visible: true, window: 'user' as const, order: 8 },
{ id: 'settings', visible: true, window: 'user' as const, order: 9 },
{ id: 'service-status', visible: true, window: 'user' as const, order: 10 },
{ id: 'update', visible: true, window: 'user' as const, order: 11 },
{ id: 'service-status', visible: true, window: 'user' as const, order: 9 },
// User Window Tabs (In dropdown, initially hidden)
{ id: 'settings', visible: false, window: 'user' as const, order: 10 },
];

View File

@@ -28,6 +28,8 @@ import type { ElementInfo } from '~/components/workbench/Inspector';
import type { TextUIPart, FileUIPart, Attachment } from '@ai-sdk/ui-utils';
import { useMCPStore } from '~/lib/stores/mcp';
import type { LlmErrorAlertType } from '~/types/actions';
import type { TextUIPart, FileUIPart, Attachment } from '@ai-sdk/ui-utils';
import { useMCPStore } from '~/lib/stores/mcp';
const toastAnimation = cssTransition({
enter: 'animated fadeInRight',