MCPInstall
mcp logo

mcp

by sandeepkhokher 1 stars sandeepkhokher/mcp

MCP tools for client-server interaction and Ubuntu integration.

READMEmain

MCP (Model Context Protocol) Tools

This repository contains a complete MCP implementation with both client and server components, along with Claude Desktop for Ubuntu integration.

🚀 Overview

This project provides:

  • MCP Client: Python-based client to connect and interact with MCP servers
  • Weather MCP Server: Example implementation demonstrating MCP server capabilities
  • Claude Desktop for Ubuntu: Pre-built Debian package with build scripts
  • ElectronWrapper: Desktop app wrapper for Claude integration

📁 Repository Structure

claudeDesktop/
├── claude-desktop-debian/           # Claude Desktop Ubuntu Build
│   ├── scripts/                     # Build and setup scripts
│   ├── .codespellrc                 # Code spell checking config
│   ├── build.sh                     # Main build script
│   ├── claude-desktop_0.9.3_amd64.deb  # Pre-built Debian package
│   ├── LICENSE-APACHE               # Apache license
│   ├── LICENSE-MIT                  # MIT license
│   └── README.md                    # Build instructions
├── electronWrapper/                 # Electron desktop wrapper
├── mcp-client/                      # MCP Client Implementation
│   ├── .venv/                       # Python virtual environment
│   ├── .env                         # Environment variables
│   ├── .gitignore                   # Git ignore rules
│   ├── .python-version              # Python version specification
│   ├── client.py                    # Main MCP client code
│   ├── main.py                      # Entry point
│   ├── pyproject.toml               # Python project configuration
│   ├── README.md                    # Client documentation
│   └── uv.lock                      # UV dependency lock file
└── weather/                         # Weather MCP Server Example
    ├── .venv/                       # Python virtual environment
    ├── .python-version              # Python version specification
    ├── main.py                      # Weather server entry point
    ├── pyproject.toml               # Project configuration
    ├── README.md                    # Weather server documentation
    ├── uv.lock                      # Dependencies lock file
    ├── weather.py                   # Weather MCP server implementation
    └── .gitignore                   # Git ignore rules

🛠️ Getting Started

Prerequisites

  • Python 3.8+
  • UV package manager (pip install uv)
  • Anthropic API key
  • Ubuntu/Debian (for Claude Desktop installation)

Quick Setup

  1. Clone the repository

    git clone https://github.com/sandeepkhokher/mcp.git
    cd claudeDesktop
    
  2. Set up your Anthropic API key

    export ANTHROPIC_API_KEY="your-api-key-here"
    

    Get your API key from Anthropic Console

🏗️ Installation Options

Option 1: Use Pre-built Claude Desktop (Recommended)

cd claude-desktop-debian
sudo dpkg -i claude-desktop_0.9.3_amd64.deb
sudo apt-get install -f  # Fix any dependency issues

Option 2: Build Claude Desktop from Source

cd claude-desktop-debian
chmod +x build.sh
./build.sh

🌦️ MCP Client-Server Demo

Run Weather MCP Server Standalone

cd weather
uv run main.py

Test MCP Client with Weather Server

cd mcp-client
uv run client.py ../weather/weather.py

This demonstrates:

  • MCP client establishing connection with weather server
  • Server exposing weather-related tools and resources
  • Real-time communication through the MCP protocol
  • Tool execution and response handling

🔧 MCP Client Usage

The MCP client (mcp-client/client.py) can connect to various MCP servers:

# Connect to local MCP server
uv run client.py path/to/server.py

# Run client interactively
uv run main.py

Environment Configuration

Create .env file in mcp-client/ directory:

ANTHROPIC_API_KEY=your-api-key-here
MCP_SERVER_PATH=../weather/weather.py

🌍 Weather MCP Server

The weather server (weather/weather.py) provides:

  • Weather data retrieval tools
  • Location-based weather queries
  • Forecast information
  • Example of MCP server implementation patterns

Available Weather Tools

  • Current weather conditions
  • Weather forecasts
  • Location-based weather data
  • Historical weather information

🖥️ Claude Desktop Integration

  1. Install Claude Desktop using the provided Debian package
  2. Configure MCP servers in Claude Desktop settings:
    {
      "mcpServers": {
        "weather": {
          "command": "uv",
          "args": ["run", "main.py"],
          "cwd": "/path/to/weather"
        }
      }
    }
    
  3. Restart Claude Desktop to load MCP servers

📋 Development

Project Structure

  • UV Package Manager: All Python projects use uv for dependency management
  • Virtual Environments: Each component has isolated dependencies
  • Lock Files: uv.lock ensures reproducible builds
  • Python Version: Specified in .python-version files

Adding New MCP Servers

  1. Create new directory following the weather/ structure
  2. Implement MCP server using the weather server as template
  3. Add pyproject.toml and configure dependencies
  4. Test with MCP client

Development Commands

# Install dependencies
uv install

# Run with development mode
uv run --dev main.py

# Update dependencies
uv lock --upgrade

🐛 Troubleshooting

Common Issues

MCP Client Connection Failed:

# Check server is running
cd weather && uv run main.py

# Verify client configuration
cd mcp-client && uv run client.py --help

Claude Desktop Installation Issues:

# Fix dependency issues
sudo apt-get install -f

# Check installation
dpkg -l | grep claude

API Key Issues:

  • Verify API key is set: echo $ANTHROPIC_API_KEY
  • Check API key permissions in Anthropic Console
  • Ensure .env file is properly configured

🤝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature-name
  3. Follow existing code structure and naming conventions
  4. Test with both weather server and MCP client
  5. Update documentation as needed
  6. Submit pull request

📄 License

This project includes multiple license options:

  • Apache License 2.0 (LICENSE-APACHE)
  • MIT License (LICENSE-MIT)

See individual component directories for specific licensing.

🔗 Related Resources

📞 Support

  • Issues: Report bugs via GitHub Issues
  • Discussions: Use GitHub Discussions for questions
  • Documentation: Check individual README files in each component

Ready to explore MCP capabilities! 🚀 Start with the weather demo and build your own MCP servers.

More Developer Tools MCP servers

Similar servers from the same category.

Sourcebot

sourcebot-dev

Enables code search across multiple repository hosts including GitHub, GitLab, Gitea, Gerrit, and Bitbucket with advanced filtering options for exploring large codebases through natural language queries.

searchgit

CodeAlive

codealive-ai

Provides a bridge to CodeAlive's platform for semantic code search, repository exploration, and context-aware chat completions that leverage deep understanding of entire codebases including documentation and dependencies.

search

Provides a secure, sandboxed environment for executing Python, Node.js, and shell commands in ephemeral containers with file management capabilities for code testing, visualization, and data analysis.

filesystemdatabase

NovaCV

lightbaby

Integrates with NovaCV API to generate, analyze, and convert resumes in various formats without dealing with complex document formatting

PDFSupport+5