MCP Client

Conecta a um MCP Server para buscar informações

Overview

This node connects to an MCP Server to fetch information by making HTTP requests to specified endpoints. It supports various HTTP methods (GET, POST, PUT, DELETE) and allows sending parameters either as query parameters or request body in JSON format. The node requires a JWT token for authorization. It is useful for integrating with MCP Server APIs to retrieve or manipulate data such as products, clients, or other resources.

Use Case Examples

  1. Fetching a list of products from the MCP Server using a GET request to the /produtos endpoint.
  2. Creating a new client record by sending a POST request with client data in JSON format to the /clientes endpoint.
  3. Updating product information with a PUT request including JSON parameters.
  4. Deleting a resource using a DELETE request to a specific endpoint.

Properties

Name Meaning
URL do MCP Server Base URL of the MCP Server to connect to (e.g., http://meuservidor:3000). This is required to form the full request URL.
Endpoint The specific API endpoint on the MCP Server to query (e.g., /produtos, /clientes). This is appended to the base URL.
Método HTTP The HTTP method to use for the request, such as GET, POST, PUT, or DELETE.
Parâmetros (JSON) JSON-formatted parameters to include in the request. For GET requests, these are sent as query parameters; for other methods, they are sent in the request body.
Token JWT JWT token used for authorization with the MCP Server. This token must be obtained beforehand and is required for the request.

Output

JSON

  • json - The JSON response data returned from the MCP Server after the HTTP request.

Dependencies

  • axios HTTP client library for making requests to the MCP Server

Troubleshooting

  • Invalid JSON parameters: If the 'Parâmetros (JSON)' field contains malformed JSON, the node will throw an error indicating invalid JSON parameters. Ensure the JSON is correctly formatted.
  • Authorization errors: If the JWT token is missing or invalid, the MCP Server may reject the request, resulting in an error. Verify the token is correct and has not expired.
  • Connection errors: If the server URL or endpoint is incorrect or the server is unreachable, the node will throw an error indicating failure to connect or fetch data.
  • HTTP method misuse: Ensure the HTTP method matches the intended operation and that parameters are correctly placed (query for GET, body for others).

Discussion