MCP ExplorerExplorer

Ts Mcp Client Server

@onenesson a year ago
5 MIT
FreeCommunity
AI Systems
MCP client and server with command line chat interface using Anthropic

Overview

What is Ts Mcp Client Server

ts-mcp-client-server is a project that implements a command line chat interface and a client-server architecture using the MCP protocol, leveraging the Anthropic API for natural language processing tasks.

Use cases

Use cases include creating interactive chat applications, testing language models, and developing tools that require real-time communication with AI systems.

How to use

To use ts-mcp-client-server, install the necessary dependencies via your package manager, set your ANTHROPIC_API_KEY in a .env.local file, build the project using ‘npm run build’, and run the MCP server or chat interface using ‘npm run mcp’ or ‘npm run chat’.

Key features

Key features include a command line chat interface, integration with the Anthropic SDK for API interactions, and a modular structure with separate files for client, server, and chat functionalities.

Where to use

ts-mcp-client-server can be used in various fields such as software development for building chatbots, natural language processing applications, and any scenario requiring command line interaction with AI models.

Content

MCP client and server example

src
├── chat.ts   # command line chat interface to Claude completion
├── client.ts # MCP client that starts MCP server with stdio transport
├── index.ts  # Node run script to start MCP server or Chat CLI
├── llm.ts    # Uses Anthropic SDK to talk to Claude API
└── server.ts # MCP server that exposes tools and executes them

Depends

NPM                  # install with your package manager of choice (Recommend nix)
                     # nix shell nixpkgs#nodejs
ANTHROPIC_API_KEY='' # Put your key here in .env.local file

Build

npm run build

Run MCP stdio client/server demo

npm run mcp

Run CLI chat with Anthropic using MCP

npm run chat

TODO

NOTE: Used Claude and Gemini web chat interface to generate some
boiler plate code.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers