How to Use the Ayuntamiento de Zaragoza MCP in LangChain
Build intelligent pipelines for Zaragoza city services using LangChain to route 311 requests and book municipal appointments.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Ayuntamiento de Zaragoza MCP to LangChain
Create your Vinkius account to connect Ayuntamiento de Zaragoza to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Chain Zaragoza MCP Server data
LangChain ReAct agents parse incoming citizen complaints and route them through the `submit_open311_request` tool. You write the logic that decides if a pothole report needs immediate attention or just logs into the municipal database. The agent checks `list_open311_services` first to map the issue to the correct department ID. Tracing these interactions happens automatically in LangSmith. You see the exact token usage when the agent pulls historical data via `list_open311_requests` before creating a new ticket. Every input and output gets logged so you know exactly why the agent made a specific API call.
Automate Cita Previa booking
Municipal appointment scheduling requires multiple steps that fit perfectly into a LangGraph state machine. Your agent queries `list_agendas` to find the right office, checks `get_agenda_availability` for open slots, and finally executes the `book_appointment` MCP tool. The output of each node feeds directly into the next. Handling failures becomes trivial with built-in retry mechanisms. If `get_my_appointments` times out, the chain pauses and tries again without losing the user's session context. You control the exact execution flow from search to final booking confirmation.
Query semantic city datasets
Zaragoza publishes massive amounts of public data that your agent can query dynamically. Using `execute_sparql_query`, you pass raw SPARQL strings directly to the city's semantic web endpoint. The agent retrieves lists of restaurants, monuments, or bus stops and formats them for the user. Fallback chains handle cases where the complex SPARQL query fails. The system automatically pivots to `query_dataset` for simpler, REST-based data retrieval. You build resilience directly into the agent's decision tree.
Set up Ayuntamiento de Zaragoza MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes Ayuntamiento de Zaragoza tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"ayuntamiento-de-zaragoza-mcp": {
"transport": "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,
)
result = await agent.ainvoke({
"messages": "List recent Ayuntamiento de Zaragoza transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Ayuntamiento de Zaragoza. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Ayuntamiento de Zaragoza MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Ayuntamiento de Zaragoza MCP today
We host it, we monitor it, we maintain it. You just paste one token.