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.
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
- 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:
- Create a new handler class in the
handlersdirectory that extendsBaseHandler - Implement the
executemethod in your handler - Register your handler in the
_setup_handlersmethod inserver.py - Create a corresponding tool definition in the
_setup_toolsmethod
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:
- Create a test file named
test_yourhandler.py - Use pytest fixtures from
conftest.pywhere appropriate - Write tests for all public methods in your handler
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.