MCP Client Component
Use the MCP Client component to enable your agent to communicate with external tools, systems, and data sources that support the Model Context Protocol (MCP). This component acts as a universal adapter, allowing your agent to interact with a growing ecosystem of MCP-enabled services.
Why this matters
What You’ll Configure
- Important Limitations
- Configure the Connection
- Provide Inputs
- Handle the Output
- Best Practices
- Troubleshooting Tips
- What to Try Next
Step 1: Important Limitations
Please be aware of the current limitations of this component.
Current Limitations
Step 2: Configure the Connection
Set up the details for connecting and interacting with the external MCP server.
Setting | Required? | Description |
---|---|---|
MCP URL | Yes | The Server-Sent Events (SSE) URL of the MCP server you want to integrate with. |
Prompt | Yes | The natural language instruction that tells the MCP server what task to perform. You can use variables like {{prompt}} to inject dynamic content from other inputs. |
Model | Yes | Select the LLM that will be used to process requests and interact with the MCP server. |
System Prompt (Advanced) | No | An advanced setting that defines overarching behavior instructions for the client, similar to a system prompt in an LLM, providing context for how all requests should be handled. |
Step 3: Provide Inputs
The component has a default Prompt
input and allows for custom inputs to make your requests dynamic.
Input | Description |
---|---|
Prompt | The default input that is automatically injected into the Prompt setting using the {{prompt}} variable. Connect another component's output here to pass dynamic instructions. |
Custom Inputs | Click the + icon to add new inputs (e.g., query , file_id ). You can reference these in your Prompt or System Prompt settings. |
Step 4: Handle the Output
The component provides a single Output
containing the full response from the MCP server and allows you to define custom outputs to easily parse this response.
Output | Description |
---|---|
Output | The default output containing the complete, structured response from the MCP server. |
Custom Outputs | Click the + icon to add new outputs that extract specific data from the main Output (e.g., summary , status ). SmythOS automatically handles the parsing, so you only need to provide a name. |
Step 5: Best Practices
- Verify Your MCP Server: Before integrating, ensure the external MCP server is running and its SSE URL is correct and publicly accessible.
- Use a System Prompt for Context: If you need the MCP server to behave in a specific way across all requests (e.g., "always respond in JSON"), use the
System Prompt
field. - Structure Your Prompts: Write clear and direct prompts. If the MCP server supports multiple tools, specify which one you intend to use.
- Use Custom Outputs: For MCP servers that return structured data (like JSON), use custom outputs to neatly extract the specific fields you need for downstream components. This is much cleaner than parsing the raw
Output
with a Code component.
Step 6: Troubleshooting Tips
If your MCP Client is not responding correctly...
Step 7: What to Try Next
- Connect this component to a third-party MCP-enabled tool to extend your agent's capabilities with specialized functions.
- Use a GenAI LLM Component to generate a complex prompt, and then feed that prompt into the
MCP Client
. - Parse the
Output
from the MCP server using a JSON Filter Component to clean the data before storing it or using it in another step.