docs: regenerate all AGENTS.md files from comprehensive codebase exploration
- Fired 33 parallel explore agents across all major directories
- Analyzed 1164 TS files, 133k LOC, 41 hooks, 26 tools, 11 agents, 18 features
- Regenerated 13 AGENTS.md files with 905 total lines
- Root: plugin architecture, initialization flow, 7 OpenCode hook handlers
- src/: entry point orchestration, hook composition pipeline
- agents/: 11 agent inventory with tool restrictions and factory patterns
- hooks/: 41 hooks organized by 5 tiers, key complex hooks documented
- tools/: 26 tools across 14 directories, delegation categories
- features/: 18 modules mapped by complexity (HIGH/MEDIUM/LOW)
- shared/: 101 utilities in 13 categories, model resolution pipeline
- config/: 22 schema files, Zod v4 validation system
- cli/: 5 commands, doctor checks, model fallback system
- mcp/: 3-tier MCP system architecture
- plugin-handlers/: 6-phase config loading pipeline
- claude-code-hooks/: CC settings.json compatibility layer
- claude-tasks/: task schema + file-based persistence
🤖 Generated with assistance of oh-my-opencode
This commit is contained in:
+41
-37
@@ -1,54 +1,58 @@
|
||||
# MCP KNOWLEDGE BASE
|
||||
# src/mcp/ — 3 Built-in Remote MCPs
|
||||
|
||||
**Generated:** 2026-02-17
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
Tier 1 of three-tier MCP system: 3 built-in remote HTTP MCPs.
|
||||
Tier 1 of the three-tier MCP system. 3 remote HTTP MCPs created via `createBuiltinMcps(disabledMcps, config)`.
|
||||
|
||||
**Three-Tier System**:
|
||||
1. **Built-in** (this directory): websearch, context7, grep_app
|
||||
2. **Claude Code compat** (`features/claude-code-mcp-loader/`): .mcp.json with `${VAR}` expansion
|
||||
3. **Skill-embedded** (`features/opencode-skill-loader/`): YAML frontmatter in SKILL.md
|
||||
## BUILT-IN MCPs
|
||||
|
||||
## STRUCTURE
|
||||
```
|
||||
mcp/
|
||||
├── index.ts # createBuiltinMcps() factory
|
||||
├── index.test.ts # Tests
|
||||
├── websearch.ts # Exa AI / Tavily web search
|
||||
├── context7.ts # Library documentation
|
||||
├── grep-app.ts # GitHub code search
|
||||
└── types.ts # McpNameSchema
|
||||
```
|
||||
| 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 |
|
||||
|
||||
## MCP SERVERS
|
||||
|
||||
| Name | URL | Auth | Purpose |
|
||||
|------|-----|------|---------|
|
||||
| websearch | mcp.exa.ai/mcp (default) or mcp.tavily.com/mcp/ | EXA_API_KEY (optional) / TAVILY_API_KEY (required) | Real-time web search |
|
||||
| context7 | mcp.context7.com/mcp | CONTEXT7_API_KEY (optional) | Library docs lookup |
|
||||
| grep_app | mcp.grep.app | None | GitHub code search |
|
||||
|
||||
## CONFIG PATTERN
|
||||
## REGISTRATION PATTERN
|
||||
|
||||
```typescript
|
||||
export const mcp_name = {
|
||||
// Static export (context7, grep_app)
|
||||
export const context7 = {
|
||||
type: "remote" as const,
|
||||
url: "https://...",
|
||||
url: "https://mcp.context7.com/mcp",
|
||||
enabled: true,
|
||||
oauth: false as const,
|
||||
headers?: { ... },
|
||||
}
|
||||
|
||||
// Factory with config (websearch)
|
||||
export function createWebsearchConfig(config?: WebsearchConfig): RemoteMcpConfig
|
||||
```
|
||||
|
||||
## HOW TO ADD
|
||||
## ENABLE/DISABLE
|
||||
|
||||
1. Create `src/mcp/my-mcp.ts` with config object
|
||||
2. Add conditional check in `createBuiltinMcps()` in `index.ts`
|
||||
3. Add name to `McpNameSchema` in `types.ts`
|
||||
```jsonc
|
||||
// Method 1: disabled_mcps array
|
||||
{ "disabled_mcps": ["websearch", "context7"] }
|
||||
|
||||
## NOTES
|
||||
// Method 2: enabled flag
|
||||
{ "mcp": { "websearch": { "enabled": false } } }
|
||||
```
|
||||
|
||||
- **Remote only**: HTTP/SSE transport, no stdio
|
||||
- **Disable**: Set `disabled_mcps: ["name"]` in config
|
||||
- **Exa**: Default provider, works without API key
|
||||
- **Tavily**: Requires `TAVILY_API_KEY` env var
|
||||
## THREE-TIER SYSTEM
|
||||
|
||||
| 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) |
|
||||
|
||||
## FILES
|
||||
|
||||
| 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) |
|
||||
|
||||
Reference in New Issue
Block a user