2026-05-18 21:20:13 +09:00
# src/mcp/ — 5 Built-in MCPs
2026-01-19 20:18:26 +09:00
2026-05-18 12:13:21 +09:00
**Generated: ** 2026-05-18
2026-02-01 19:26:57 +09:00
2026-02-17 11:17:01 +09:00
## OVERVIEW
2026-01-19 20:18:26 +09:00
2026-05-18 21:20:13 +09:00
Tier 1 of the three-tier MCP system. Built-ins are created by `createBuiltinMcps(disabledMcps, config, options)` and now include both remote MCPs and local stdio MCPs.
2026-01-19 20:18:26 +09:00
2026-02-17 11:17:01 +09:00
## BUILT-IN MCPs
2026-01-19 20:18:26 +09:00
2026-05-18 12:13:21 +09:00
| 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 |
2026-05-18 16:45:02 +09:00
| **lsp ** | local (stdio, node/bun) | `node packages/lsp-tools-mcp/dist/cli.js mcp` or `bun packages/lsp-tools-mcp/src/cli.ts mcp` | `LSP_TOOLS_MCP_PROJECT_CONFIG=.opencode/lsp.json` | `status` , diagnostics, goto definition, references, symbols, prepare_rename, rename |
2026-05-18 21:20:13 +09:00
| **ast_grep ** | local (stdio, node/bun) | `node packages/ast-grep-mcp/dist/cli.js mcp` or `bun packages/ast-grep-mcp/src/cli.ts mcp` | `OMO_AST_GREP_WORKSPACE=<project>` | `search` , `replace` |
2026-02-02 03:37:02 +08:00
2026-05-18 12:13:21 +09:00
## SUBMODULE ARCHITECTURE
2026-01-19 20:18:26 +09:00
2026-05-18 16:00:40 +09:00
- The local `lsp` MCP is a git submodule at `packages/lsp-tools-mcp/` .
2026-05-18 12:13:21 +09:00
- 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.
2026-05-18 21:20:13 +09:00
- `lsp` and `ast_grep` are registered whenever they are not listed in `disabled_mcps` , even if their CLI artifacts have not been built yet. Source checkouts fall back to the Bun source CLI; packaged builds prefer the Node dist CLI.
2026-01-19 20:18:26 +09:00
2026-02-17 11:17:01 +09:00
## THREE-TIER SYSTEM
2026-01-19 20:18:26 +09:00
2026-02-17 11:17:01 +09:00
| Tier | Source | Mechanism |
|------|--------|-----------|
2026-05-18 21:20:13 +09:00
| 1. Built-in | `src/mcp/` | 3 remote HTTP MCPs + 2 local stdio MCPs (`lsp` , `ast_grep` ) via `createBuiltinMcps()` |
2026-02-17 11:17:01 +09:00
| 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
2026-02-17 11:17:01 +09:00
## FILES
2026-01-19 20:18:26 +09:00
2026-02-17 11:17:01 +09:00
| File | Purpose |
|------|---------|
2026-05-18 12:13:21 +09:00
| `index.ts` | `createBuiltinMcps()` registry for built-in MCPs |
2026-05-18 21:20:13 +09:00
| `types.ts` | `McpNameSchema` : `"websearch" \| "context7" \| "grep_app" \| "lsp" \| "ast_grep"` |
2026-02-17 11:17:01 +09:00
| `websearch.ts` | Exa/Tavily provider with config |
| `context7.ts` | Context7 with optional auth header |
| `grep-app.ts` | Grep.app (no auth) |
2026-05-18 16:00:40 +09:00
| `lsp.ts` | Local stdio MCP config for packaged `lsp-tools-mcp` |
2026-05-18 21:20:13 +09:00
| `ast-grep.ts` | Local stdio MCP config for packaged `ast-grep-mcp` |