This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
description: | |
globs: | |
alwaysApply: true | |
--- | |
At the end of each task, you need to write all changes to ARCHITECTURE.md. | |
And by write all changes, I mean modify the architecture of the entire app. If you've changed a function - modify its params/output or whatever you changed. | |
If you've added a new file - add it to the ARCHITECTURE.md. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Command, CommandGenerator, CommandOptions } from '../../types.js'; | |
import { loadEnv, loadConfig } from '../../config.js'; | |
import { RunCommand } from '../mcp/run.js'; | |
import { MarketplaceManager } from '../mcp/marketplace.js'; | |
import { | |
MCPAuthError, | |
MCPConnectionError, | |
MCPServerError, | |
MCPToolError, | |
MCPConfigError, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Core Architecture | |
MCP utilizes a **Host-Client-Server** architecture: | |
1. **Host:** This is the primary application integrating with AI/LLMs (e.g., Claude Desktop, an IDE like Cursor or Zed, a custom application). The Host's responsibilities include: | |
* Creating and managing multiple **Client** instances. | |
* Orchestrating interactions between the user, the AI model, and various Clients/Servers. | |
* Enforcing security policies, managing user consent, and handling authorization. | |
* Aggregating context from different sources before presenting it to the LLM. | |
* Handling `sampling` requests initiated by Servers (acting as the intermediary to the actual LLM). |