MCP Server

MCP Server

A modular Model Control Protocol server that provides tools for GitHub repository analysis, calculations, weather, time, and command execution via HTTP or stdio.

Category
Visit Server

README

MCP Server

A modular Model Control Protocol (MCP) server that provides tools for interacting with GitHub repositories.

Features

  • Modular design with extensible tool handlers
  • Support for both HTTP and stdio transport
  • GitHub repository analysis tools
  • Command execution capability
  • CORS support for cross-origin requests

Installation

  1. Install the required dependencies:
    pip install -r requirements.txt
    

Usage

HTTP Mode

Start the server in HTTP mode with optional host and port:

python server.py --http --host 0.0.0.0 --port 8000

This will start the server and make it accessible at http://localhost:8000 (or the specified host/port).

Stdio Mode

Start the server in stdio mode for direct pipe-based communication:

python server.py

This mode is used when the MCP server is called directly by a client through stdin/stdout.

Available Tools

The server provides the following tools:

  • get_time: Get the current time
  • calculate: Perform simple calculations
  • get_weather: Get mock weather data for a location
  • github_repo: Clone and analyze GitHub repositories
  • execute_command: Execute commands in the system shell

API Endpoints

When running in HTTP mode, the server provides the following endpoints:

  • GET /initialize: Initialize the connection and get available tools
  • GET /list_tools: List all available tools
  • POST /execute_tool: Execute a specific tool with arguments

Example API Usage

Execute a Tool

POST /execute_tool
Content-Type: application/json

{
  "name": "github_repo",
  "arguments": {
    "action": "clone",
    "repo_url": "https://github.com/example/repo.git"
  }
}

Extending the Server

To add a new tool:

  1. Create a new handler class in the handlers directory that extends BaseHandler
  2. Implement the execute method in your handler
  3. Register your handler in the _setup_handlers method in server.py
  4. Create a corresponding tool definition in the _setup_tools method

Testing

The server includes a comprehensive set of unit tests using pytest and pytest-asyncio.

Running Tests

To run the tests:

pytest

For more verbose output:

pytest -v

To run tests with code coverage:

pytest --cov=handlers --cov=utils

Adding New Tests

When adding new handlers, create corresponding test files in the tests directory:

  1. Create a test file named test_yourhandler.py
  2. Use pytest fixtures from conftest.py where appropriate
  3. Write tests for all public methods in your handler

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured