loading…
Search for a command to run...
loading…
A FastMCP server providing session-based memory and dynamic authentication using LangChain and Google Gemini. It enables persistent conversation history trackin
A FastMCP server providing session-based memory and dynamic authentication using LangChain and Google Gemini. It enables persistent conversation history tracking through a session-ID system over HTTP transport.
This project implements a FastMCP server with session-based memory using LangChain and Google Gemini, along with a client that demonstrates multi-server session compatibility.
Clone the repository and install the dependencies:
pip install -r requirements.txt
Create a .env file based on the .env.example:
cp .env.example .env
Edit .env and add your GOOGLE_API_KEY.
Start the MCP server using the following command:
python server.py
By default, the server will run on http://127.0.0.1:8000/mcp.
In a new terminal, run the client:
python client.py
The server maintains state across multiple requests within the same session. You can verify this by following these steps in the client:
Inform the AI of your name:
HI my name is TapanHello Tapan! Nice to meet you. How can I help you today?Verify the memory:
what is my name?Your name is Tapan.This works because the session_id is tracked in the _session_histories dictionary on the server, ensuring that each user has a personalized and continuous conversation.
server.py: The FastMCP server implementation with Auth middleware and session handling.client.py: A Python client using MultiServerMCPClient to interact with the server..env.example: Template for environment variables.requirements.txt: Project dependencies.Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-middleware-server": {
"command": "npx",
"args": []
}
}
}