io.github.houtini-ai/google-knowledge-graph

搜索与获取

by houtini-ai

搜索 Google Knowledge Graph,获取现实世界实体的结构化信息与关联数据。

什么是 io.github.houtini-ai/google-knowledge-graph

搜索 Google Knowledge Graph,获取现实世界实体的结构化信息与关联数据。

README

<div align="center"> <img src="https://raw.githubusercontent.com/houtini-ai/google-knowledge-graph-mcp/main/assets/logo.png" width="120" height="120" alt="Google Knowledge Graph MCP" /> </div>

Google Knowledge Graph Search MCP

npm version MCP Registry Known Vulnerabilities License: MIT MCP

Model Context Protocol server that connects Claude (or any MCP client) to Google's free public Knowledge Graph API. Search for real-world entities - people, places, organisations, concepts - and get structured data back.

<p align="center"> <a href="https://glama.ai/mcp/servers/@houtini-ai/google-knowledge-graph-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@houtini-ai/google-knowledge-graph-mcp/badge" alt="Google Knowledge Graph MCP server" /> </a> </p>

Quick Navigation

Why this exists | What you get | Installation | Getting your API key | Usage examples | Parameters | Entity types | Troubleshooting

What is this? An MCP server. If you don't know what that means, you probably don't need this. If you're using Claude Desktop or another MCP-compatible client and want to search Google's knowledge database, this is for you.

Why This Exists

I built this because I needed a way for Claude to verify entity information during research workflows. Google's Knowledge Graph contains structured data about millions of real-world entities - the same data that powers those knowledge panels in Google Search results.

The Knowledge Graph Search API is completely free. No billing account, no usage costs, just a Google Cloud API key. Most developers don't seem to know this exists, which is odd given how useful it is.

This MCP gives Claude (or any MCP client) access to that database.

What You Get

Two tools for searching Google's knowledge graph:

1. Search by query - search_knowledge_graph Search for entities by name or description. Returns structured data including entity types, descriptions, Wikipedia URLs, and relevance scores.

2. Lookup by MID - lookup_knowledge_graph_entities
If you already have Machine IDs (Google's internal entity identifiers), look them up directly. Useful for entity resolution workflows.

Both return JSON with:

  • Entity names and types
  • Detailed descriptions (usually from Wikipedia)
  • Official images and URLs
  • Result scores (relevance ranking)
  • Machine IDs for further lookups

Installation

NPX (Easiest)

Add this to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "google-knowledge-graph": {
      "command": "npx",
      "args": ["-y", "@houtini/google-knowledge-graph-mcp"],
      "env": {
        "GOOGLE_KNOWLEDGE_GRAPH_API_KEY": "your-api-key-here"
      }
    }
  }
}

Claude Code (CLI)

Claude Code uses a different registration mechanism -- it doesn't read claude_desktop_config.json. Use claude mcp add instead:

bash
claude mcp add \
  -e GOOGLE_KNOWLEDGE_GRAPH_API_KEY=your-api-key-here \
  -s user \
  google-knowledge-graph -- npx -y @houtini/google-knowledge-graph-mcp

Verify with:

bash
claude mcp get google-knowledge-graph

You should see Status: Connected.

Local Install

If you prefer running from source:

bash
git clone https://github.com/houtini/google-knowledge-graph-mcp.git
cd google-knowledge-graph-mcp
npm install
npm run build

Then configure Claude Desktop:

json
{
  "mcpServers": {
    "google-knowledge-graph": {
      "command": "node",
      "args": ["C:\\path\\to\\google-knowledge-graph-mcp\\dist\\index.js"],
      "env": {
        "GOOGLE_KNOWLEDGE_GRAPH_API_KEY": "your-api-key-here"
      }
    }
  }
}

Windows users: Use double backslashes in paths: C:\\MCP\\...

Config location:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Getting Your API Key

Google's Knowledge Graph Search API is free - no billing account, no card, no quota to unlock.

  1. Go to Google Cloud Console
  2. Create a new project (or select an existing one)
  3. Enable "Knowledge Graph Search API" in the API Library
  4. Navigate to "Credentials" and create an API key
  5. (Optional but recommended) Restrict the key to Knowledge Graph Search API only

That's it. No credit card, no billing setup.

Usage Examples

Once installed and Claude Desktop is restarted, you can:

Basic entity search:

code
Search the knowledge graph for "Marie Curie"

Entity type filtering:

code
Search knowledge graph for "Python" with types ["ComputerLanguage"]

Multiple results:

code
Search knowledge graph for "Paris" limit 5

Lookup by MID:

code
Look up knowledge graph entity /m/0dl567

The MCP returns structured JSON that Claude can parse. You'll get entity names, types, descriptions, URLs, and relevance scores.

What Gets Returned

Example response structure:

json
{
  "entities": [
    {
      "mid": "/m/0dl567",
      "name": "Taylor Swift",
      "type": ["Person", "Thing"],
      "description": "American singer-songwriter",
      "detailedDescription": "Taylor Alison Swift is an American singer-songwriter...",
      "image": "https://...",
      "url": "http://en.wikipedia.org/wiki/Taylor_Swift",
      "resultScore": 4258.07
    }
  ],
  "count": 1
}

Parameters

search_knowledge_graph

  • query (required): Search term
  • languages (optional): Language codes array, e.g. ["en"]
  • types (optional): Entity types to filter by, e.g. ["Person", "Organization"]
  • limit (optional): Max results (default 20, max 500)

lookup_knowledge_graph_entities

  • ids (required): Array of Machine IDs (MIDs), e.g. ["/m/0dl567"]
  • languages (optional): Language codes array

Common Entity Types

The Knowledge Graph uses schema.org types. Common ones:

  • Person - Individual people
  • Organization - Companies, institutions
  • Place - Locations, geographical entities
  • Event - Historical or current events
  • CreativeWork - Books, films, music, art
  • Product - Commercial products
  • ComputerLanguage - Programming languages
  • SportsTeam - Sports teams
  • Country - Nations and countries
  • City - Cities and municipalities

You can combine types for more specific searches.

Troubleshooting

MCP not appearing in Claude:

  1. Check your JSON syntax - one error breaks everything
  2. Verify the path uses correct escaping (\\ on Windows)
  3. Completely restart Claude Desktop (quit, not just minimise)
  4. Check the API key environment variable spelling

"API key required" error:

  • The environment variable isn't being read
  • Check spelling: GOOGLE_KNOWLEDGE_GRAPH_API_KEY
  • Restart Claude Desktop after config changes

No results returned:

  • Try different query terms
  • Remove entity type filters to broaden search
  • Check result limit isn't set too low

401 Unauthorized:

  • API key is invalid or expired
  • Knowledge Graph Search API isn't enabled in your Google Cloud project

Building From Source

bash
npm install
npm run build

The build process compiles TypeScript to CommonJS in dist/. No special configuration needed.

Technical Details

  • API Endpoint: https://kgsearch.googleapis.com/v1/entities:search
  • Response Format: JSON-LD with itemListElement array
  • Authentication: API key via query parameter
  • Rate Limits: Free tier quotas apply (generally 100,000 queries/day)
  • Module Format: CommonJS (compatible with Node.js MCP hosts)

Why CommonJS?

The MCP SDK uses CommonJS patterns. I've stuck with that for compatibility. If you're building your own MCP and want ES modules, that's fine - just different choices.

Contributing

If you find issues or have improvements:

  1. Check existing issues first
  2. Test your changes locally
  3. Submit a PR with clear description

I'm particularly interested in hearing about:

  • Entity types that need better handling
  • Response parsing edge cases
  • Real-world usage patterns

Licence

MIT - do what you want with it.

Author

Built by Richard Baxter (Houtini) as part of a collection of MCP servers for AI-assisted development and research workflows.

Other Houtini MCPs:

  • @houtini/gemini-mcp - Google AI chat with grounding and deep research
  • @houtini/geo-analyzer - Content optimisation for AI search engines
  • @houtini/brevo-mcp - Email marketing automation

Related


Version: 1.0.0
Status: Production ready, tested with Claude Desktop

常见问题

io.github.houtini-ai/google-knowledge-graph 是什么?

搜索 Google Knowledge Graph,获取现实世界实体的结构化信息与关联数据。

相关 Skills

技能搜索

by daymade

Universal
热门

通过CCPM直接搜索、查看、安装、更新和卸载Claude Code Skill,适合查找PDF、代码审查等场景插件,也能列出已装Skill并自动执行命令返回结果。

想给Claude Code找对技能时,用它能一站式搜索、安装和管理CCPM注册表里的能力,省去到处翻找的时间。

搜索与获取
未扫描1.3k

深度研究

by daymade

Universal
热门

围绕既定模板拆题、多轮检索、整理证据表并交叉校验引用,产出格式严格、可追溯的研究报告,适合市场调研、竞品分析、政策追踪等高要求写作任务

把网页搜索、信息检索和研究分析串成一条链路,适合需要快速汇总线索、做深度判断的开发与研究工作。

搜索与获取
未扫描1.3k

标准研究员

by levnikolaevich

Universal

基于项目技术栈和 Epic/Story 需求,用 MCP Ref 检索相关 RFC、行业标准与架构模式,整理成可直接写入 Story Technical Notes 的研究结论与参考链接。

做技术方案时先让标准研究员帮你查标准与设计模式,基于 MCP Ref 产出可复用的技术注释研究,省下大量检索整理时间。

搜索与获取
未扫描549

相关 MCP Server

网页抓取

编辑精选

by Anthropic

热门

Fetch 是 MCP 官方参考服务器,让 AI 能抓取网页并转为 Markdown 格式。

这个服务器解决了 AI 直接处理网页内容时格式混乱的问题,适合需要让 Claude 分析在线文档或新闻的开发者。不过作为参考实现,它缺乏生产级的安全配置,你得自己处理反爬虫和隐私风险。

搜索与获取
89.8k

Brave 搜索

编辑精选

by Anthropic

热门

Brave Search 是让 Claude 直接调用 Brave 搜索 API 获取实时网络信息的 MCP 服务器。

如果你想让 AI 助手帮你搜索最新资讯或技术文档,这个工具能绕过传统搜索的限制,直接返回结构化数据。特别适合需要实时信息的开发者,比如查 API 更新或竞品动态。不过它依赖 Brave 的 API 配额,高频使用可能受限。

搜索与获取
89.7k

by Anthropic

热门

Puppeteer 是让 Claude 自动操作浏览器进行网页抓取和测试的 MCP 服务器。

这个服务器解决了手动编写 Puppeteer 脚本的繁琐问题,适合需要自动化网页交互的开发者,比如抓取动态内容或做端到端测试。不过,作为参考实现,它可能缺少生产级的安全防护,建议在可控环境中使用。

搜索与获取
89.2k

评论