Files
oh-my-opencode/src/mcp/AGENTS.md
T

59 lines
1.7 KiB
Markdown
Raw Normal View History

# src/mcp/ — 3 Built-in Remote MCPs
2026-01-19 20:18:26 +09:00
**Generated:** 2026-03-06
## OVERVIEW
2026-01-19 20:18:26 +09:00
Tier 1 of the three-tier MCP system. 3 remote HTTP MCPs created via `createBuiltinMcps(disabledMcps, config)`.
2026-01-19 20:18:26 +09:00
## BUILT-IN MCPs
2026-01-19 20:18:26 +09:00
| Name | URL | Env Vars | Tools |
|------|-----|----------|-------|
| **websearch** | `mcp.exa.ai` (default) or `mcp.tavily.com` | `EXA_API_KEY` (optional), `TAVILY_API_KEY` (if tavily) | Web search |
| **context7** | `mcp.context7.com/mcp` | `CONTEXT7_API_KEY` (optional) | Library documentation |
| **grep_app** | `mcp.grep.app` | None | GitHub code search |
## REGISTRATION PATTERN
2026-01-19 20:18:26 +09:00
```typescript
// Static export (context7, grep_app)
export const context7 = {
2026-01-19 20:18:26 +09:00
type: "remote" as const,
url: "https://mcp.context7.com/mcp",
2026-01-19 20:18:26 +09:00
enabled: true,
oauth: false as const,
2026-01-19 20:18:26 +09:00
}
// Factory with config (websearch)
export function createWebsearchConfig(config?: WebsearchConfig): RemoteMcpConfig
```
## ENABLE/DISABLE
```jsonc
// Method 1: disabled_mcps array
{ "disabled_mcps": ["websearch", "context7"] }
// Method 2: enabled flag
{ "mcp": { "websearch": { "enabled": false } } }
2026-01-19 20:18:26 +09:00
```
## THREE-TIER SYSTEM
2026-01-19 20:18:26 +09:00
| Tier | Source | Mechanism |
|------|--------|-----------|
| 1. Built-in | `src/mcp/` | 3 remote HTTP, created by `createBuiltinMcps()` |
| 2. Claude Code | `.mcp.json` | `${VAR}` expansion via `claude-code-mcp-loader` |
| 3. Skill-embedded | SKILL.md YAML | Managed by `SkillMcpManager` (stdio + HTTP) |
2026-01-19 20:18:26 +09:00
## FILES
2026-01-19 20:18:26 +09:00
| File | Purpose |
|------|---------|
| `index.ts` | `createBuiltinMcps()` factory |
| `types.ts` | `McpNameSchema`: "websearch" \| "context7" \| "grep_app" |
| `websearch.ts` | Exa/Tavily provider with config |
| `context7.ts` | Context7 with optional auth header |
| `grep-app.ts` | Grep.app (no auth) |