MCP ExplorerExplorer

Terminal Mcp

@onenesson 19 days ago
1 MIT
FreeCommunity
AI Systems
A terminal-based MCP client and server example for chat using Claude API.

Overview

What is Terminal Mcp

terminal-mcp is a client-server framework that facilitates communication with large language models (LLMs) like Claude through a command line interface. It allows users to interact with these models in a structured manner.

Use cases

Use cases for terminal-mcp include building chatbots, developing interactive AI applications, and creating tools for testing and experimenting with LLMs.

How to use

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

Key features

Key features of terminal-mcp include a command line chat interface, integration with the Anthropic SDK for LLM interactions, and a modular architecture that allows for easy extension and customization.

Where to use

terminal-mcp can be used in various fields such as software development, AI research, and educational tools where interaction with language models is required.

Content

Terminal MCP

src
├── chat.ts   # terminal 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 CLI chat with Anthropic using Terminal MCP

npm run chat

TODO

  • [ ] Refactor to make it to use plugins
  • [ ] Add coding agent capabilities

Tools

No tools

Comments