drio
Open app

MCP Server-Client Example

Source

Catalog onlyCatalog onlySTDIO

Overview

The MCP Server-Client Example is a demonstration of a basic implementation of the Model Context Protocol (MCP) using the TypeScript SDK. It features a server that provides access to resources and a client that connects to the server to request and read these resources.

To use this project, clone the repository and install the dependencies using npm. Run the server and client in separate terminal windows to see how they communicate and access resources.

  • Basic implementation of MCP using TypeScript - Functionality for resource listing and reading - Basic error handling for unknown resources
  1. Demonstrating client-server communication using the Model Context Protocol.
  2. Testing resource management and access in a controlled environment.
  3. Developing applications that require simple resource sharing and retrieval.

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": {
    "mcp-server-client-joeblockchain": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-client-joeblockchain"
      ]
    }
  }
}

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": {
    "mcp-server-client-joeblockchain": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-server-client-joeblockchain"
      ]
    }
  }
}

Claude Code

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

.mcp.json (project root)

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

VS Code (Copilot)

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

.vscode/mcp.json

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

Windsurf

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

~/.codeium/windsurf/mcp_config.json

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

Cline

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

Cline MCP Settings (via UI)

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

FAQ

What are the prerequisites for this project?

You need Node.js (v16 or higher) and npm to run the project.

How do I start the server and client?

Start the server by running `npm run start:server` and the client with `npm run start:client` in separate terminal windows.

How can new resources be added to the server?

To add new resources, modify the `ListResourcesRequestSchema` handler in the `src/index.ts` file.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":297,"uuid":"477ade11-5c4d-43d3-9264-8254f294f891","name":"mcp-server-client","title":"MCP Server-Client Example","description":null,"avatar_url":"https://avatars.githubusercontent.com/u/94577719?v=4","created_at":"$D2024-12-13T13:02:01.044Z","updated_at":"$D2024-12-13T15:09:09.271Z","status":"created","author_name":"joeBlockchain","author_avatar_url":"https://avatars.githubusercontent.com/u/94577719?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/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"}]]}]