Skip to content

Cannot access internal class 'McpClient' here #805

@yanBrandao

Description

@yanBrandao

Describe the bug
I'm trying to replicate some sample of Elicitation McpClient or QuickstartClient but it's not working, there's missing class dependencies. My .csproject have this:

<ItemGroup>
        <PackageReference Include="ModelContextProtocol" Version="0.3.0-preview.4" />
        <PackageReference Include="ModelContextProtocol.Core" Version="0.3.0-preview.4" />
       ....

To Reproduce
Steps to reproduce the behavior:

  1. Create new repository
  2. Install ModelContextProtocol and ModelContextProtocol.Core too
  3. In your Program.cs try to use McpClient class

Expected behavior
McpClient should work correctly like documentation specify.

Logs

/path/to/myproject/Sample.MCP.Client/Program.cs(23,27): error CS0246: The type or namespace name 'HttpClientTransport' could not be found (are you missing a using directive or an assembly reference?)
/path/to/myproject/Sample.MCP.Client/Program.cs(37,35): error CS0122: 'McpClient' is inaccessible due to its protection level

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions