The gateway at llm.ad.itaz.eu is LiteLLM in front of vLLM, and LiteLLM already
serves the Anthropic Messages API on /v1/messages — verified with a real
completion. So Claude Code needs no bridge: pointing ANTHROPIC_BASE_URL at it is
the whole integration.
`claude-vllm` exists only to stop you pasting four exports each time. It reuses
what another agent is already configured with — ~/.pi/agent, ~/.prime/agent, then
opencode's config, first hit wins — taking the base URL and the credential from
the same source so one gateway's URL is never paired with another's key.
Beyond the obvious ANTHROPIC_* vars it sets two that are easy to miss:
- ANTHROPIC_SMALL_FAST_MODEL / ANTHROPIC_DEFAULT_HAIKU_MODEL, or the
background and summarisation calls ask the gateway for a real Haiku it does
not serve and every one 404s;
- CLAUDE_CODE_MAX_CONTEXT_TOKENS from the provider's declared contextWindow,
because Claude Code assumes 200k for models it has no table for — and
deepseek-v4-* is 393k, so it would auto-compact at half capacity.
On `claude-mcpctl`: mcpctl's LLM layer is a client, not a server. mcpd serves
/api/v1/llms (management) and its adapters call out to providers for gating,
prompt selection and agent chat; nothing serves /v1/messages. Routing Claude
through mcpctl would mean adding an Anthropic-shaped passthrough that re-wraps
LiteLLM — worth doing only if mcpctl in the LLM path buys something of its own
(per-project gating of model calls, prompt audit, budgets), which is a mcpd
endpoint rather than a wrapper script.
Verified: `claude-vllm --model deepseek-v4-fast -- -p "..."` completes against
deepseek on the homelab, with the unknown-model context warning gone.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVwuCjuMoA13gmzYEfcrNP
35 lines
798 B
YAML
35 lines
798 B
YAML
name: mcpctl
|
|
arch: ${NFPM_ARCH}
|
|
version: 0.0.1
|
|
release: "1"
|
|
maintainer: michal
|
|
description: kubectl-like CLI for managing MCP servers
|
|
license: MIT
|
|
depends:
|
|
- jq
|
|
contents:
|
|
- src: ./dist/mcpctl
|
|
dst: /usr/bin/mcpctl
|
|
file_info:
|
|
mode: 0755
|
|
- src: ./dist/mcpctl-local
|
|
dst: /usr/bin/mcpctl-local
|
|
file_info:
|
|
mode: 0755
|
|
- src: ./stack/claude-vllm
|
|
dst: /usr/bin/claude-vllm
|
|
file_info:
|
|
mode: 0755
|
|
- src: ./deploy/mcplocal.service
|
|
dst: /usr/lib/systemd/user/mcplocal.service
|
|
file_info:
|
|
mode: 0644
|
|
- src: ./completions/mcpctl.bash
|
|
dst: /usr/share/bash-completion/completions/mcpctl
|
|
file_info:
|
|
mode: 0644
|
|
- src: ./completions/mcpctl.fish
|
|
dst: /usr/share/fish/vendor_completions.d/mcpctl.fish
|
|
file_info:
|
|
mode: 0644
|