MCP Middleware Server
Integrates Google Gemini to provide a session-based AI assistant capable of maintaining conversation history and context across multiple requests.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Middleware ServerRemember that my name is Tapan and I'm working on the MCP project."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Middleware Server & Client
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.
Features
Session-based Memory: Each client session maintains its own conversation history.
Dynamic Authentication: API keys are passed via headers and used to initialize session-specific LLMs.
Streamable HTTP: Uses HTTP transport for robust session management.
Related MCP server: memory-engine-mcp
Setup Instructions
1. Prerequisites
Python 3.10+
A Google Gemini API Key
2. Installation
Clone the repository and install the dependencies:
pip install -r requirements.txt3. Environment Configuration
Create a .env file based on the .env.example:
cp .env.example .envEdit .env and add your GOOGLE_API_KEY.
Usage
Running the Server
Start the MCP server using the following command:
python server.pyBy default, the server will run on http://127.0.0.1:8000/mcp.
Running the Client
In a new terminal, run the client:
python client.pySession Compatibility Example
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:
Input:
HI my name is TapanAI Response:
Hello Tapan! Nice to meet you. How can I help you today?
Verify the memory:
Input:
what is my name?AI Response:
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.
Files
server.py: The FastMCP server implementation with Auth middleware and session handling.client.py: A Python client usingMultiServerMCPClientto interact with the server..env.example: Template for environment variables.requirements.txt: Project dependencies.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceFastMCP is a comprehensive MCP server allowing secure and standardized data and functionality exposure to LLM applications, offering resources, tools, and prompt management for efficient LLM interactions.Last updated3MIT
- Flicense-qualityDmaintenanceAn MCP server that provides persistent memory for AI agents by storing session snapshots, factual memories, and conversation summaries. It enables seamless continuity between interactions by allowing agents to restore previous emotional states and recall relevant past experiences.Last updated
- Alicense-qualityDmaintenanceMCP server with session-based authentication for AI assistants, providing secure access to a books database and currency conversion tools.Last updatedMIT
- Flicense-qualityDmaintenanceMCP server that dynamically extracts and manages user memory from LLM conversations, enabling consistent personalization across different models.Last updated7
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TapanBhavsar/mcp_middleware'
If you have feedback or need assistance with the MCP directory API, please join our Discord server