Get the FREE Ultimate OpenClaw Setup Guide →

ts -client

MCP client and server with command line chat interface using Anthropic

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio oneness-ts-mcp-client-server node dist/index.js

How to use

This MCP server example showcases a local client/server setup written in TypeScript that demonstrates an MCP server exposing tools and a CLI chat interface that talks to Claude via the Anthropic API. The project includes a CLI chat utility and an MCP client that starts the MCP server over a stdio transport, making it easy to run end-to-end within a single environment. After building, you can launch the MCP demo with the provided npm scripts to observe how requests flow from the CLI chat through the MCP client to the server and how tools are executed via the server.

How to install

Prerequisites:

  • Node.js (recommended via Node.js package manager)
  • npm installed
  • Access toAnthropic API key to use Claude features

Install and run:

  1. Clone or download the repository.
  2. Install dependencies: npm install
  3. Create an environment file or set vars:
    • Create .env.local with: ANTHROPIC_API_KEY=your_key_here
  4. Build the project: npm run build
  5. Run the MCP demo (stdio client/server): npm run mcp
  6. Optional: Run the CLI chat interface with Claude using MCP: npm run chat

Additional notes

Environment variables:

  • ANTHROPIC_API_KEY must be set to a valid Anthropic API key for Claude access.

Configuration tips:

  • The server exposes tools via MCP; ensure the dist/index.js (or the path used in the node command) is generated by your build step.
  • If you modify environment dependencies or require different APIs, update .env.local accordingly.

Common issues:

  • If npm run mcp fails due to missing transpiled files, ensure npm run build completes successfully.
  • If Claude calls fail due to invalid API keys, verify the ANTHROPIC_API_KEY is correct and that network access is allowed.

Related MCP Servers

Sponsor this space

Reach thousands of developers