MCP Discovery Node
Overview
The Model Context Protocol (MCP) enables communication with MCP-compliant servers through either HTTP or Stdio transports.
The MCP Discovery Node enables the ability to query an MCP servers and fetch Tools or Prompts in the server.
Currently, the MCP Discovery Node currently utilizes the following MCP request methods for a compliant server:
- MCP Tools :
tools/list
- MCP Prompts:
prompts/list
MCP Discovery Node uses the official MCP Typescript SDK (
@modelcontextprotocol/sdk
) and requires a node executor when running the graph in the Rivet IDE.
The MCP Discovery Node supports two communication modes:
- HTTP Mode: Uses Streamable HTTP Transport as default and a SSE Transport as a fallback for server communication.
- STDIO Mode: Launches and communicates with local MCP servers using STIDO Transport.
For STDIO connections with local servers, add the MCP server config in
Project > Edit MCP Configuration
- Inputs
- Outputs
- Editor Settings
Inputs
Title | Data Type | Description | Default Value | Notes |
---|---|---|---|---|
Name | string | The name for the MCP Client instance | mcp-client | Standard required parameter for an MCP Client |
Version | string | The version for the MCP Client instance | 1.0.0 | Standard required parameter for an MCP Client |
Server URL (HTTP) | string | The endpoint URL for the MCP server | None | Only available when using HTTP mode with Server URL Input enabled |
Outputs
Title | Data Type | Description | Notes |
---|---|---|---|
Tools | gpt-function[] | MCP tools returned by the MCP server | Returned from the tools/list method. Only availabe when Output Tools is enabled. |
Prompts | object | MCP prompts returned by the MCP server | Returned from the tools/list method. Only availabe when Output Prompts is enabled. |
Editor Settings
Setting | Description | Default Value | Use Input Toggle | Input Data Type |
---|---|---|---|---|
Output Tools | Whether to output tools | True | No | N/A |
Output Prompts | Whether to output prompts | True | No | N/A |
Name | The name to use for the MCP Client instance | mcp-client | Yes | string |
Version | The version to use for the MCP Client instance | 1.0.0 | Yes | string |
Transport Type | The mode of communication with the MCP server (HTTP or STDIO) | STDIO | No | N/A |
Server URL | The endpoint URL for the MCP server (Only HTTP) | http://localhost:8080/mcp | Yes | string |
Server ID | The MCP server ID from configuration (Only STDIO) | (empty) | No | N/A |
Configuration
Setting up MCP Servers (for STDIO mode)
Add a JSON configuration in your Rivet project: Project > MCP Configuration
Your MCP Configuration is saved and associated with the Rivet project file. All available servers will be list in MCP Nodes.
Example configuration:
{
"mcpServers": {
"mongodb": {
"command": "/path/to/node",
"args": ["-y", "/path/to/mcp-mongo-server/build/index.js", "mongodb://localhost:27017/your-database"]
}
}
}
Example 1: Using HTTP Mode
- Add an MCP Node to your graph
- Set "Transport Type" to "HTTP"
- Set "Server URL" to your MCP server URL (e.g.,
http://localhost:8080/mcp
) - Make sure enable the Node Executor in Rivet (top-right menu)
- Run the graph to see the response from the MCP server
Example 2: Using STDIO Mode with an example
This example references the example: Weather MCP Server
- First, ensure you have set up the Weather MCP server and configured it in your
Project > MCP Configuration
Example configuration:
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/absolute-path/weather/build/index.js"]
}
}
}
- Enable the Node Executor in Rivet (top-right menu)
- Add an MCP Discovery Node to your graph
- Set "Transport Type" to "STDIO"
- Set "Server ID" to "weather"
- Run the graph to see Tools and Prompts from the server
Error Handling
The MCP Node provides detailed error handling with specific error types:
CONFIG_NOT_FOUND
: MCP configuration file not foundSERVER_NOT_FOUND
: Specified server ID not found in configurationSERVER_COMMUNICATION_FAILED
: Failed to communicate with the serverINVALID_SCHEMA
: Invalid schema for input arguments
Troubleshooting
STDIO Server Not Found
- Check your MCP Configuration in your Rivet Project tab
- Ensure absolute paths in configuration
HTTP Connection Failed
- Verify server URL
- Check CORS settings
- Confirm network connectivity
Node Executor Issues
- Enable Node executor in Rivet settings
- Verify Node.js installation
- Check server executable permissions
FAQ
Q: Can I use the MCP Node in the browser executor?
A: No. All MCP nodes use the official MCP Node SDK and require the Node Executor to run locally.
Q: How do I handle authentication with MCP servers?
A:
For STDIO mode, authentication details should be included in your server configuration. For HTTP mode, this will be a follow-up feature and not accessible at the moment.
Q: Can I use multiple MCP servers in the same graph?
A: Yes, you can add multiple MCP Nodes, each can be configured to communicate with a different server.