MCP Client Bearer icon

MCP Client Bearer

Use MCP client with Bearer Token Authentication

Overview

This node provides integration with an MCP (Model Context Protocol) client using Bearer Token authentication. It supports two connection types to communicate with the MCP server:

  • Command Line (STDIO): Runs a local MCP server process via a command line interface.
  • Server-Sent Events (SSE): Connects to a remote MCP server over SSE with optional custom headers and endpoints.

The primary use case is to execute various operations against the MCP server, such as executing tools, listing available resources or prompts, reading specific resources, and retrieving prompt templates.

A common scenario is automating AI or model-related workflows where you want to invoke specialized tools or retrieve contextual data from an MCP server either locally or remotely. For example, you might execute a text generation tool with specific parameters or fetch a list of available AI models dynamically.

Properties

Name Meaning
Bearer Token Your API Bearer token for authentication, required especially when using the SSE connection type.
Connection Type Transport method to connect to the MCP server. Options:
- Command Line (STDIO): Run a local MCP server process.
- Server-Sent Events (SSE): Connect via SSE endpoint.
SSE URL Full URL for the Server-Sent Events endpoint (required if using SSE).
SSE Timeout (Ms) Timeout in milliseconds for SSE requests (minimum 1000 ms). Default is 60000 ms.
SSE Messages POST Endpoint (Optional) Optional separate URL endpoint for posting messages if different from the SSE URL.
SSE Additional Headers (JSON) Additional HTTP headers to send with SSE requests, specified as a JSON object (e.g., {"X-Custom-Header": "value"}).
Command The command to execute the MCP server process (required if using Command Line connection). Example: /path/to/mcp/server or mcp-server-command.
Arguments (Space Separated) Arguments to pass to the command, separated by spaces (optional). Example: --verbose --port 8080.
Environment Variables (Key=value Pairs, One per Line) Additional environment variables for the command process, one per line (optional). Example:
MY_VAR=123
Operation The operation to perform. Supported operations include:
- Execute Tool
- Get Prompt
- List Prompts
- List Resource Templates
- List Resources
- List Tools
- Read Resource
Resource URI URI of the resource to read (required if operation is "Read Resource").
Tool Name Name of the tool to execute (required if operation is "Execute Tool").
Tool Parameters Parameters to pass to the tool in JSON format (required if operation is "Execute Tool").
Prompt Name Name of the prompt template to get (required if operation is "Get Prompt").

Output

The node outputs JSON objects depending on the selected operation:

  • Execute Tool: Outputs { "result": <tool execution result> } where the result is the response from the executed tool, typically an object or stringified JSON.
  • List Resources: Outputs { "resources": [...] } — an array of available resources.
  • List Resource Templates: Outputs { "resourceTemplates": [...] } — an array of resource templates.
  • Read Resource: Outputs { "resource": { ... } } — the detailed content of a specific resource identified by URI.
  • List Tools: Outputs { "tools": [ { name, description, schema }, ... ] } — list of available tools with their input schemas.
  • List Prompts: Outputs { "prompts": [...] } — list of available prompt templates.
  • Get Prompt: Outputs { "prompt": { ... } } — details of a specific prompt template.

The node does not output binary data.

Dependencies

  • Requires an active MCP server accessible either via:
    • A local command line executable (with optional arguments and environment variables).
    • A remote Server-Sent Events (SSE) endpoint with Bearer token authentication.
  • Uses an API Bearer token credential for authentication, mandatory for SSE connections.
  • Relies on the MCP SDK client libraries bundled within the node.
  • No additional external services are required beyond the MCP server and valid credentials.

Troubleshooting

  • Missing Required Parameters: Errors will occur if required parameters like Bearer Token (for SSE), Command (for CMD), or Tool Name/Parameters (for Execute Tool) are missing.
  • Invalid JSON in Tool Parameters or Additional Headers: The node expects valid JSON for tool parameters and SSE additional headers; invalid JSON will cause parsing errors.
  • Connection Failures: If the MCP server is unreachable or the command fails to start, the node will throw connection errors. Verify the command path, network connectivity, and Bearer token validity.
  • Tool Not Found: When executing a tool, if the specified tool name does not exist on the MCP server, an error lists available tools.
  • Timeouts: SSE connections have configurable timeouts; too short a timeout may cause premature disconnections.
  • Environment Variable Conflicts: When using CMD connection, environment variables starting with a certain prefix are automatically passed through; conflicts or missing variables may affect execution.
  • Transport Errors: Any transport-level errors during communication with the MCP server will be surfaced as node errors.

Links and References

Discussion