-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
PythonagentbugSomething isn't workingSomething isn't workingclientdocumentationImprovements or additions to documentationImprovements or additions to documentationreadyWhen a PR is ready to be merged and waiting for author to mergeWhen a PR is ready to be merged and waiting for author to mergeserver
Description
Hello, I've just started using mcp-use with langgraph/langchain but got 2 issues.
Don't know if I missed anything from the document.
Error listing prompts for connector streamable HTTP
First I create new server using this template: https://mcp-use.com/docs/typescript/server/templates#%F0%9F%8E%A8-mcp-ui-template
After server started, I use with langchain adapter:
config = {
"mcpServers": {
"uiresource-mcp-server": {
"url": "http://localhost:3000/mcp"
},
}
}
try:
client = MCPClient(config=config)
# Creates the adapter for LangChain's format
adapter = LangChainAdapter()
# Convert tools from active connectors to the LangChain's format
await adapter.create_all(client)
# List concatenation (if you loaded all tools)
langchain_tools = adapter.tools + adapter.resources + adapter.prompts
# Create chat model
model = ChatOllama(
model="qwen3-vl:2b-instruct-q4_K_M",
temperature=0.2
)
# Create the LangChain agent
agent = create_agent(
model=model,
tools=langchain_tools,
system_prompt="You are a helpful assistant",
)
# Run the agent
result = await agent.ainvoke(
{
"messages": [
{
"role": "user",
"content": "use welcome-card",
}
]
}
)
except Exception as e:
print(f"Error: {e}")
raise eand here is the console output:
2025-12-04 23:57:56,587 - mcp_use - INFO - No active sessions found, creating new ones...
2025-12-04 23:57:56,595 - mcp_use - INFO - Using default callback port 8080
2025-12-04 23:57:56,623 - mcp_use - ERROR - Failed to discover OAuth/OIDC metadata for http://localhost:3000/mcp
2025-12-04 23:57:57,065 - mcp_use - ERROR - Error listing prompts for connector streamable HTTP:http://localhost:3000/mcp: Method not found
Welcome to MCP-UI! Your server is running and ready to serve interactive widgets!
Here are some details:
- Widget Types: 3
- Possibilities: ∞
- Fast & Simple: ⚡
Server: **uiresource-mcp-server v1.0.0**
Port: **3000**
Enjoy the experience!
Despite the error, the LLM still can answer and return the HTML for welcome-card
LangGraph Blocking call
Seem like MCP Client causing this error when authen, here is my code
async def graph():
config = {
"mcpServers": {
"uiresource-mcp-server": {
"url": "http://localhost:3000/mcp"
}
}
}
client = MCPClient(config=config)
# Creates the adapter for LangChain's format
adapter = LangChainAdapter()
# Convert tools from active connectors to the LangChain's format
await adapter.create_tools(client)
# List concatenation (if you loaded all tools)
langchain_tools = adapter.tools
print(langchain_tools)
# Create chat model
model = ChatOllama(
model="qwen3-vl:2b-instruct-q4_K_M",
temperature=0.2
)
# Create agent with MCP tools
agent = create_agent(
model=model,
tools=langchain_tools
)
return agentAnd got this error:
self.token_storage = token_storage or FileTokenStorage()
blockbuster.blockbuster.BlockingError: Blocking call to os.mkdir
Heads up! LangGraph dev identified a synchronous blocking call in your code. When running in an ASGI web server, blocking calls can degrade performance for everyone since they tie up the event loop.
Here are your options to fix this:
1. Best approach: Convert any blocking code to use async/await patterns
For example, use 'await aiohttp.get()' instead of 'requests.get()'
2. Quick fix: Move blocking operations to a separate thread
Example: 'await asyncio.to_thread(your_blocking_function)'
3. Override (if you can't change the code):
- For development: Run 'langgraph dev --allow-blocking'
- For deployment: Set 'BG_JOB_ISOLATED_LOOPS=true' environment variable
These blocking operations can prevent health checks and slow down other runs
Can anyone help, thank you!!!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PythonagentbugSomething isn't workingSomething isn't workingclientdocumentationImprovements or additions to documentationImprovements or additions to documentationreadyWhen a PR is ready to be merged and waiting for author to mergeWhen a PR is ready to be merged and waiting for author to mergeserver