Gsheet Slack MCP
MCP server: Gsheet Slack MCP
Installation
npx gsheet-slack-mcpAsk AI about Gsheet Slack MCP
Powered by Claude · Grounded in docs
I know everything about Gsheet Slack MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Environment Variables
Create a .env file (not committed) using .env.example as a template. Do not commit real secrets.
See .env.example for the full list of keys. The important ones are:
SLACK_WEBHOOK_URLGOOGLE_SHEETS_SPREADSHEET_IDGOOGLE_APPLICATION_CREDENTIALS(either a single-line JSON or a filesystem path to a JSON file that is not committed)
G-Sheet Slack MCP Server
Project Overview
This project is an MCP (Model Context Protocol) server designed to integrate Google Sheets and Slack, enabling powerful AI-driven automation and analysis workflows. It serves as a refactor from a low-level Server class to a high-level McpServer class, addressing issues with disabled tools in Claude Desktop and adopting proper tool registration patterns.
Our primary goal is to provide a robust and extensible platform for:
- Loading and analyzing hypotheses from Google Sheets.
- Updating Google Sheets with analysis results.
- Sending notifications to Slack channels.
This server leverages the @modelcontextprotocol/sdk to expose its functionalities as discoverable tools for compatible MCP clients, such as Claude Desktop.
Features
- Google Sheets Integration: Seamlessly load and update data from specified Google Sheets.
- Slack Integration: Send rich notifications to Slack channels based on analysis results or other triggers.
- Hypothesis Management: Tools for loading, analyzing, and updating business hypotheses stored in Google Sheets.
- AI-Powered Analysis: Designed to work with LLMs (e.g., Claude) via MCP for tasks like hypothesis enrichment and scoring.
- Tool-Based Architecture: Implements the latest MCP guidelines for robust and discoverable tools.
- ESM Compatibility: Uses modern JavaScript modules (
.jsextensions) for better compatibility and performance.
Getting Started
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher recommended)
- npm (Node Package Manager)
- Google Cloud Project with Google Sheets API enabled and credentials downloaded.
- Slack App with necessary permissions and a Bot Token.
Installation
-
Clone the repository:
git clone https://github.com/your-username/G-Sheet-MCP.git cd G-Sheet-MCP -
Install dependencies:
npm install
Configuration
-
Google Sheets API Credentials:
- Follow the Google Cloud documentation to create a service account and enable the Google Sheets API.
- Download your service account key file (usually
service-account.json). - Place this file in the root of the
G_Sheet-MCPdirectory or configure the path insrc/config/index.ts.
-
Slack Bot Token:
- Create a Slack App, add a bot, and grant it the necessary permissions (e.g.,
chat:write,channels:read). - Obtain your Bot User OAuth Token (starts with
xoxb-). - Set this as an environment variable or configure it in
src/config/index.ts.
- Create a Slack App, add a bot, and grant it the necessary permissions (e.g.,
-
MCP Configuration (
claude_desktop_config.json):- Copy
claude_desktop_config.example.jsontoclaude_desktop_config.json. - Update the
pathinclaude_desktop_config.jsonto the absolute path of yourserver.tsfile:{ "mcp_servers": [ { "path": "/Users/your-username/Work/Gsheet_Slack_Mcp/G_Sheet-MCP/dist/server.js" } ] } - Important: The
pathshould point to the compiledserver.jsfile in thedistdirectory.
- Copy
Running the Server
-
Compile the TypeScript code:
npm run build -
Start the MCP Server:
npm startThe server will start and listen for MCP client connections, typically via standard I/O (stdio).
-
Integrate with Claude Desktop (or other MCP Clients):
- Ensure Claude Desktop is configured to load MCP servers from your
claude_desktop_config.json. - Restart Claude Desktop to pick up the changes. You should see the registered tools available.
- Ensure Claude Desktop is configured to load MCP servers from your
Available Tools
This MCP server registers the following tools, which can be invoked by an MCP client:
-
load_hypotheses:- Description: Loads hypotheses from a specified Google Sheet.
- Input: Sheet ID, Range.
- Output: JSON array of hypotheses.
-
analyze_hypothesis:- Description: Analyzes a given hypothesis using an internal LLM (via MCP sampling) for enrichment or scoring.
- Input: Hypothesis text, Analysis type (e.g., 'enrichment', 'scoring').
- Output: JSON object with analysis results.
-
update_hypotheses:- Description: Updates a Google Sheet with new or modified hypothesis data.
- Input: Sheet ID, Range, Data to update.
- Output: Confirmation of update.
-
slack_notification:- Description: Sends a message to a specified Slack channel.
- Input: Channel ID, Message text.
- Output: Confirmation of message sent.
Usage Examples
Example: Loading Hypotheses from Google Sheets
An MCP client (e.g., Claude Desktop) could invoke this tool like:
{
"tool_name": "load_hypotheses",
"parameters": {
"sheetId": "YOUR_GOOGLE_SHEET_ID",
"range": "Sheet1!A1:D10"
}
}
Example: Sending a Slack Notification
{
"tool_name": "slack_notification",
"parameters": {
"channelId": "YOUR_SLACK_CHANNEL_ID",
"message": "A new set of hypotheses has been loaded for review."
}
}
Development Workflow
- Consult MCP Documentation: Always refer to the official MCP documentation for the latest specifications and best practices.
- Incremental Development: Build and test tools individually.
- Debugging: Use MCP inspector tools if available for debugging tool registration and invocation.
- Testing: Validate end-to-end functionality within your chosen MCP client (e.g., Claude Desktop).
Troubleshooting
- Tools not appearing in Claude Desktop:
- Ensure
claude_desktop_config.jsonpoints to the correct absolute path ofdist/server.js. - Restart Claude Desktop after any configuration changes.
- Verify that the server is running without errors (
npm start).
- Ensure
- Google Sheets API errors:
- Check if the
service-account.jsonfile is correctly placed and has the right permissions. - Ensure the Google Sheets API is enabled in your Google Cloud Project.
- Check if the
- Slack notification issues:
- Verify your Slack Bot Token is correct and has the necessary permissions.
- Check the channel ID.
- MCP Server startup issues:
- Review terminal output for any errors during
npm install,npm run build, ornpm start. - Ensure Node.js version compatibility.
- Review terminal output for any errors during
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests. _
Made with ❤️ by Nasif
