Skip to content

Having Troubles Getting OnlineMCP ToolsΒ #400

@MartinYTSo

Description

@MartinYTSo

There is an error with regards to the integration of langchain_mcp_adapters and online MCP tools

Lets say I wanted to use this Time MCP server: https://mcp.so/server/time/modelcontextprotocol

from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient(
    {
        "time": {
        "transport": "stdio",
        "command": "uvx",
        "args": [
            "mcp-server-time",
            "--local-timezone=America/New_York"
        ]
        }
    }
)

tools =  await client.get_tools()

I get this error:


---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
File c:\Users\epicr\OneDrive\Documents\GitHub\lca-lc-foundations\.venv\Lib\site-packages\mcp\os\win32\utilities.py:169, in create_windows_process(command, args, env, errlog, cwd)
    167 try:
    168     # First try using anyio with Windows-specific flags to hide console window
--> [169](file:///C:/Users/epicr/OneDrive/Documents/GitHub/lca-lc-foundations/.venv/Lib/site-packages/mcp/os/win32/utilities.py:169)     process = await anyio.open_process(
    170         [command, *args],
    171         env=env,
    172         # Ensure we don't create console windows for each process
    173         creationflags=subprocess.CREATE_NO_WINDOW  # type: ignore
    174         if hasattr(subprocess, "CREATE_NO_WINDOW")
    175         else 0,
    176         stderr=errlog,
    177         cwd=cwd,
    178     )
    179 except NotImplementedError:
    180     # If Windows doesn't support async subprocess creation, use fallback

File c:\Users\epicr\OneDrive\Documents\GitHub\lca-lc-foundations\.venv\Lib\site-packages\anyio\_core\_subprocesses.py:190, in open_process(command, stdin, stdout, stderr, cwd, env, startupinfo, creationflags, start_new_session, pass_fds, user, group, extra_groups, umask)
    188     kwargs["umask"] = umask
--> [190](file:///C:/Users/epicr/OneDrive/Documents/GitHub/lca-lc-foundations/.venv/Lib/site-packages/anyio/_core/_subprocesses.py:190) return await get_async_backend().open_process(
    191     command,
    192     stdin=stdin,
    193     stdout=stdout,
    194     stderr=stderr,
...
    370     return self._original_stdstream_copy
    371 msg = "fileno"
--> [372](file:///C:/Users/epicr/OneDrive/Documents/GitHub/lca-lc-foundations/.venv/Lib/site-packages/ipykernel/iostream.py:372) raise io.UnsupportedOperation(msg)

UnsupportedOperation: fileno

This is not the only error, every time I use stdio I get the UnsupportedOperation: fileno

If I substituted tools = await client.get_tools() for tools = client.get_tools() and then passed it on to create_agent:

agent = create_agent(
    model="gpt-5-nano",
    tools=tools,
    checkpointer=InMemorySaver()
)

It throws me an error:

from langchain.agents import create_agent
from langgraph.checkpoint.memory import InMemorySaver  
agent = create_agent(
    model="gpt-5-nano",
    tools=tools,
    checkpointer=InMemorySaver()
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions