add-context-gateway
БесплатноБез исполняемых скриптовНе проверенPut the MCP servers an existing agent uses behind one Redis Iris Context Gateway with redis-iris, so the agent connects to one MCP endpoint with one agent key…
от redis★ 177 звёзд на GitHubОб этом скилле
Add Context Gateway
One MCP endpoint and one agent key in place of every MCP server the agent configures today. The Gateway holds each Upstream's secret, namespaces tool names so they never collide, can expose a large catalog as search_tools and run_tool instead of every schema, caches read-only tools you opt in, and can hand a large result back as a handle. The agent keeps its tools; only where it reaches them changes. Ask first, provision, then repoint.
1. Discover
Read the project:
- Find every MCP server the agent configures:
.mcp.json,.cursor/mcp.json,McpToolset,MCPServerStreamableHttp,MultiServerMCPClient,stdio_client, or a hand-written MCP client. Note each endpoint and where its secret comes from. - Find where tools are handed to the model and where the turn runs.
- Identify the framework from imports, and whether it has its own MCP client.
- Note stdio-only servers: an Upstream is an HTTP MCP endpoint (
streamable-http). A stdio server has to be served over HTTP first, or stays outside the Gateway.
First ask where the Gateway runs:
- Redis Cloud (console). The developer creates the Gateway and its Upstreams in the console, and the CLI only talks to the Gateway's MCP endpoint (step 3, "In Redis Cloud"). Cloud keeps the Gateway's cache and compression off, so skip questions 3 and 4.
- Self-managed (on-prem, or the local Compose stack). The CLI provisions everything (step 3).
Then ask the developer these five questions, nothing more. A shrug takes the default.
| Ask | If the answer is | Configure |
|---|---|---|
| Which MCP servers does the agent use, and where do their secrets live? | A list of HTTP endpoints | One Upstream each: upstream add --name NAME --endpoint URL with --bearer-secret env:VAR or --header NAME --header-secret env:VAR |
| A Redis database the agent should query | A Context Surface Upstream: --kind context-surface --surface-database-id ID --data-model FILE (self-managed, the ID can be left out and defaults from the deployment config. In Redis Cloud the console's Create Context Surface asks for the database). Write the data model first: see "Write the data model" |
|
| How many tools does the agent see in total? | Tens (default) | --tool-exposure-mode full: every tool, namespaced |
| Hundreds, or schemas crowd the prompt | --tool-exposure-mode search: the model sees search_tools and run_tool |
|
| Which read-only tools return the same answer for the same arguments? | Lookups, searches, reference data | A Gateway with a database and cache enabled (see "Gateway switches and database"), then policy set UPSTREAM TOOL --cache-ttl DURATION per tool |
| None, or not sure | No cache policies | |
| Which tools return results too large to read whole? | Exports, list endpoints, logs | A Gateway with a noeviction database and compression enabled (see "Gateway switches and database"). Then the deployment's handle defaults, or --compression-ttl DURATION per tool, and --compression-capture never for a tool that must always return whole |
| Does the framework connect to MCP servers itself? | Yes: Claude Code, Cursor, ADK, OpenAI Agents SDK, LangChain MCP adapters | Point its MCP client at the Gateway URL and key |
| No, or the agent wants plain function tools | The SDK: gateway.model_tools() or gateway.hooks() |
2. Get current facts from MCP
Do this before writing code. Never guess framework APIs from memory.
- Framework docs: query an available docs MCP (Context7, or the framework's own) for the installed version's MCP client: how it takes a streamable HTTP URL and an
Authorizationheader. - Redis docs: if the Redis docs MCP is connected, use it for Context Gateway concepts (Upstreams, exposure modes, cache, handles).
- No MCP available: read the installed package source in the virtualenv. Say so in the report.
3. Provision
Install the CLI
pip install redis-iris
It needs Python 3.11 or later. On LangGraph, install redis-iris[langgraph]. If tools call crm__lookup_customer fails with tool_not_found on a search-mode Gateway while a Gateway ID is set (--gateway-id or IRIS_CONTEXT_GATEWAY_ID), the installed release splits tool names at the first .: upgrade redis-iris, or run tools call with IRIS_CONTEXT_GATEWAY_URL set and no Gateway ID, so the CLI resolves the name through search_tools.
In Redis Cloud
Redis Cloud has no API for Gateway setup yet. The control plane takes only the console session, so a cloud profile refuses service, upstream and policy commands with cloud_unsupported, and the agent can't provision. The developer does it in the console:
- Iris → Context Gateway: create the Gateway, or open an existing one.
- On the Gateway, Upstreams: Add MCP server for each HTTP server from question 1, or Create Context Surface for a Redis database (write the data model first: see "Write the data model").
- On the connect step, copy the MCP endpoin
Установить add-context-gateway в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл add-context-gateway?
Put the MCP servers an existing agent uses behind one Redis Iris Context Gateway with redis-iris, so the agent connects to one MCP endpoint with one agent key instead of configuring each server and its secret. Asks whether the Gateway is in Redis Cloud or self-managed, then five questions (which MCP servers and secrets the agent has today, how many tools it sees, which read-only tools may be cached, which tools return large results, whether the framework speaks MCP itself). Self-managed, it provisions the Gateway and its Upstreams from the terminal with `iris context-gateway` and sets cache and compression policies. In Redis Cloud the developer creates them in the console. Then it points the agent at the Gateway in any framework and verifies it with `tools list` and `tools call`. Use when the agent configures several MCP servers one by one, carries one secret per server, loads too many tool schemas into the prompt, or the user asks for Context Gateway, one MCP endpoint, tool caching, or result handles.
Как установить скилл add-context-gateway?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-context-gateway запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic