Simple HTTP MCP Server
This project provides a lightweight server implementation for the Model Context Protocol (MCP) over HTTP. It allows you to expose Python functions as "tools" that can be discovered and executed remotely via a JSON-RPC interface. It is thought to be used with an Starlette or FastAPI application (see app/main.py).
How to test with Gemini Cli
- Install dependencies:
- Test the server:Note: you should be located on the root folder of the project so gemini config is used.
Example:
Features
- MCP Protocol Compliant: Implements the MCP specification for tool discovery and execution.
- HTTP Transport: Uses HTTP POST for communication.
- Async Support: Built on
Starlette
orFastAPI
for asynchronous request handling. - Type-Safe: Leverages
Pydantic
for robust data validation and serialization. - Dependency Management: Uses
uv
for fast and efficient package management. - Linting: Integrated with
Ruff
for code formatting and linting. - Type Checking: Uses
Mypy
for static type checking.
Getting Started
Prerequisites
Installation
- Clone the repository:
- Create a virtual environment and install dependencies:
Usage
For usage examples, please refer to the tests in the tests/
directory.
Development
This project uses several tools to ensure code quality.
Linting
To check for linting errors, run:
To automatically fix linting errors, run:
Type Checking
To run the static type checker, use:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A lightweight server implementation that exposes Python functions as discoverable tools via HTTP using the Machine-to-Machine Communication Protocol (MCP). Enables remote execution of Python functions through a JSON-RPC interface with async support and type safety.
Related MCP Servers
- -securityFlicense-qualityThis is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.Last updated -Python
- AsecurityAlicenseAqualityA server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.Last updated -324PythonMIT License
- -securityFlicense-qualityA Python implementation of the MCP server that enables AI models to connect with external tools and data sources through a standardized protocol, supporting tool invocation and resource access via JSON-RPC.Last updated -1Python
- -securityFlicense-qualityA Python template for building Model Context Protocol (MCP) servers that expose tools via JSON-RPC, enabling secure and scalable context and tool invocation for language models.Last updated -Python