fastmcp-server

fastmcp-server

0

FastMCP Server is a lightweight Model Context Protocol server designed to facilitate communication with AI models via an API built using FastAPI. It features flexible configuration through environment variables, supporting endpoints for messaging and server status checks.

FastMCP Server

FastMCP Server is a simple implementation of a Model Context Protocol (MCP) server using FastMCP. It provides an API for communication with AI models using the FastAPI framework.

Features

  • /chat endpoint: Receives user messages and returns responses from the AI model.
  • Configuration via environment variables: Allows flexible configuration for API keys and model selection.

Requirements

  • Python 3.9+
  • API key (e.g., Anthropic Claude API)

Installation

  1. Clone the repository.
  2. Create and activate a virtual environment.
  3. Install dependencies.
  4. Set environment variables.

Usage

  1. Start the server.
  2. Access http://localhost:8000 via browser or API client.
  3. Send POST requests to /chat endpoint.

API Specification

GET /

  • Endpoint to check the server status.

POST /chat

  • Parameters: message (string)
  • Response: AI model's response.