2,500+ MCP servers ready to use
Vinkius

MTA MCP Server for LangChain 12 tools — connect in under 2 minutes

Built by Vinkius GDPR 12 Tools Framework

LangChain is the leading Python framework for composable LLM applications. Connect MTA through the Vinkius and LangChain agents can call every tool natively — combine them with retrievers, memory, and output parsers for sophisticated AI pipelines.

Vinkius supports streamable HTTP and SSE.

python
import asyncio
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

async def main():
    # Your Vinkius token — get it at cloud.vinkius.com
    async with MultiServerMCPClient({
        "mta": {
            "transport": "streamable_http",
            "url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
        }
    }) as client:
        tools = client.get_tools()
        agent = create_react_agent(
            ChatOpenAI(model="gpt-4o"),
            tools,
        )
        response = await agent.ainvoke({
            "messages": [{
                "role": "user",
                "content": "Using MTA, show me what tools are available.",
            }]
        })
        print(response["messages"][-1].content)

asyncio.run(main())
MTA
Fully ManagedVinkius Servers
60%Token savings
High SecurityEnterprise-grade
IAMAccess control
EU AI ActCompliant
DLPData protection
V8 IsolateSandboxed
Ed25519Audit chain
<40msKill switch
Stream every event to Splunk, Datadog, or your own webhook in real-time

* Every MCP server runs on Vinkius-managed infrastructure inside AWS - a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts optimized for native MCP execution. See our infrastructure

About MTA MCP Server

Connect your MTA API New York City public transit data platform to any AI agent and take full control of real-time NYC Subway and MTA Bus tracking, arrival predictions, LIRR and Metro-North commuter rail monitoring, and service disruption awareness through natural conversation.

LangChain's ecosystem of 500+ components combines seamlessly with MTA through native MCP adapters. Connect 12 tools via the Vinkius and use ReAct agents, Plan-and-Execute strategies, or custom agent architectures — with LangSmith tracing giving full visibility into every tool call, latency, and token cost.

What you can do

  • Subway Real-Time Feeds — Access live GTFS-RT data for all NYC Subway lines with train positions and arrival predictions
  • Bus Routes — List all MTA bus routes across Manhattan, Brooklyn, Queens, Bronx, and Staten Island
  • Bus Stops — Get all stops for any bus route with coordinates and sequence information
  • Bus Predictions — Get real-time estimated arrival times for any bus stop
  • Bus Vehicle Tracking — Track real-time GPS positions of all active MTA bus vehicles
  • Service Alerts — Monitor active disruptions across Subway, buses, LIRR, and Metro-North
  • Subway Stations — List all 472 NYC Subway stations with coordinates, borough, and entrance data
  • LIRR Tracking — Monitor Long Island Rail Road trains with real-time positions and arrivals
  • Metro-North Tracking — Track Metro-North Railroad trains serving northern NYC suburbs
  • Stop-Level Bus Monitoring — Monitor buses at specific stops with targeted arrival predictions
  • Estimated Arrivals — Get route-filtered arrival estimates for buses at any stop
  • System Connectivity — Verify API connectivity and synchronize timestamps

The MTA MCP Server exposes 12 tools through the Vinkius. Connect it to LangChain in under two minutes — no API keys to rotate, no infrastructure to provision, no vendor lock-in. Your configuration, your data, your control.

How to Connect MTA to LangChain via MCP

Follow these steps to integrate the MTA MCP Server with LangChain.

01

Install dependencies

Run pip install langchain langchain-mcp-adapters langgraph langchain-openai

02

Replace the token

Replace [YOUR_TOKEN_HERE] with your Vinkius token

03

Run the agent

Save the code and run python agent.py

04

Explore tools

The agent discovers 12 tools from MTA via MCP

Why Use LangChain with the MTA MCP Server

LangChain provides unique advantages when paired with MTA through the Model Context Protocol.

01

The largest ecosystem of integrations, chains, and agents — combine MTA MCP tools with 500+ LangChain components

02

Agent architecture supports ReAct, Plan-and-Execute, and custom strategies with full MCP tool access at every step

03

LangSmith tracing gives you complete visibility into tool calls, latencies, and token usage for production debugging

04

Memory and conversation persistence let agents maintain context across MTA queries for multi-turn workflows

MTA + LangChain Use Cases

Practical scenarios where LangChain combined with the MTA MCP Server delivers measurable value.

01

RAG with live data: combine MTA tool results with vector store retrievals for answers grounded in both real-time and historical data

02

Autonomous research agents: LangChain agents query MTA, synthesize findings, and generate comprehensive research reports

03

Multi-tool orchestration: chain MTA tools with web scrapers, databases, and calculators in a single agent run

04

Production monitoring: use LangSmith to trace every MTA tool call, measure latency, and optimize your agent's performance

MTA MCP Tools for LangChain (12)

These 12 tools become available when you connect MTA to LangChain via MCP:

01

get_bus_estimated_arrival

Returns predicted arrival times, route information, destinations, wait times, and delay indicators for each expected bus. Supports both multi-route stop queries and single-route filtered queries. Essential for targeted arrival predictions, route-specific wait time estimation, and passenger trip timing. AI agents should reference this when users ask "when is the next M15 at this stop", "show arrival estimates for route B46 at stop 12345", or need route-filtered arrival data at a specific bus stop. Get estimated arrival times for buses at a stop, optionally filtered by route

02

get_bus_predictions

Returns predicted arrival times, route IDs, destination information, expected wait times, and whether buses are on schedule or delayed. Based on real-time vehicle tracking and schedule adherence. Essential for real-time bus arrival awareness, passenger waiting time estimation, trip timing, and connection coordination. AI agents should reference this when users ask "when is the next M15 bus at stop 12345", "show predictions for this stop", or need real-time arrival data for a specific bus stop. Stop IDs can be found using get_bus_stops. Get next bus arrival predictions for a specific bus stop

03

get_bus_routes

Returns route IDs, route names, operators (MTA New York City Bus, MTA Bus Company, private operators under MTA contract), and service area information. Covers local, limited-stop, and Select Bus Service (SBS) routes. Essential for route discovery, service area analysis, transit network understanding, and identifying route IDs for use in stop and prediction queries. AI agents should reference this when users ask "list all bus routes in Manhattan", "what routes serve Brooklyn", or need to identify route IDs for subsequent MTA Bus Time queries. List all MTA bus routes in New York City

04

get_bus_stops

Returns stop IDs (MonitoringRef), stop names, geographic coordinates (latitude, longitude), stop sequence order, and direction information. Essential for stop discovery, journey planning, accessibility mapping, and identifying stop IDs for use in arrival prediction queries. AI agents should use this when users ask "list all stops on the M15", "find bus stops along Broadway", or need to identify stop IDs for use in get_bus_predictions queries. List all stops for a specific MTA bus route

05

get_bus_vehicle_at_stop

Returns vehicle IDs, route IDs, current positions, expected arrival times, distances from stop, and operational status. More targeted than system-wide vehicle queries. Essential for stop-level bus tracking, passenger waiting awareness, and real-time arrival estimation at specific stops. AI agents should use this when users ask "what buses are coming to this stop", "track vehicles approaching stop 12345", or need stop-specific bus position data for passenger information. Get buses currently at or approaching a specific bus stop

06

get_bus_vehicles

Returns vehicle IDs, route affiliations, latitude/longitude coordinates, heading direction, speed, recorded time, and prediction availability. Covers all MTA New York City Bus and MTA Bus Company vehicles in active service. Essential for real-time bus fleet monitoring, passenger arrival estimation, route-level service awareness, and transit operations management. AI agents should use this when users ask "where are all the buses right now", "track bus positions system-wide", or need real-time vehicle position data for fleet visualization. Get real-time positions of all active MTA bus vehicles

07

get_lirr_feed

Returns train positions, trip updates, scheduled vs. real-time arrivals at stations, delays, track information, and service disruptions across all LIRR branches including Babylon, Ronkonkoma, Hempstead, Port Jefferson, Montauk, and more. Essential for commuter rail tracking, arrival predictions at Penn Station and Grand Central Madison, and LIRR service monitoring. AI agents should reference this when users ask "when is the next LIRR train to Penn Station", "track LIRR train positions", or need real-time commuter rail data for trip planning from Long Island into NYC. Get real-time LIRR train data from the Long Island Rail Road

08

get_metro_north_feed

Returns train positions, trip updates, scheduled vs. real-time arrivals, delays, track information, and service disruptions across all Metro-North lines including Hudson, Harlem, New Haven, Port Jervis, Pascack Valley, and more. Essential for commuter rail tracking, arrival predictions at Grand Central Madison, and Metro-North service monitoring. AI agents should use this when users ask "when is the next Metro-North train from White Plains", "track Metro-North positions", or need real-time commuter rail data for trip planning from Westchester, Connecticut, or the Hudson Valley into NYC. Get real-time Metro-North Railroad train data

09

get_service_alerts

Returns alert descriptions, affected lines and stations, severity levels, cause types (maintenance, incident, weather, special events, construction), start and end timestamps, and alternative service recommendations. Essential for service disruption awareness, alternative route planning, passenger communication, and understanding system reliability. AI agents should use this when users ask "are there any delays on the 4/5/6 line", "is LIRR running normally", or need to check service reliability before planning MTA journeys. Get current service alerts and disruptions across the MTA system

10

get_stations

Returns station IDs, station names, complex IDs (for multi-line stations), borough information (Manhattan, Brooklyn, Queens, Bronx, Staten Island), structure types (underground, elevated, embankment, open cut), latitude/longitude coordinates, and North/East/South/West entrance coordinates. Essential for station discovery, rail network mapping, route planning, and identifying station codes for use in journey planning queries. AI agents should use this when users ask "list all stations in Manhattan", "what is the station code for Times Square", or need to understand the NYC Subway network geography. List all NYC Subway stations with details

11

get_subway_feed

Supports feed IDs grouped by line: "1" (lines 1,2,3,4,5,6,S), "2" (lines A,C,E), "3" (lines B,D,F,M), "4" (lines G), "5" (lines J,Z), "6" (lines N,Q,R,W), "7" (lines L), "11" (Staten Island Railway), "16" (Shuttle 42nd St), "21" (Shuttle Franklin Ave), "26" (Shuttle Rockaway Park). Returns train positions, trip updates, scheduled vs. real-time arrivals, delays, and service disruptions. Essential for real-time subway tracking, arrival predictions, and service monitoring across the entire NYC Subway system. AI agents should use this when users ask "when is the next 1 train", "show real-time positions for the A line", or need live subway data for trip planning. Feed IDs are required and can be found in MTA documentation. Get real-time subway feed data for specific NYC Subway lines

12

get_system_time

Returns the official server timestamp in ISO 8601 format. Useful for synchronizing local clocks with the MTA system, verifying API connectivity, testing authentication, and timestamp alignment for real-time data correlation. AI agents should use this as a connectivity check before making more complex queries, or when users need to verify API responsiveness and authentication validity. Get the current MTA Bus Time system timestamp

Example Prompts for MTA in LangChain

Ready-to-use prompts you can give your LangChain agent to start working with MTA immediately.

01

"Show me the next trains on the 1/2/3 line."

02

"When is the next M15 bus arriving at the stop near 14th Street and 3rd Avenue?"

03

"Check if there are any service alerts affecting the LIRR right now."

Troubleshooting MTA MCP Server with LangChain

Common issues when connecting MTA to LangChain through the Vinkius, and how to resolve them.

01

MultiServerMCPClient not found

Install: pip install langchain-mcp-adapters

MTA + LangChain FAQ

Common questions about integrating MTA MCP Server with LangChain.

01

How does LangChain connect to MCP servers?

Use langchain-mcp-adapters to create an MCP client. LangChain discovers all tools and wraps them as native LangChain tools compatible with any agent type.
02

Which LangChain agent types work with MCP?

All agent types including ReAct, OpenAI Functions, and custom agents work with MCP tools. The tools appear as standard LangChain tools after the adapter wraps them.
03

Can I trace MCP tool calls in LangSmith?

Yes. All MCP tool invocations appear as traced steps in LangSmith, showing input parameters, response payloads, latency, and token usage.

Connect MTA to LangChain

Get your token, paste the configuration, and start using 12 tools in under 2 minutes. No API key management needed.