Skip to content

Title: Add py.typed so package is recognized as typed (PEP 561) #319

@DarkDk123

Description

@DarkDk123

Summary

langchain-mcp-adapters seems to have type-hints, but isn’t recognized as typed by mypy because it lacks a py.typed marker (PEP 561).

Steps to reproduce

uv pip install mypy langchain-mcp-adapters --system
uv run mypy -c "from langchain_mcp_adapters.client import MultiServerMCPClient"

Output:

uv run mypy -c "from langchain_mcp_adapters.client import MultiServerMCPClient"
<string>:1: error: Skipping analyzing "langchain_mcp_adapters.client": module is installed, but missing library stubs or py.typed marker  [import-untyped]
<string>:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
[ble: exit 1]

IMG: Image

Expected

If built with proper type-hints :

No “missing library stubs” error — mypy should use the inline hints.

Fix

  1. Add an empty py.typed file inside langchain_mcp_adapters/.
  2. Include it in the build:
[tool.setuptools.package-data]
"langchain_mcp_adapters" = ["py.typed"]

Should i release a PR, so mypy will recognize the types ?

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