This MCP server implementation allows you to leverage Google's Gemini AI models through Claude or other MCP clients by providing a compatible protocol interface. It fully supports the Model Context Protocol with SSE transport and integrates with Gemini 1.5 Pro.
The easiest way to use this server is by deploying it on Smithery AI:
GEMINI_API_KEY
: Your Google AI Studio API key for accessing Gemini modelsIf you prefer to run the server on your own machine:
# Clone the repository
git clone [repository-url]
# Install dependencies
npm install
# Set your Gemini API key
export GEMINI_API_KEY=your_key_here
# Start the server
npm start
Once your server is running (either on Smithery AI or locally), you can connect to it from any MCP client:
Copy the URL where your server is running:
http://localhost:3000
(or whatever port configured)In Claude Desktop:
For other MCP-compatible clients, follow the client's specific instructions for adding custom model servers, using your Gemini MCP server URL.
When connected, you'll have access to:
The server is configured via environment variables, making it easy to adjust settings as needed.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.