opencode-anthropic-websearch
v0.1.1
Published
An OpenCode plugin for Anthropic web search with citations
Downloads
80
Maintainers
Readme
opencode-anthropic-websearch
An OpenCode plugin for Anthropic web search with citations.
Features
- Uses Anthropic's native
web_search_20250305tool - Supports both API key and OAuth authentication
- Automatically refreshes OAuth tokens when expired
- Formats responses with numbered citations and sources
Installation
bun install opencode-anthropic-websearchOr for local development:
git clone <repo>
cd opencode-anthropic-websearch
bun install
bun run buildConfiguration
Add the plugin to your ~/.config/opencode/opencode.json:
{
"plugins": [
"file:///path/to/opencode-anthropic-websearch"
]
}Usage
Once configured, the anthropic_web_search tool is automatically available to the LLM. It will be used when Claude needs to search the web for current information.
Example
The LLM can call the tool with a query:
anthropic_web_search({ query: "latest news about AI developments" })The response includes the search results with numbered citations:
According to recent reports, AI developments have accelerated... [1][2]
---
**Sources:**
[1] Article Title: https://example.com/article1
[2] Another Article: https://example.com/article2Authentication
The plugin supports two authentication methods:
- API Key: Use your Anthropic API key
- OAuth: Use Claude Pro/Max subscription via OAuth (automatically refreshes tokens)
Authenticate via opencode auth login and select your preferred method.
Development
# Install dependencies
bun install
# Type check
bun run typecheck
# Build
bun run buildLicense
MIT
