NPR Station Data Microservice for AI Agents - n8n Workflow

Deploy a robust n8n workflow that converts the NPR Station Finder API into an MCP server. Use these specialized n8n templates for seamless AI agent integration and data retrieval.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI developers needing standardized tools for large language models (LLMs).
Users integrating NPR data into generative AI applications.
n8n automation specialists building centralized Microservice Component Protocol (MCP) servers.
Technical users looking for advanced n8n templates leveraging the $fromAI() functionality.

Overview

This comprehensive n8n workflow is designed to streamline the integration of external APIs, specifically the NPR Station Finder Service, into AI agent toolkits using the Microservice Component Protocol (MCP). Utilizing a specialized n8n trigger and designated HTTP Request tools, this setup allows AI agents to query NPR station data simply by formulating natural language requests.

By leveraging this n8n workflow as an MCP server, you provide a stable, well-defined interface, ensuring that the AI agent can accurately list stations based on criteria (like city, state, or location) or retrieve specific station metadata. This is a perfect example of how powerful n8n templates can be used to extend the capabilities of AI models without complex manual API orchestration.

How it Works

The core of this automation begins with the dedicated NPR Station Finder Service MCP Server n8n trigger. This n8n trigger activates the workflow, awaiting inbound requests from a connected AI agent.


  1. AI Request: An AI agent sends a request to the n8n trigger webhook URL, specifying the action it wishes to perform (e.g., 'List stations near Chicago' or 'Get details for station 123').

  2. Tool Selection: The MCP trigger identifies which tool corresponds to the request: either Get Stations 1 (List) or Get Station 1 (Retrieve).

  3. Parameter Extraction: The selected n8n node, a specialized HTTP Request tool, automatically extracts necessary parameters (like city, state, or stationId) from the AI request using the $fromAI() expression. This is a key feature of this n8n workflow, enabling dynamic, natural language input processing.

  4. API Execution: The n8n node executes the external HTTP API call to the NPR service, utilizing the credentials configured in the n8n template.

  5. Response: The NPR data is returned directly through the n8n trigger back to the originating AI agent, maintaining the original API structure, thus completing the transaction facilitated by the n8n automation.

Installation Guide

To deploy this n8n workflow and establish the MCP server, follow these steps:


  1. Import: Copy the provided JSON and import it directly into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Authentication: Configure the necessary credentials for the NPR API. The current n8n nodes use a 'Test Header Auth Cred' generic credential type (HTTP Header Auth). You must ensure this credential holds the required API key or token for the NPR Station Finder Service.

  3. Activate: Toggle the NPR Station Finder Service MCP Server n8n workflow to 'Active'. This makes the webhook publicly available.

  4. Retrieve URL: Copy the webhook URL provided by the n8n trigger node.

  5. Connect AI Agent: Paste this URL into your AI agent's configuration settings as the endpoint for the NPR Station Finder Service tool set. This completes the setup of this robust n8n template.

Node Details

This n8n workflow uses three primary n8n nodes to achieve its goal:

NPR Station Finder Service MCP Server (n8n trigger):
Function: Serves as the main entry point and communication hub for the AI agent, defining the server endpoint (path: npr-station-finder-service-mcp). This unique n8n trigger broadcasts the available tools to the AI agent.
Key Configuration: Configured to accept and process requests adhering to the Microservice Component Protocol.

Get Stations 1 (httpRequestTool n8n node):
Function: Lists multiple NPR stations based on various search criteria (zip code, city/state, or lat/lon coordinates).
Key Configuration: Query parameters (q, city, state, lat, lon) are dynamically populated using the expression ={{ $fromAI('parameterName', 'description', 'dataType') }}, allowing the AI model to define the search parameters.

Get Station 1 (httpRequestTool n8n node):
Function: Retrieves detailed metadata for a single station using its numeric ID.
* Key Configuration: The required path parameter stationId is dynamically pulled from the AI agent's request via ={{ $fromAI('stationId', 'The numeric ID of a station', 'number') }}, demonstrating precise parameter handling within the n8n node.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

A hacker by nature, programmer by trade ⚒️ I'm looking to collaborate on things that save human labor 📫 How to reach me Github👇 -> Discord

Featured*