refactor: strip to installer + doctor + docs, remove read/search wrapper layer
BREAKING CHANGE: Remove all `agent-reach read` and `agent-reach search-*` commands. Agent Reach is now an installer, configuration tool, and doctor — not a wrapper layer. After installation, agents call upstream tools directly (bird CLI, yt-dlp, mcporter, gh CLI, Jina Reader, etc.). What's kept: - agent-reach install: one-shot installer - agent-reach doctor: channel status overview - agent-reach configure: cookies, proxy, credentials - agent-reach setup: interactive wizard - SKILL.md: complete guide for agents to use upstream tools directly What's removed: - agent-reach read URL (and all channel read() methods) - agent-reach search-* commands (and all channel search() methods) - ReadResult / SearchResult data classes - URL routing system (get_channel_for_url) - All parsing/conversion logic (VTT, Reddit JSON, bird text parser, etc.) - MCP server read/search tools (kept only get_status) Net change: -1790 lines. Less code = fewer bugs.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Agent Reach MCP Server — expose all capabilities as MCP tools.
|
||||
Agent Reach MCP Server — expose doctor/status as MCP tool.
|
||||
|
||||
Run: python -m agent_reach.integrations.mcp_server
|
||||
|
||||
8 tools for any MCP-compatible AI Agent.
|
||||
Agent Reach is an installer + doctor tool. For actual reading/searching,
|
||||
agents should call upstream tools directly (bird, yt-dlp, mcporter, etc.).
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
@@ -35,50 +36,15 @@ def create_server():
|
||||
@server.list_tools()
|
||||
async def list_tools():
|
||||
return [
|
||||
Tool(name="read_url",
|
||||
description="Read content from any URL. Supports: web, GitHub, Reddit, Twitter, YouTube, Bilibili, RSS.",
|
||||
inputSchema={"type": "object", "properties": {"url": {"type": "string"}}, "required": ["url"]}),
|
||||
Tool(name="read_batch",
|
||||
description="Read multiple URLs concurrently.",
|
||||
inputSchema={"type": "object", "properties": {"urls": {"type": "array", "items": {"type": "string"}}}, "required": ["urls"]}),
|
||||
Tool(name="detect_platform",
|
||||
description="Detect what platform a URL belongs to.",
|
||||
inputSchema={"type": "object", "properties": {"url": {"type": "string"}}, "required": ["url"]}),
|
||||
Tool(name="search",
|
||||
description="Semantic web search via Exa.",
|
||||
inputSchema={"type": "object", "properties": {"query": {"type": "string"}, "num_results": {"type": "integer", "default": 5}}, "required": ["query"]}),
|
||||
Tool(name="search_reddit",
|
||||
description="Search Reddit posts.",
|
||||
inputSchema={"type": "object", "properties": {"query": {"type": "string"}, "subreddit": {"type": "string"}, "limit": {"type": "integer", "default": 10}}, "required": ["query"]}),
|
||||
Tool(name="search_github",
|
||||
description="Search GitHub repositories.",
|
||||
inputSchema={"type": "object", "properties": {"query": {"type": "string"}, "language": {"type": "string"}, "limit": {"type": "integer", "default": 5}}, "required": ["query"]}),
|
||||
Tool(name="search_twitter",
|
||||
description="Search Twitter/X posts.",
|
||||
inputSchema={"type": "object", "properties": {"query": {"type": "string"}, "limit": {"type": "integer", "default": 10}}, "required": ["query"]}),
|
||||
Tool(name="get_status",
|
||||
description="Get Agent Reach status: which channels are active.",
|
||||
description="Get Agent Reach status: which channels are installed and active.",
|
||||
inputSchema={"type": "object", "properties": {}}),
|
||||
]
|
||||
|
||||
@server.call_tool()
|
||||
async def call_tool(name: str, arguments: dict):
|
||||
try:
|
||||
if name == "read_url":
|
||||
result = await eyes.read(arguments["url"])
|
||||
elif name == "read_batch":
|
||||
result = await eyes.read_batch(arguments["urls"])
|
||||
elif name == "detect_platform":
|
||||
result = eyes.detect_platform(arguments["url"])
|
||||
elif name == "search":
|
||||
result = await eyes.search(arguments["query"], arguments.get("num_results", 5))
|
||||
elif name == "search_reddit":
|
||||
result = await eyes.search_reddit(arguments["query"], arguments.get("subreddit"), arguments.get("limit", 10))
|
||||
elif name == "search_github":
|
||||
result = await eyes.search_github(arguments["query"], arguments.get("language"), arguments.get("limit", 5))
|
||||
elif name == "search_twitter":
|
||||
result = await eyes.search_twitter(arguments["query"], arguments.get("limit", 10))
|
||||
elif name == "get_status":
|
||||
if name == "get_status":
|
||||
result = eyes.doctor_report()
|
||||
else:
|
||||
result = f"Unknown tool: {name}"
|
||||
|
||||
Reference in New Issue
Block a user