docs: update AGENTS docs for MCP-backed LSP architecture
This commit is contained in:
+17
-34
@@ -1,49 +1,31 @@
|
||||
# src/mcp/ — 3 Built-in Remote MCPs
|
||||
# src/mcp/ — 4 Built-in MCPs
|
||||
|
||||
**Generated:** 2026-05-15
|
||||
**Generated:** 2026-05-18
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
Tier 1 of the three-tier MCP system. 3 remote HTTP MCPs created via `createBuiltinMcps(disabledMcps, config)`.
|
||||
Tier 1 of the three-tier MCP system. Built-ins are created by `createBuiltinMcps(disabledMcps, config)` and now include both remote MCPs and one local stdio MCP.
|
||||
|
||||
## BUILT-IN MCPs
|
||||
|
||||
| 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 |
|
||||
| Name | Type | Endpoint / Command | Env Vars | Tools |
|
||||
|------|------|--------------------|----------|-------|
|
||||
| **websearch** | remote | `mcp.exa.ai` (default) or `mcp.tavily.com` | `EXA_API_KEY` (optional), `TAVILY_API_KEY` (if tavily) | Web search |
|
||||
| **context7** | remote | `mcp.context7.com/mcp` | `CONTEXT7_API_KEY` (optional) | Library documentation |
|
||||
| **grep_app** | remote | `mcp.grep.app` | None | GitHub code search |
|
||||
| **lsp** | local (stdio, node) | `node vendor/lsp-tools-mcp/dist/cli.js mcp` | `LSP_TOOLS_MCP_PROJECT_CONFIG=.opencode/lsp.json` | `status`, diagnostics, goto definition, references, symbols, prepare_rename, rename |
|
||||
|
||||
## REGISTRATION PATTERN
|
||||
## SUBMODULE ARCHITECTURE
|
||||
|
||||
```typescript
|
||||
// Static export (context7, grep_app)
|
||||
export const context7 = {
|
||||
type: "remote" as const,
|
||||
url: "https://mcp.context7.com/mcp",
|
||||
enabled: true,
|
||||
oauth: false as const,
|
||||
}
|
||||
|
||||
// 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 } } }
|
||||
```
|
||||
- The local `lsp` MCP is vendored as a git submodule at `vendor/lsp-tools-mcp/`.
|
||||
- Upstream project: https://github.com/code-yeongyu/lsp-tools-mcp
|
||||
- OMO resolves the CLI path dynamically in `src/mcp/lsp.ts` so both `src/` and `dist/` runtime layouts work.
|
||||
|
||||
## THREE-TIER SYSTEM
|
||||
|
||||
| Tier | Source | Mechanism |
|
||||
|------|--------|-----------|
|
||||
| 1. Built-in | `src/mcp/` | 3 remote HTTP, created by `createBuiltinMcps()` |
|
||||
| 1. Built-in | `src/mcp/` | 3 remote HTTP MCPs + 1 local stdio MCP (`lsp`) via `createBuiltinMcps()` |
|
||||
| 2. Claude Code | `.mcp.json` | `${VAR}` expansion via `claude-code-mcp-loader` |
|
||||
| 3. Skill-embedded | SKILL.md YAML | Managed by `SkillMcpManager` (stdio + HTTP) |
|
||||
|
||||
@@ -51,8 +33,9 @@ export function createWebsearchConfig(config?: WebsearchConfig): RemoteMcpConfig
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `index.ts` | `createBuiltinMcps()` factory |
|
||||
| `types.ts` | `McpNameSchema`: "websearch" \| "context7" \| "grep_app" |
|
||||
| `index.ts` | `createBuiltinMcps()` registry for built-in MCPs |
|
||||
| `types.ts` | `McpNameSchema`: `"websearch" \| "context7" \| "grep_app" \| "lsp"` |
|
||||
| `websearch.ts` | Exa/Tavily provider with config |
|
||||
| `context7.ts` | Context7 with optional auth header |
|
||||
| `grep-app.ts` | Grep.app (no auth) |
|
||||
| `lsp.ts` | Local stdio MCP config for vendored `lsp-tools-mcp` |
|
||||
|
||||
Reference in New Issue
Block a user