opencode: SearXNG search MCP, LSP tool, Gitea MCP in oc-local
searxng-mcp.py is a stdlib-only stdio MCP server with one web_search tool against search.rcjohnstone.com. It is in both profiles and asks first on oc-work. lsp: true in opencode.json, and the launcher sets OPENCODE_EXPERIMENTAL_LSP_TOOL and OPENCODE_DISABLE_LSP_DOWNLOAD. The launcher adds gitea-mcp to oc-local through OPENCODE_CONFIG_CONTENT when the binary and GITEA_MCP_TOKEN exist, limited to 15 tools. gitea_issue_write asks.
This commit is contained in:
1 parent
b4ced1c649
commit
b4bc5e1031
5 files changed
+159
No files matched your search
@@ -84,11 +84,24 @@ _oc_launch() {
|
||||
print -u2 "${colour}┌─ opencode profile: ${(U)profile} ─┐\e[0m"
|
||||
printf '\e]0;opencode [%s]\a' "$profile"
|
||||
|
||||
# Gitea MCP: oc-local only, and only where the binary and token exist.
|
||||
# --tools keeps 15 of its 61 tools; each one is sent with every request.
|
||||
local extra=""
|
||||
if [[ $profile == local ]] && (( $+commands[gitea-mcp] )) && [[ -n $GITEA_MCP_TOKEN ]]; then
|
||||
local tools=get_me,search_repos,list_my_repos,search_issues,list_issues,issue_read,issue_write,label_read,list_pull_requests,pull_request_read,get_file_contents,get_dir_contents,list_commits,get_commit,actions_run_read
|
||||
extra='{"mcp":{"gitea":{"type":"local","enabled":true,"command":["gitea-mcp","-t","stdio","--host","https://git.rcjohnstone.com","--tools","'$tools'"],"environment":{"GITEA_ACCESS_TOKEN":"{env:GITEA_MCP_TOKEN}"}}}}'
|
||||
fi
|
||||
|
||||
# Never set OPENCODE_EXPERIMENTAL=true for the LSP tool: that umbrella flag
|
||||
# also enables the built-in websearch, which sends queries to Exa.
|
||||
# OpenCode detects its install method with `npm list -g` and upgrades with
|
||||
# `npm install -g`; both use nvm's prefix unless pointed at this one.
|
||||
LITELLM_KEY="$key" \
|
||||
OPENCODE_PROFILE="$profile" \
|
||||
OPENCODE_CONFIG="$cfg" \
|
||||
OPENCODE_CONFIG_CONTENT="$extra" \
|
||||
OPENCODE_EXPERIMENTAL_LSP_TOOL=true \
|
||||
OPENCODE_DISABLE_LSP_DOWNLOAD=true \
|
||||
npm_config_prefix="${OPENCODE_BIN:h}" \
|
||||
command opencode "$@"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user