A beautiful command-line chat interface that connects to MCP (Model Context Protocol) servers and supports multiple AI providers. Chat with LLMs while leveraging the power of MCP tools directly from your terminal.
- 🤖 Multiple AI Providers: Support for OpenAI, Anthropic, Google, and OpenRouter
- 🔌 MCP Server Integration: Connect to any MCP-compatible server (stdio, HTTP, SSE)
- 🛠️ Tool Calling: Automatically invoke MCP tools during conversations
- 🎨 Beautiful UI: Terminal UI built with React and Ink
- 💬 Interactive Chat: Real-time streaming responses with tool execution display
- ⚙️ Flexible Configuration: JSON-based configuration for both AI providers and MCP servers
# Clone the repository
git clone https://github.com/abhignakumar/chat-mcp-cli
cd chat-mcp-cli
# Install dependencies
npm install
# Build the project
npm run build
# Run the application
npm startThe application requires two configuration files in your working directory:
Configure your AI provider and model:
{
"apiProvider": "openai",
"model": "gpt-5.2",
"apiKey": "your-api-key"
}Supported Providers:
openai- OpenAI models (GPT-5.2, GPT-5.2-pro, etc.)anthropic- Anthropic models (Claude Opus 4.5, etc.)google- Google Gemini modelsopenrouter- OpenRouter models
See example-config.json for a template.
Configure your MCP servers:
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"Authorization": "Bearer your-api-key"
},
"disabled": false
},
"local-server": {
"type": "stdio",
"command": "node",
"args": ["server.js"],
"env": {
"API_KEY": "value"
},
"disabled": false
}
}
}Server Types:
http- HTTP-based MCP serversse- Server-Sent Events MCP serverstdio- Local stdio-based MCP server
Options:
disabled- Set totrueto disable a serverdisabledTools- Array of tool names to disable
See example-mcp.json for a template.
# From the project directory (with config.json and mcp.json in current directory)
npm start
# Or run the file directly
node dist/cli.js- Type your message and press Enter to chat
- Type
/exitor/quitto exit the application
The CLI features:
- Welcome Screen: Shows connected MCP servers, current model, and working directory
- Chat History: Displays conversation with user messages and AI responses
- Tool Execution: Shows when tools are called and their results
- Input Box: Interactive text input at the bottom
- Status Indicator: Shows when the AI is processing or streaming
src/cli.tsx- Entry point that renders the React appsrc/app.tsx- Main application component with chat logic and MCP integrationsrc/mcp-client.ts- MCP client wrapper for connecting to serverssrc/utils.ts- Utility functions for configuration and AI model setupsrc/types.ts- TypeScript types and Zod validation schemassrc/components/- React components for the terminal UI
- Ink - React for interactive command-line apps
- @ai-sdk - AI SDK for multiple providers
- @modelcontextprotocol/sdk - MCP Client SDK
- Zod - Schema validation