Simple MCP Server Example logo

Simple MCP Server Example

by MCP-Mirror

This is a basic implementation of a Model Context Protocol (MCP) server using FastAPI. The server demonstrates the core concepts of MCP by providing a simple context service.

View on GitHub

Last updated: N/A

What is Simple MCP Server Example?

A basic MCP server implemented using FastAPI, providing a context service.

How to use Simple MCP Server Example?

  1. Install dependencies using pip install -r requirements.txt. 2. Run the server using uvicorn src.main:app --reload. 3. Use the / endpoint for health checks and the /context endpoint to get context for a prompt by sending a POST request with a JSON payload containing prompt_id and parameters.

Key features of Simple MCP Server Example

  • Basic health check endpoint

  • Context endpoint that processes prompt templates

  • Support for parameterized prompts

Use cases of Simple MCP Server Example

  • Providing context to language models

  • Building conversational AI applications

  • Implementing MCP in a simple server setup

FAQ from Simple MCP Server Example

What is MCP?

Model Context Protocol

What is FastAPI?

A modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints.

How do I install the dependencies?

Run pip install -r requirements.txt

How do I run the server?

Run uvicorn src.main:app --reload

What are the available endpoints?

/ for health check and /context for getting context for a prompt.