MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

M
MCP Chat Intelligent Cli Assistant

MCP server by Ansh-Ghawri

Created 9/7/2025
Updated 3 days ago
Repository documentation and setup instructions

🤖 MCP Chat - Intelligent CLI Assistant

Python 3.10+ MIT License Anthropic Claude

A powerful, extensible command-line interface that combines Claude AI with the Model Control Protocol (MCP) to create an intelligent document-aware assistant. Chat with Claude while seamlessly accessing, editing, and managing your documents through an intuitive CLI experience.

✨ Key Features

🎯 Smart Document Integration

  • Document Mentions: Reference documents with @filename.ext syntax for instant context
  • Resource Management: Built-in document storage and retrieval system
  • Content Extraction: Automatically includes document content in conversations

🛠️ Advanced Tool System

  • MCP Protocol: Extensible tool architecture for custom functionality
  • Document Tools: Read, edit, and format documents programmatically
  • Tool Chaining: Claude can use multiple tools in sequence to complete complex tasks

💬 Enhanced CLI Experience

  • Smart Auto-completion: Tab completion for commands and document names
  • Command System: Use /command syntax for specialized prompts
  • Auto-suggestions: Intelligent suggestions based on context
  • Rich Styling: Beautiful terminal interface with syntax highlighting

Performance & Reliability

  • Async Architecture: Non-blocking operations for smooth performance
  • Session Management: Persistent conversation history
  • Error Handling: Graceful error recovery and user feedback
  • Cross-platform: Works on Windows, macOS, and Linux

🔧 Developer-Friendly

  • Modular Design: Clean separation of concerns with extensible architecture
  • MCP Server: Custom server implementation for document management
  • Tool Framework: Easy-to-extend tool system for new capabilities
  • Type Safety: Full type annotations throughout the codebase

🚀 Quick Start

Prerequisites

Installation

Option 1: With UV (Recommended)

# Install UV (if not already installed)
pip install uv

# Clone and setup
git clone <your-repo-url>
cd cli_project

# Create environment and install dependencies
uv venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install -e .

# Configure environment
echo 'ANTHROPIC_API_KEY="your-api-key-here"' > .env
echo 'CLAUDE_MODEL="claude-3-5-sonnet-20241022"' >> .env

# Run the application
uv run main.py

Option 2: Standard Python

# Clone and setup
git clone <your-repo-url>
cd cli_project

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install anthropic python-dotenv prompt-toolkit "mcp[cli]>=1.8.0"

# Configure environment
echo 'ANTHROPIC_API_KEY="your-api-key-here"' > .env
echo 'CLAUDE_MODEL="claude-3-5-sonnet-20241022"' >> .env

# Run the application
python main.py

🎮 Usage Examples

Basic Chat

> Hello! How can you help me today?

Document Integration

> Analyze the key findings in @report.pdf

> Compare @financials.docx with @outlook.pdf

> What are the main requirements in @spec.txt?

Command System

> /format deposition.md
# Reformats document with proper markdown structure

> /summarize report.pdf
# Generates comprehensive document summary

Advanced Queries

> Based on @plan.md, what are the potential risks mentioned in @report.pdf?

> Create a timeline from the information in @deposition.md

🏗️ Architecture

Core Components

├── 🎯 main.py              # Application entry point
├── 🧠 core/
│   ├── claude.py           # Claude AI integration
│   ├── chat.py             # Base chat functionality  
│   ├── cli_chat.py         # CLI-specific chat features
│   ├── cli.py              # Terminal interface
│   └── tools.py            # Tool management system
├── 🔌 mcp_client.py        # MCP client implementation
├── 🖥️  mcp_server.py        # Document server
└── ⚙️  pyproject.toml       # Project configuration

Data Flow

  1. User Input → CLI processes commands and document references
  2. Context Building → Documents are fetched and formatted
  3. Claude Integration → AI processes query with full context
  4. Tool Execution → Claude can use tools for document operations
  5. Response → Formatted output delivered to user

🛠️ Available Tools

| Tool | Function | Usage | |------|----------|-------| | read_doc_contents | Read document content | Automatic with @mentions | | edit_document | Modify document content | Via Claude's tool use | | format | Convert to Markdown | /format filename |

📋 Sample Documents

The project includes sample documents for testing:

  • deposition.md - Legal testimony content
  • report.pdf - Technical report summary
  • financials.docx - Budget and expenditure data
  • outlook.pdf - Future performance projections
  • plan.md - Implementation roadmap
  • spec.txt - Technical requirements

🔧 Development

Adding New Documents

# In mcp_server.py
docs = {
    "your-doc.txt": "Your document content here",
    # ... existing docs
}

Creating Custom Tools

@mcp.tool(
    name="your_tool_name",
    description="What your tool does"
)
def your_tool(param: str = Field(description="Parameter description")):
    # Your tool logic here
    return result

Adding Custom Prompts

@mcp.prompt(
    name="your_prompt",
    description="Custom prompt description"
)
def your_prompt(doc_id: str = Field(description="Document ID")):
    return [base.UserMessage("Your prompt content")]

🎨 CLI Features

Smart Auto-completion

  • Commands: Type / and press Tab for available commands
  • Documents: Type @ and press Tab for document suggestions
  • Context-aware: Completions adapt to current input

Keyboard Shortcuts

  • Tab - Trigger auto-completion
  • Ctrl+C - Exit application
  • ↑/↓ - Navigate command history

Visual Enhancements

  • Syntax highlighted completions
  • Styled prompt interface
  • Clear command/response separation

🌟 Why This Project Rocks

  1. 🔥 Cutting-edge Integration: Combines the latest Claude AI with MCP for unprecedented capabilities
  2. 📚 Document Intelligence: Not just chat - your AI assistant knows your documents
  3. ⚡ Lightning Fast: Async architecture ensures responsive performance
  4. 🎨 Beautiful UX: Polished CLI experience with smart completions
  5. 🔧 Highly Extensible: Easy to add new tools, documents, and capabilities
  6. 🛡️ Production Ready: Robust error handling and session management

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Anthropic for the incredible Claude AI models
  • MCP Community for the Model Control Protocol
  • Python Community for the amazing ecosystem of tools

Ready to supercharge your CLI experience? ⭐ Star this repo and get started today!

🚀 Get Started📖 Documentation💬 Community

Quick Setup
Installation guide for this server

Install Package (if required)

uvx mcp-chat---intelligent-cli-assistant

Cursor configuration (mcp.json)

{ "mcpServers": { "ansh-ghawri-mcp-chat-intelligent-cli-assistant": { "command": "uvx", "args": [ "mcp-chat---intelligent-cli-assistant" ] } } }