P

mcp-server-example-v2

...
Created 12/2/2024bydabouelhassan

Language:

Python

Stars:

2

Forks:

1

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:

    pip install -r requirements.txt
    
  2. Run the server:

    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:

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

Publisher info

dabouelhassan's avatar

dabouelhassan

0
followers
5
following
3
repos

More MCP servers built with Python

apollo-io-mcp-server

MCP server that exposes the Apollo.io API functionalities as tools

By Edward Choh
mcp-openvision

MCP Server using OpenRouter models to get descriptions for images

By Nazruden2
DeepView MCP

Enables IDEs like Cursor and Windsurf to analyze large codebases using Gemini's extensive context window.

By ai-1st