MCP: Model Context Protocol

Integrations

  • Uses FastAPI to create a REST API server that handles requests for managing conversation context and interacting with language models.

  • Integrates with Google Gemini API to enable context-aware conversations with the language model, allowing the system to maintain conversation history across multiple requests.

MCP: Model Context Protocol

Project Description

MCP (Model Context Protocol) is a system for managing context when interacting with language models (LLM). The system allows you to save the context of dialogs between requests, which allows the language model to "remember" previous interactions.

Peculiarities

  • Maintaining and managing context between requests
  • Integration with Google Gemini API
  • Possibility of using multiple independent sessions
  • Switching between sessions using identifiers
  • Local storage of dialog history

Technologies

  • Python 3
  • FastAPI
  • Gemini API
  • Uvicorn

Installation

  1. Clone repository:
git clone https://github.com/Alex-Replicator/mcp-letta.git cd mcp-letta
  1. Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # для Linux/Mac # или venv\Scripts\activate # для Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file and add the API key:
GEMINI_API_KEY=ваш_ключ_gemini_api

Usage

Starting the server

python mcp_server.py

The server will be available at: http://localhost:9999

Using the client

Send request (will create a new session):

python mcp_client.py --new "Ваш запрос к модели"

Continue the dialogue in the same session:

python mcp_client.py "Ваш следующий запрос"

Use a specific session by ID:

python mcp_client.py --id "id_сессии" "Ваш запрос"

Show list of all sessions:

python mcp_client.py --list

Project structure

  • mcp_server.py - Main MCP server
  • mcp_client.py - Client for interaction with the server
  • requirements.txt - Project dependencies

License

MIT

Author

Alex Replicator - alex.replicator@gmail.com

GitHub: https://github.com/Alex-Replicator/

-
security - not tested
F
license - not found
-
quality - not tested

A system that manages context for language model interactions, allowing the model to remember previous interactions across multiple independent sessions using Gemini API.

  1. Описание проекта
    1. Особенности
      1. Технологии
        1. Установка
          1. Использование
            1. Запуск сервера
            2. Использование клиента
          2. Структура проекта
            1. Лицензия
              1. Автор
                ID: vxi6hhm6li