ai-assistant: Add ability to run mcp server from ai-assistant plugin#385
ai-assistant: Add ability to run mcp server from ai-assistant plugin#385
Conversation
aa9aa8e to
3bd4cbb
Compare
10b04e6 to
1b93e58
Compare
2620b42 to
fe38c68
Compare
c81b4a7 to
628ad14
Compare
1f9cd8a to
d9bb4cb
Compare
There was a problem hiding this comment.
It's important to do these standard things for PRs to speed reviews along:
- PR description
- screenshots or video
- steps to test each fix or piece of functionality
- link to the related issue
- If there are no tests at all, please justify this. Note that it will slow reviews down, and slow down future changes
- Document fields and functions. This speeds up the review, and helps speed up further changes.
- git commit messages with context of the modules changed in subject, AND a "why" in the git commit body unless it's covered in the git message subject.
ai-assistant: MCPSettings: Add MCP settings UI and Electron config API
- Add components/settings/MCPSettings.tsx: UI for configuring MCP servers (add/remove/toggle/edit),
uses window.desktopApi.mcp.getConfig/updateConfig when running in Electron, falls back to pluginStore.
- Extend ElectronMCPApi typings with getConfig and updateConfig for config persistence.
- Provide default server when enabling MCP with no servers, and a "Test MCP Connection" action.
Notes:
- Argument parsing is space-based (no quote handling).
- Ensure native side exposes getTools (used by the test action) and that updateConfig triggers any required client restart.
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive MCP (Model Context Protocol) integration to the AI assistant, enabling connection to external tools and services. It introduces tool approval workflows, intelligent argument processing, and enhanced tool management capabilities.
- Added MCP server configuration and management in Electron environments
- Implemented tool approval dialogs with inline confirmation UI
- Created intelligent argument processing using AI for MCP tools
- Added tool orchestration for multi-tool execution
Reviewed Changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| ai-assistant/src/utils/ToolConfigManager.ts | Added source tracking ('built-in' vs 'mcp'), MCP tool integration functions, and tool state initialization |
| ai-assistant/src/utils/ToolApprovalManager.ts | New approval manager for tool execution with session-based auto-approval |
| ai-assistant/src/utils/InlineToolApprovalManager.ts | Inline tool approval with user context extraction for intelligent argument processing |
| ai-assistant/src/langchain/tools/ToolManager.ts | Enhanced with MCP tool support, argument mapping, and formatter integration |
| ai-assistant/src/langchain/tools/ToolOrchestrator.ts | New orchestrator for analyzing and coordinating multi-tool execution |
| ai-assistant/src/langchain/formatters/MCPOutputFormatter.ts | AI-powered formatter for MCP tool output with markdown support |
| ai-assistant/src/langchain/LangChainManager.ts | Major updates for tool orchestration, inline approval, and argument enhancement |
| ai-assistant/src/components/mcpOutput/MCPOutputDisplay.tsx | Rich UI component for displaying formatted MCP tool results |
| ai-assistant/src/components/mcpOutput/MCPArgumentProcessor.ts | Intelligent argument processing with schema validation |
| ai-assistant/src/components/settings/MCPSettings.tsx | MCP server configuration UI with enable/disable controls |
| ai-assistant/src/components/common/InlineToolConfirmation.tsx | Inline tool confirmation component (exported via index) |
| ai-assistant/src/types/electron.d.ts | TypeScript definitions for Electron MCP API |
| ai-assistant/src/hooks/useClusterChangeNotifier.ts | Hook for monitoring cluster changes and notifying MCP servers |
Files not reviewed (1)
- ai-assistant/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
ai-assistant/src/langchain/tools/ToolManager.ts:226
- This statement is unreachable.
ai-assistant/src/langchain/tools/ToolManager.ts:258 - This statement is unreachable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'm working on this. |
|
Wtih Azure OpenAI provider gpt4 it's having issues. With ai-assistant installed from Plugin Catalog it's working.
https://mgns-eastus2.openai.azure.com/openai/deployments/gpt-4/chat/completions?api-version=2024-12… Status Code: 400 Bad Request |
03df319 to
f089f2f
Compare
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
The "white-space: pre-wrap" left lots of spacing around the text. Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
So we don't show very long descriptions in the tools dialog. Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Instead of just relying on editing JSON. Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com> Signed-off-by: René Dudfield <renedudfield@microsoft.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ashu8912 <aghildiyal@microsoft.com>
eaa6bcd to
82f7896
Compare

No description provided.