MCP Server logo

MCP Server

by uoky5217

This project is a learning project based on the MCP protocol, mainly used to learn how to implement an MCP Server. It includes API services using FastAPI and two MCP server implementations: stdio and SSE.

View on GitHub

Last updated: N/A

What is MCP Server?

This is a learning project for understanding and implementing an MCP (Model Context Protocol) server. It provides two different implementations: one using stdio for local execution and another using SSE (Server-Sent Events) for remote communication.

How to use MCP Server?

The project includes instructions for running both the stdio and SSE implementations. For stdio, you need to run the server.py script and configure the cline plugin accordingly. For SSE, you need to run both the API server (main.py in api_server) and the remote MCP server (remote_server.py in mcp_server), and then configure the cline plugin to connect to the SSE endpoint.

Key features of MCP Server

  • Four arithmetic operations (addition, subtraction, multiplication, division)

  • Real-time message transmission via SSE

  • Asynchronous HTTP client support

  • Strongly typed input validation

Use cases of MCP Server

  • Learning the MCP protocol

  • Implementing a simple microservice architecture

  • Testing and experimenting with different MCP server implementations

  • Integrating with the cline plugin for MCP communication

FAQ from MCP Server

What is MCP?

MCP stands for Model Context Protocol. It's a protocol for communication between different services.

What is the API server?

The API server is a set of API service interfaces implemented using the FastAPI library, simulating a Java backend service. It provides basic arithmetic operations.

What is the stdio implementation of the MCP server?

The stdio implementation is a local execution method where the MCP server is called directly from the client.

What is the SSE implementation of the MCP server?

The SSE implementation uses Uvicorn to create a service and uses the cline plugin's remote server method for connection.

What are the prerequisites for running this project?

You need Python 3.10+ and the dependencies listed in requirements.txt.