Google Knowledge Graph

io.github.houtini-ai由 GitHub 账号 houtini-ai 发布v1.0.10更新于 Oct 25, 2026

Search Google's Knowledge Graph for structured information about real-world entities

概览

AI 生成的概览

让助手搜索 Google 知识图谱,获取人物、地点、组织与概念等现实实体的结构化信息,并可按 MID 查询实体。

可以做什么
  • 按名称或主题搜索实体,可限定语言、实体类型与返回数量
  • 用先前搜索得到的 Machine ID(MID)直接查询指定实体
  • 每个实体返回结构化 JSON:名称、类型、描述、图片与维基百科链接、相关度分数和 MID
适用场景
适合在调研流程中核实或补充实体信息、把实体解析为 Google MID,或获取现实事物的简短结构化描述,而不必抓取网页。
运行要求
通过 npm 包(Node.js/npx)或本地构建的源码以 stdio 在本机运行。需要一个已启用 Knowledge Graph Search API 的 Google Cloud API 密钥,通过环境变量 GOOGLE_KNOWLEDGE_GRAPH_API_KEY 提供。需要访问 Google API 的网络连接。
安装前请注意
API 密钥会作为查询参数随每次请求发送给 Google,建议将该密钥限制为仅可用于 Knowledge Graph Search API。查询词与查询的实体都会发送给 Google。该 API 免费、无需计费账户,但受免费额度限制。仅读取,不写入或删除数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Google Knowledge Graph,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Google Knowledge Graph Search MCP

[npm version] [MCP Registry] [Known Vulnerabilities] [Socket Badge] [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.

[Google Knowledge Graph MCP server]

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-ai/google-knowledge-graph-mcp.gitcd google-knowledge-graph-mcpnpm installnpm 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:

Search the knowledge graph for "Marie Curie"

Entity type filtering:

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

Multiple results:

Search knowledge graph for "Paris" limit 5

Lookup by MID:

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

400 "API key not valid":

  • API key is invalid, expired, or the wrong kind (a Google AI Studio "AQ." key won't work - it must be a Google Cloud "AIza..." key)
  • Knowledge Graph Search API isn't enabled in your Google Cloud project

Building From Source

bash
npm installnpm 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


Status: Production ready, tested with Claude Desktop

来源:README.md,提交 384b208

工具

2

search_knowledge_graph

Search Google Knowledge Graph for entities by name or topic. Returns structured information about real-world entities like people, places, organizations, and concepts from Google's public knowledge base.

输入参数limitquery必填typeslanguages

lookup_knowledge_graph_entities

Look up specific Knowledge Graph entities by their Machine IDs (MIDs). Use this when you already know the entity IDs from a previous search. MIDs look like /m/0dl567 or /g/11b6vwtjpg.

输入参数ids必填languages

版本历史

4
  1. v1.0.10最新Oct 25, 2026
  2. v1.0.9Oct 7, 2026
  3. v1.0.8Oct 2, 2026
  4. v1.0.7Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分