Skip to content

feat(extension): add IRpcClient interface and RpcClient for pipe client mode #22

@CalvinAllen

Description

@CalvinAllen

Parent Epic

Part of #18 - STDIO Transport Support

Description

Create new RpcClient in the VS Extension that connects as a pipe CLIENT to an external Server.exe (inverse of existing RpcServer which is a pipe server).

Implementation

New File: src/CodingWithCalvin.MCPServer/Services/IRpcClient.cs

namespace CodingWithCalvin.MCPServer.Services;

public interface IRpcClient : IDisposable
{
    bool IsConnected { get; }
    Task ConnectAsync(string pipeName);
    Task DisconnectAsync();
}

New File: src/CodingWithCalvin.MCPServer/Services/RpcClient.cs

  • Mirror of existing RpcServer pattern but as NamedPipeClientStream
  • ConnectAsync to connect to existing pipe
  • Implements IVisualStudioRpc by delegating to IVisualStudioService
  • MEF exported service ([Export(typeof(IRpcClient))])
  • Handles disconnection events

Key Features

  • Connect to named pipe as client
  • Delegate all VS operations to IVisualStudioService
  • Handle pipe disconnection gracefully
  • Expose IsConnected state

Reference

Use src/CodingWithCalvin.MCPServer/Services/RpcServer.cs as pattern reference (invert server/client relationship).

Acceptance Criteria

  • IRpcClient interface created
  • RpcClient class created with MEF export
  • Named pipe client connectivity working
  • Disconnection handling
  • Proper delegation to IVisualStudioService

Metadata

Metadata

Assignees

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