agy-search
Leverages Google Search via the agy CLI to retrieve real-time information and answer queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agy-searchSearch for recent breakthroughs in fusion energy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agy-search
把本机 agy(antigravity-cli,后端 Gemini,能真实联网搜索)包装成一个 stdio MCP server,向 Claude Code 暴露 web_search 工具。
为什么需要这个
Claude Code 接本地模型时,内置的 WebSearch 是 Anthropic 服务端工具,搜索由官方 API 后端执行——本地模型/代理不实现该工具,所以 WebSearch 会返回空结果(Did 0 searches),联网搜索能力缺失。
本项目通过 MCP 工具补齐这个缺口:Claude Code 调用 mcp__agy__web_search → server 内部 spawn agy 子进程 → agy 经 Gemini/Google 联网搜索 → 返回结果。
Claude Code ──(stdio JSON-RPC)──► MCP server(长驻)──(tools/call)──► spawn: agy --prompt ... --output-format json ──► Gemini/Google 搜索 ──► 解析 response 回传Related MCP server: antigravity-cli-mcp
前置要求
agy(antigravity-cli) 已安装并在
PATH中,版本 ≥ 1.1.8uv(Python 包管理器)
Python 3.14+
安装
git clone <repo-url> && cd agy-search
uv sync # 安装依赖(fastmcp)注册到 Claude Code
推荐全局注册(任意目录都可用),用项目 venv 的绝对路径:
claude mcp add agy -s user -- /<绝对路径>/agy-search/.venv/bin/agy-search验证:
claude mcp list # 应列出 agy 且 ✔ Connected
claude mcp get agy # Scope 应为 User config注册后,Claude Code 内会出现工具 mcp__agy__web_search。
使用
在 Claude Code 里直接问需要联网的问题即可,模型会自动调用 mcp__agy__web_search:
今天有什么科技新闻?
工具签名:
web_search(query: str) -> strquery:搜索查询词(自然语言即可,agy 会自行联网检索)返回:agy 的答案文本(通常含来源)
可选:禁用不可用的内置 WebSearch
接本地模型时,内置 WebSearch 不可用却仍会被调用(白白浪费调用次数)。可在 ~/.claude/settings.json 加 permissions.deny 堵掉它,让搜索统一走 agy:
{
"permissions": {
"deny": ["WebSearch"]
}
}(WebFetch 仍可用,用于抓取已知 URL,不必禁用。)
本地开发
# 跑 server(fastmcp CLI,file:object 格式导入 server 对象,默认 stdio)
uv run fastmcp run src/agy_search/__init__.py:mcp
# 或经 entry point
uv run agy-search
# 单独验证 agy 契约(不经 MCP)
agy --prompt "测试查询" --output-format json --print-timeout 90sagy 调用契约(关键,有坑)
命令:agy --prompt "<查询>" --output-format json --print-timeout 90s
一律用
--prompt长选项,不用-p(实测-p会返回 flag 解释而非执行任务)。--print-timeout默认 5m 太长,用 90s。返回 JSON 主用字段:
response(答案文本)、status(SUCCESS/ERROR)、error。成败判定不能只看
status:实测status:"ERROR"时response仍可能含完整正确答案。判定逻辑——response非空(trim 后)即成功并返回(忽略 status);response空且error非空才算失败。失败时重试 1 次(应对
Eligibility check failed: EOF、SSE 断连等瞬时错误),仍失败则raise ToolError(MCP 回isError=True),server 不崩溃。
项目结构
src/agy_search/__init__.py # 全部实现:FastMCP server + web_search 工具 + agy 调用 + 重试
pyproject.toml # 依赖 fastmcp,entry point: agy-search = "agy_search:main"逻辑内聚在单文件,无额外模块。待加第二个工具时再把 agy 调用逻辑抽成独立模块复用。
Available Tools
1 toolweb_searchA
通过本机 agy(antigravity-cli,后端 Gemini,可真实联网搜索)进行网页搜索。 适用于需要实时网络信息、最新新闻、事实核查等场景。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 搜索查询词(自然语言即可,agy 会自行联网检索) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses that the tool uses a local CLI with Gemini backend and performs real web searching, setting expectations. No mention of limits or side effects, but for a simple search tool, this is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences: first stating the tool's function with backend details, second listing use cases. No wasted words, well-structured for quick understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with one parameter and an output schema exists (though not shown). The description covers essential usage and context. It could mention output format briefly, but output schema likely handles that. Reasonably complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description does not add information beyond the schema's parameter description, which already explains 'query' is a natural language search term. No extra semantic value provided.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs web searches using a local CLI and Gemini backend, specifying the action and resource. It also lists applicable scenarios (real-time info, news, fact-checking), making purpose highly clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly mentions when to use this tool (real-time network information, latest news, fact-checking), providing clear usage context. However, it does not mention alternatives or when not to use it, which would be ideal but is less critical given no siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
web_search
TDQS
Only one tool exists, so there is no ambiguity between tools.
The single tool 'web_search' follows a clear verb_noun pattern and is self-consistent.
With only one tool, the server feels too thin for a typical search service, which usually requires multiple query types or filters.
The server provides only a basic web search with no additional features like filtering, image search, or search history, leaving significant gaps for common search workflows.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Docs: https://docs.keenable.ai/mcp-server Keenable is a free, remote MCP server that gives agents access to the web index. Search the web with ranked results and date/site filters, then fetch any indexed page as clean markdown. Works out of the box with no account or API key.
Scrape, crawl and search the web for AI agents via MCP.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that bridges OpenAI's Agents SDK with Claude Code, enabling web search, file search, and computer use capabilities directly in your development environment.291MIT
- AlicenseNot gradedqualityCmaintenanceMCP server wrapping the agy CLI, enabling querying, web search, and file writing through tools like ask-agy, search-web, and write-file.141MIT
- AlicenseAqualityDmaintenanceFree, unlimited web search MCP server using Gemini CLI's Google Search grounding to provide cited, live web results for any AI agent.31MIT
- AlicenseNot gradedqualityAmaintenanceA self-contained web-research MCP server that lets local LLM agents search, fetch, and synthesize web content using tools like web_search, web_fetch, and web_research.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrbruce516/agy-search'
If you have feedback or need assistance with the MCP directory API, please join our Discord server