Gemini Context MCP Server
MCP server for Cursor that leverages Gemini's much larger context window to enhance the capabilities of the AI tools
Overview
Gemini Context MCP Server is a powerful implementation of the Model Context Protocol (MCP) that enhances AI tools by leveraging Gemini's extensive 2M token context window for context management and caching.
To use the server, clone the repository, install dependencies, set up your environment variables with your Gemini API key, and start the server using Node.js.
- Up to 2M token context window support for extensive context capabilities. - Session-based conversations to maintain state across interactions. - Smart context tracking with metadata for efficient context management. - Semantic search for finding relevant context. - Automatic context cleanup and cache management for optimized performance.
- Managing complex conversational contexts in AI applications.
- Caching large prompts to reduce token usage costs.
- Integrating with tools like Cursor for enhanced development experiences.
Add to your AI client
Use these steps to connect Gemini Context MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"gemini-context-mcp-server-ogoldberg": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gemini-context-mcp-server-ogoldberg"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"gemini-context-mcp-server-ogoldberg": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gemini-context-mcp-server-ogoldberg"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"gemini-context-mcp-server-ogoldberg": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gemini-context-mcp-server-ogoldberg"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"gemini-context-mcp-server-ogoldberg": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gemini-context-mcp-server-ogoldberg"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"gemini-context-mcp-server-ogoldberg": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gemini-context-mcp-server-ogoldberg"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"gemini-context-mcp-server-ogoldberg": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gemini-context-mcp-server-ogoldberg"
]
}
}
}FAQ
**What is the maximum context size supported?**
The server supports a maximum context size of 2M tokens.
**Is there a cost associated with using the Gemini API?**
Yes, usage of the Gemini API may incur costs based on the number of tokens processed.
**Can I use this server with other tools?**
Yes, it is compatible with MCP tools like Cursor.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3821,"uuid":"e05a5c90-1051-4ce4-8599-a92782a7da5d","name":"gemini-context-mcp-server","title":"Gemini Context MCP Server","description":"MCP server for Cursor that leverages Gemini's much larger context window to enhance the capabilities of the AI tools","avatar_url":"https://avatars.githubusercontent.com/u/127390?v=4","created_at":"2025-03-21T20:41:01.249Z","updated_at":"2025-03-21T20:56:42.265Z","status":"created","author_name":"ogoldberg","author_avatar_url":"https://avatars.githubusercontent.com/u/127390?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/ogoldberg/gemini-context-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"14\",\"license\":\"\",\"language\":\"TypeScript\",\"is_official\":false,\"latest_commit_time\":\"2025-04-07 09:41:15\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]