Content
# google-devknowledge-mcp
MCP server that proxies the Google Developer Knowledge API with Bearer token auth, PII filtering, and structured audit logging.
---
## Prerequisites
- Node.js 20+
- A Google Cloud project with the Developer Knowledge API enabled
---
## 1. Get a Google API Key
1. Go to [console.cloud.google.com](https://console.cloud.google.com) → **APIs & Services** → **Library**
2. Search for **Developer Knowledge API** and enable it
3. Go to **APIs & Services** → **Credentials** → **Create Credentials** → **API Key**
4. Copy the key
---
## 2. Configure Environment
```bash
cp .env.example .env
```
Edit `.env`:
```env
GOOGLE_API_KEY=your_api_key_here
ALLOWED_TOKENS=token1,token2 # generate with: openssl rand -hex 32
PORT=3000 # optional, default 3000
```
Each value in `ALLOWED_TOKENS` is a Bearer token a client must present to access the server. Generate one per developer or integration.
---
## 3. Run
```bash
npm install
npm run build
npm start
```
**Development (hot reload):**
```bash
npm run dev
```
---
## 4. Connect to Claude
Add to your MCP client config (e.g. `claude_desktop_config.json`):
```json
{
"mcpServers": {
"google-devknowledge": {
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer your_token_here"
}
}
}
}
```
Verify the server is running:
```bash
curl http://localhost:3000/health
```
---
## Tools
| Tool | Description |
|---|---|
| `search_docs` | Full-text search across Google developer documentation |
| `get_doc_content` | Fetch full Markdown content for up to 20 doc pages by name |
---
## Environment Variables
| Variable | Required | Description |
|---|---|---|
| `GOOGLE_API_KEY` | Yes | Google Cloud API key with Developer Knowledge API enabled |
| `ALLOWED_TOKENS` | Yes | Comma-separated list of valid Bearer tokens |
| `PORT` | No | HTTP port (default: `3000`) |