RishabhSharma333/grok-mcp-cursor
If you are the rightful owner of grok-mcp-cursor and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The grok-mcp-cursor package provides a local Model Context Protocol (MCP) server for integrating with Cursor AI, utilizing the Grok AI model from xAI.
Grok MCP for Cursor
The grok-mcp-cursor
package provides a local Model Context Protocol (MCP) server, enabling integration with Cursor AI in agent mode. It leverages the Grok AI model from xAI to generate responses, offering a seamless experience for developers using Cursor.
Features
- Utilizes the Grok AI model to generate response.
- Compatible with Cursor AI via MCP server integration.
Prerequisites
- Node.js (version 16 or higher recommended)
- A valid Grok API key from xAI
Installation
-
Clone the Repository:
git clone https://github.com/RishabhSharma333/grok-mcp-cursor.git cd grok-mcp-cursor
-
Install Dependencies:
npm install
-
Build the Project:
npm run build
-
Configure Cursor MCP Settings:
- Locate the
mcp.json
file in the.cursor
directory of your user home folder. - Add the following configuration to
mcp.json
. :{ "mcpServers": { "grok-mcp": { "env": { "GROK_API_KEY": "<yourGrokAPIKeyHere>" }, "command": "node", "args": [ "<pathtoGrokMcpFolder>/build/index.js" ] } } }
- If any configuration is already present, make an new object under "mcpServers".
- Replace
<yourGrokAPIKeyHere>
with your Grok API key and<pathToGrokMcpFolder>
with the absolute path to thegrok-mcp-cursor
folder. - After configuration, the
grok-mcp
server will appear in Cursor’s MCP server settings, and thegrok-model
will be visible under tools.
- Locate the
Running the Server
To start the MCP server locally, execute the following command, replacing <yourGrokAPIKey>
with your Grok API key:
XAI_API_KEY=<yourGrokAPIKey> node <pathToGrokMcpFolder>/build/index.js
Verification
Before integrating with Cursor, to verify that the server runs correctly, we can use MCP inspector:
npx @modelcontextprotocol/inspector -e GROK_API_KEY=<yourGrokAPIKey> node <pathToGrokMcpFolder>/build/index.js
This command checks the server’s functionality and ensures it is operational.
Notes
- Ensure the
.env
file is not committed to version control. Add.env
to your.gitignore
file to prevent exposing sensitive information like API keys. - For production environments, consider setting environment variables directly on your server instead of relying on a
.env
file.
Contributing
Contributions are welcome! Please submit issues or pull requests via the GitHub repository.
License
This project is licensed under the MIT License. See the file for details.