Trying to connect zomato mcp server through langchain_mcp_adapters #356
Unanswered
Siddhant989
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import asyncio
import os
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
from langchain_mcp_adapters.tools import load_mcp_tools
from langgraph.prebuilt import create_react_agent
from langchain_google_genai import ChatGoogleGenerativeAI
if not os.getenv('GOOGLE_API_KEY'):
raise ValueError("GOOGLE_API_KEY environment variable is not set")
👇 This connects to the Zomato remote MCP
server_params = StdioServerParameters(
command="npx",
args=["mcp-remote", "https://mcp-server.zomato.com/mcp"],
)
async def main():
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
if name == "main":
asyncio.run(main())
Wrote this Code to call Zomato MCP Server and its tools and ask a query of this the problem is that it is loading the tools but unable to send query and hit the tool,
if anyone have any idea what is happening here Help to find the error
Beta Was this translation helpful? Give feedback.
All reactions