A Model Context Protocol (MCP) server that provides tools to download and query the Google Home API knowledge base.
- Download Tool: Downloads the Google Home API knowledge base from GitHub
- Query Tool: Provides the knowledge base content to AI clients for intelligent querying
- Type-Safe: Built with TypeScript and Zod validation
- Error Handling: Comprehensive error messages returned to MCP clients
npm install -g google-home-mcp-servergit clone https://github.com/timhuang1018/google-home-mcp-p1.git
cd google-home-mcp-p1
npm install
npm run buildUsing google-home-mcp-server@latest automatically fetches the latest version each time the server starts.
npm update -g google-home-mcp-servernpm run devDownloads the Google Home API knowledge base file from GitHub and saves it locally.
Parameters: None
Example:
Tool: download_google_home_knowledge
Queries the Google Home API knowledge base. Returns the file path to the knowledge base so the AI can use the Read tool to access relevant content as needed. This token-efficient approach allows the AI to selectively read sections as needed.
Parameters:
-
query_text(required): Your question about the Google Home API
Example:
Tool: query_google_home_api
Arguments: { "query_text": "How do I authenticate with Google Home API?" }
Note: The knowledge base file must be downloaded first using download_google_home_knowledge.
Add to your ~/.config/claude-code/claude_code_config.json:
{
"mcpServers": {
"google-home": {
"command": "npx",
"args": ["-y", "google-home-mcp-server@latest"]
}
}
}Add to your MCP configuration:
{
"mcpServers": {
"google-home": {
"command": "npx",
"args": ["-y", "google-home-mcp-server@latest"]
}
}
}If you installed globally with npm install -g google-home-mcp-server:
{
"mcpServers": {
"google-home": {
"command": "google-home-mcp-server"
}
}
}Important:
- Add
mcp/to your.gitignorein your workspace to exclude the downloaded knowledge base from version control. - Using
@latestensures you always get the most recent version when the MCP server starts.
For local development from source:
{
"mcpServers": {
"google-home": {
"command": "npx",
"args": ["-y", "tsx", "/absolute/path/to/google-home-mcp-p1/src/index.ts"]
}
}
}npx @modelcontextprotocol/inspector npx -y google-home-mcp-server@latestThis will open a web interface where you can:
- View available tools
- Test tool calls with arguments
- Inspect request/response payloads
- Debug error messages
google-home-mcp-p1/
├── src/
│ ├── index.ts # Main server entry point
│ ├── handlers/
│ │ ├── index.ts # Tool registration and routing
│ │ ├── download.ts # Download tool handler
│ │ └── query.ts # Query tool handler
│ ├── schemas/
│ │ └── tools.ts # Zod validation schemas
│ └── config/
│ └── constants.ts # Configuration constants
├── build/ # Compiled JavaScript (gitignored)
├── mcp/ # Downloaded knowledge base (gitignored)
│ └── google-home/
│ └── google-home-api-knowledge-base.txt
├── doc/
│ └── google-home-mcp-feature.md
├── package.json
├── tsconfig.json
└── README.md
- Transport: stdio (standard input/output)
- Protocol: MCP (Model Context Protocol) using JSON-RPC 2.0
-
SDK: Official
@modelcontextprotocol/sdkv1.0.4 - Validation: Zod schemas for type-safe argument validation
-
Error Handling: Application-level errors (
isError: true) returned to client
All errors are returned to the MCP client with descriptive messages:
- Network failures during download
- File not found errors
- Invalid arguments
- Permission errors
The AI client (Claude Code, Gemini CLI, etc.) can see these errors and handle them appropriately.
The query_google_home_api tool uses a token-efficient approach by returning the file path to the knowledge base instead of the full content. This allows the AI client to:
- Use the Read tool to selectively access relevant sections
- Minimize token consumption
- Understand context and semantics as needed
- Provide accurate, contextualized answers
- Handle follow-up questions naturally without re-sending entire content
- Node.js v18 or higher
- npm or yarn
-
npm run build- Compile TypeScript to JavaScript -
npm run dev- Run server in development mode with tsx -
npm start- Run compiled server
ISC