drio
Open app

MCP Server-Client Example

Source

Mirror of

Catalog onlyCatalog onlySTDIO

Overview

The MCP Server-Client Example demonstrates a basic implementation of the Model Context Protocol (MCP) using the TypeScript SDK, showcasing how a server and client can communicate over stdio transport.

To use this project, clone the repository, install the dependencies, and run the server and client in separate terminal windows. The server provides access to resources, while the client connects to request these resources.

  • Basic implementation of the Model Context Protocol (MCP) - Server and client communication over stdio transport - Resource listing and reading functionality - Basic error handling for unknown resources
  1. Demonstrating server-client architecture using MCP.
  2. Learning how to implement resource management in a TypeScript environment.
  3. Testing and developing applications that require resource access via a protocol.

Add to your AI client

Use these steps to connect MCP Server-Client Example in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "joeblockchain-mcp-server-client-mcp-mirror": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-joeblockchain-mcp-server-client-mcp-mirror"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "joeblockchain-mcp-server-client-mcp-mirror": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-joeblockchain-mcp-server-client-mcp-mirror"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "joeblockchain-mcp-server-client-mcp-mirror": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-joeblockchain-mcp-server-client-mcp-mirror"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "joeblockchain-mcp-server-client-mcp-mirror": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-joeblockchain-mcp-server-client-mcp-mirror"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "joeblockchain-mcp-server-client-mcp-mirror": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-joeblockchain-mcp-server-client-mcp-mirror"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "joeblockchain-mcp-server-client-mcp-mirror": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-joeblockchain-mcp-server-client-mcp-mirror"
      ]
    }
  }
}

FAQ

What are the prerequisites for running this project?

You need Node.js (v16 or higher) and npm installed.

How do I add new resources?

Modify the `ListResourcesRequestSchema` handler in `src/index.ts` to include new resources.

Is there any error handling implemented?

Yes, the server includes basic error handling for unknown resources.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":635,"uuid":"28fbc021-85a0-4860-a5d7-77f55944d633","name":"joeBlockchain_mcp-server-client","title":"MCP Server-Client Example","description":"Mirror of","avatar_url":"https://avatars.githubusercontent.com/u/192820360?v=4","created_at":"2024-12-30T03:24:44.181Z","updated_at":"2025-02-23T07:15:12.994Z","status":"created","author_name":"MCP-Mirror","author_avatar_url":"https://avatars.githubusercontent.com/u/192820360?v=4","tags":"mcp,server-client,typescript,protocol","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/MCP-Mirror/joeBlockchain_mcp-server-client","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]