feat(mcp): register ast-grep as built-in MCP
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+10
-1
@@ -1,6 +1,7 @@
|
||||
import { createWebsearchConfig } from "./websearch"
|
||||
import { context7 } from "./context7"
|
||||
import { grep_app } from "./grep-app"
|
||||
import { createAstGrepMcpConfig } from "./ast-grep"
|
||||
import { createLspMcpConfig, type LocalMcpConfig } from "./lsp"
|
||||
import type { OhMyOpenCodeConfig } from "../config/schema"
|
||||
|
||||
@@ -16,7 +17,11 @@ type RemoteMcpConfig = {
|
||||
|
||||
type BuiltinMcpConfig = RemoteMcpConfig | LocalMcpConfig
|
||||
|
||||
export function createBuiltinMcps(disabledMcps: string[] = [], config?: OhMyOpenCodeConfig) {
|
||||
type BuiltinMcpOptions = {
|
||||
readonly cwd?: string
|
||||
}
|
||||
|
||||
export function createBuiltinMcps(disabledMcps: string[] = [], config?: OhMyOpenCodeConfig, options: BuiltinMcpOptions = {}) {
|
||||
const mcps: Record<string, BuiltinMcpConfig> = {}
|
||||
|
||||
if (!disabledMcps.includes("websearch")) {
|
||||
@@ -38,5 +43,9 @@ export function createBuiltinMcps(disabledMcps: string[] = [], config?: OhMyOpen
|
||||
mcps.lsp = createLspMcpConfig()
|
||||
}
|
||||
|
||||
if (!disabledMcps.includes("ast_grep")) {
|
||||
mcps.ast_grep = createAstGrepMcpConfig({ cwd: options.cwd, disabledTools: config?.disabled_tools })
|
||||
}
|
||||
|
||||
return mcps
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user