Skip to main content
Glama
Pacamaraprogress

Google Cloud Natural Language MCP Server

🧠 Google Cloud Natural Language API β€” MCP Server

A Model Context Protocol (MCP) server that connects Claude to the Google Cloud Natural Language API, enabling sentiment analysis, entity extraction, content classification, and syntax analysis as native Claude tools.

πŸ” No .env file needed. Your API key is stored securely in your local Claude Desktop config β€” it never touches this repo.


✨ Features

Tool

Description

analyze_sentiment

Detects overall and per-sentence emotional tone (-1.0 to +1.0)

extract_entities

Identifies people, places, orgs, dates, and more with salience scores

classify_content

Categorizes text using Google's content taxonomy with confidence scores

analyze_syntax

Tokenizes text and labels parts-of-speech and dependency roles


Related MCP server: Company MCP Server - Google Workspace Integration

πŸ“‹ Prerequisites

  • Python 3.10+

  • A Google Cloud account

  • The Cloud Natural Language API enabled in your GCP project

  • A valid Google API Key

  • Claude Desktop installed


πŸš€ Setup

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/google-nl-mcp-server.git
cd google-nl-mcp-server

2. Create a virtual environment

python -m venv venv
source venv/bin/activate        # macOS/Linux
venv\Scripts\activate           # Windows

3. Install dependencies

pip install -r requirements.txt

4. Add your API key to Claude Desktop config

Your API key is configured locally in Claude Desktop only β€” not in this repo. This means it is never exposed on GitHub.

Open your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following block, replacing the path and key with your own:

{
  "mcpServers": {
    "google-nl": {
      "command": "python",
      "args": ["/absolute/path/to/google-nl-mcp-server/server.py"],
      "env": {
        "GOOGLE_API_KEY": "AIza..."
      }
    }
  }
}

πŸ’‘ Use the absolute path to server.py on your machine (e.g. /Users/yourname/projects/google-nl-mcp-server/server.py on macOS).

Then restart Claude Desktop. The tools will appear automatically in Claude's tool picker.


πŸ§ͺ Example Usage with Claude

Once connected, you can ask Claude things like:

"Analyze the sentiment of this customer review: 'The product arrived late and was damaged. Very disappointing.'"

"Extract all the entities mentioned in this news article..."

"What category does this blog post belong to?"

"Break down the syntax of this sentence for me."

Claude will automatically call the appropriate tool and reason over the structured results.


πŸ“ Project Structure

google-nl-mcp-server/
β”œβ”€β”€ server.py             # Main MCP server
β”œβ”€β”€ requirements.txt      # Python dependencies
β”œβ”€β”€ .gitignore            # Keeps secrets out of git
└── README.md             # You are here

πŸ” Security Notes

  • Your API key lives only in claude_desktop_config.json on your local machine β€” never in this repo

  • Restrict your Google API key to the Natural Language API only via GCP Console

  • Consider adding API key IP restrictions for extra security


πŸ“š Resources


πŸ“„ License

MIT License β€” feel free to fork, modify, and use this in your own projects.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Enables managing Google Cloud Platform resources through natural language commands in Claude Desktop, supporting comprehensive operations across compute, storage, databases, networking, monitoring, and IAM without manual credential setup.
    56
    20
    -
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables Claude to interact with Google Workspace services including Gmail, Drive, Sheets, Docs, and Calendar. Provides comprehensive tools for reading, creating, and managing emails, files, spreadsheets, documents, and calendar events with built-in safety controls and audit logging.
    -