trackmcp
Back to directory
dabouelhassan

mcp-server-example-v2

View on GitHub

A simple example of a Model Context Protocol Server implementation

2 stars PythonAI & Machine Learning Updated Feb 15, 2025

Documentation

Simple MCP Server Example

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.

Features

  • Basic health check endpoint
  • Context endpoint that processes prompt templates
  • Support for parameterized prompts

Setup

1. Install dependencies:

bash
pip install -r requirements.txt

2. Run the server:

bash
uvicorn src.main:app --reload

Usage

The server provides two endpoints:

1. GET / - Health check

2. POST /context - Get context for a prompt

Example request:

bash
curl -X POST http://localhost:8000/context \
  -H "Content-Type: application/json" \
  -d '{"prompt_id": "greeting", "parameters": {"time": "12:00 PM"}}'

Frequently asked questions

What is mcp-server-example-v2?

mcp-server-example-v2 is A simple example of a Model Context Protocol Server implementation

How do I install mcp-server-example-v2?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is mcp-server-example-v2 open source?

Yes — it is hosted on GitHub at https://github.com/dabouelhassan/mcp-server-example-v2 and has 2 stars.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP