Skip to main content
Glama
PandaNePanda

Hyperagent MCP

by PandaNePanda

Hyperagent MCP и локальный provider для OpenCode

Локальный мост к моделям Fable 5 и GPT-5.6 Sol, использующий cookies активной браузерной сессии hyperagent.com.

Проект предоставляет два независимых режима:

  1. stdio MCP-сервер с инструментами hyperagent_models и hyperagent_chat;

  2. OpenAI-совместимый локальный provider, который добавляет обе модели в OpenCode и передаёт им локальные инструменты OpenCode (bash, read, write, edit и другие).

WARNING

Проект обращается к внутренним, официально не документированным web API Hyperagent. Hyperagent может изменить модели, endpoint-ы или формат ответов без предупреждения.

Возможности

  • только две явно разрешённые модели;

  • работа через существующую Hyperagent-сессию без копирования cookies в конфиг OpenCode;

  • перечитывание cookie-файла перед каждым запросом;

  • новые и продолжаемые Hyperagent threads через MCP;

  • OpenAI Chat Completions API для подключения как отдельного provider OpenCode;

  • streaming и non-streaming ответы;

  • преобразование tool calls модели в реальные локальные инструменты OpenCode;

  • защита от ложных заявлений о создании или изменении локальных файлов;

  • привязка HTTP-provider только к 127.0.0.1;

  • автоматическое удаление временных Hyperagent threads provider-а.

Related MCP server: OpenAI Agents MCP Server

Поддерживаемые модели

Алиас

Название

Hyperagent model ID

Runtime

Контекст

Максимальный ответ

fable-5

Fable 5

claude-fable-5

claude-agents-sdk

1 000 000

128 000

gpt-5.6-sol

GPT-5.6 Sol

openai/gpt-5.6-sol

langchain-deepagents

950 000

128 000

Для Fable 5 используются effort=max и maxThinkingTokens=32000. Для GPT-5.6 Sol используется effort=max.

Как устроен проект

OpenCode
├── MCP client ──stdio──> dist/src/index.js
│                         └── Hyperagent session API
└── AI provider ──HTTP──> 127.0.0.1:18457/v1
                          └── provider-server.js
                              ├── преобразование OpenAI messages/tools
                              ├── Hyperagent session API
                              └── возврат tool calls обратно в OpenCode

Удалённая песочница Hyperagent (/agent/workspace) не является компьютером пользователя. В режиме provider любые операции с текущей директорией, файлами, shell и процессами должны выполняться инструментами OpenCode на локальном компьютере. Сервер использует отдельные транспортные имена инструментов, чтобы они не пересекались со встроенными инструментами удалённой песочницы.

Требования

  • Node.js 18 или новее;

  • npm;

  • активная учётная запись и браузерная сессия на https://hyperagent.com;

  • OpenCode — только если требуется подключение моделей как provider или MCP в OpenCode.

Установка

git clone <URL-ВАШЕГО-РЕПОЗИТОРИЯ>
cd hyperagent-mcp
npm ci
npm run build

Основные команды:

Команда

Назначение

npm run check

Проверить TypeScript без создания dist

npm run build

Собрать JavaScript в dist/src

npm start

Запустить stdio MCP-сервер вручную

npm run provider

Запустить HTTP-provider в foreground

npm run provider:start

Запустить provider в фоне

npm run provider:status

Проверить provider и /health

npm run provider:stop

Корректно остановить provider

Cookies: расположение и формат

Где лежит файл

По умолчанию сервер ищет файл cookies.md в текущей рабочей директории.

  • в этой установленной копии: /root/test/cookies.md;

  • в обычном клоне: <корень-репозитория>/cookies.md;

  • рекомендуемый путь: рядом с package.json.

Путь можно переопределить переменной окружения:

export HYPERAGENT_COOKIES_FILE=/absolute/path/to/cookies.md

Фоновый service-скрипт по умолчанию всегда использует <корень-репозитория>/cookies.md, независимо от директории, из которой была запущена npm-команда.

Файл cookies.md включён в .gitignore и не должен попадать в GitHub, npm-пакет, логи или сообщения об ошибках. Безопасный шаблон находится в cookies.example.md.

Как подготовить cookies.md

  1. Войдите в https://hyperagent.com в браузере.

  2. Откройте Chrome DevTools и таблицу Cookies для hyperagent.com.

  3. Скопируйте строки cookies как табличные данные с разделителем TAB.

  4. Сохраните данные в <корень-репозитория>/cookies.md.

  5. Не преобразовывайте таблицу в Markdown с символами |.

Ожидаемый порядок первых колонок:

Name<TAB>Value<TAB>Domain<TAB>Path<TAB>...

Заголовок Name<TAB>Value... допустим и будет пропущен. Сервер использует имя, значение и домен, но требует табличный формат минимум с четырьмя колонками. Допускаются только домены:

  • hyperagent.com;

  • .hyperagent.com.

Cookies перечитываются перед каждым запросом к Hyperagent. После замены cookies.md перезапуск обычно не нужен.

Безопасность cookies

Cookies эквивалентны bearer-учётным данным и дают доступ к вашей сессии.

  • не коммитьте cookies.md;

  • не вставляйте значения в opencode.jsonc;

  • не отправляйте файл в issue, gist или CI artifact;

  • не передавайте cookies никакому домену кроме фиксированного https://hyperagent.com;

  • после случайной публикации завершите сессию Hyperagent и получите новые cookies.

Клиент запрещает cross-origin redirects, проверяет домены строк и отклоняет символы, позволяющие внедрить дополнительные HTTP-заголовки.

Режим 1: stdio MCP-сервер

После сборки entry point находится здесь:

dist/src/index.js

Подключение к OpenCode

Добавьте в ~/.config/opencode/opencode.jsonc, заменив пути на абсолютные:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "hyperagent": {
      "type": "local",
      "command": ["node", "/absolute/path/to/hyperagent-mcp/dist/src/index.js"],
      "environment": {
        "HYPERAGENT_COOKIES_FILE": "/absolute/path/to/hyperagent-mcp/cookies.md"
      },
      "enabled": true
    }
  }
}

Проверка:

opencode mcp list

Инструмент hyperagent_models

Не принимает параметров. Возвращает алиасы, API ID, runtime, лимиты и настройки поддерживаемых моделей.

Инструмент hyperagent_chat

Поле

Тип

Обязательно

Описание

model

fable-5 или gpt-5.6-sol

да

Алиас модели

prompt

string

да

Сообщение модели

thread_id

string

нет

ID существующего Hyperagent thread для продолжения

system_prompt

string

нет

System prompt нового thread или явное обновление существующего

timeout_seconds

integer 10–1800

нет

Таймаут, по умолчанию 600 секунд

Новый диалог:

{
  "model": "fable-5",
  "prompt": "Ответь одним словом: OK"
}

Продолжение:

{
  "model": "fable-5",
  "thread_id": "ID_ИЗ_ПРЕДЫДУЩЕГО_ОТВЕТА",
  "prompt": "Продолжи предыдущий ответ"
}

Ответ содержит thread_id, created_thread, алиас/ID модели и текст response. Продолжать thread нужно с исходной моделью и runtime.

MCP-режим управляет удалёнными Hyperagent threads. Сам по себе он не предоставляет модели доступ к локальным файлам OpenCode.

Режим 2: модели как отдельный provider OpenCode

Этот режим нужен, если Fable 5 и GPT-5.6 Sol должны отображаться в /models и работать как coding models с локальными инструментами OpenCode.

Запуск provider

npm run build
npm run provider:start
npm run provider:status

Provider слушает только:

http://127.0.0.1:18457/v1

Остановка:

npm run provider:stop

Runtime-файлы создаются в корне проекта и игнорируются Git:

  • .hyperagent-provider.pid — PID фонового процесса;

  • .hyperagent-provider.log — stdout/stderr provider-а.

Конфигурация OpenCode

Добавьте provider в ~/.config/opencode/opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "hyperagent": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Hyperagent Session",
      "options": {
        "baseURL": "http://127.0.0.1:18457/v1",
        "apiKey": "local"
      },
      "models": {
        "fable-5": {
          "name": "Fable 5",
          "limit": { "context": 1000000, "output": 128000 }
        },
        "gpt-5.6-sol": {
          "name": "GPT-5.6 Sol",
          "limit": { "context": 950000, "output": 128000 }
        }
      }
    }
  }
}

Проверка моделей:

opencode models hyperagent

Идентификаторы моделей:

hyperagent/fable-5
hyperagent/gpt-5.6-sol

Как provider работает с локальными инструментами

  1. OpenCode отправляет историю, JSON Schema инструментов и tool_choice в локальный provider.

  2. Provider заменяет имена инструментов на уникальные транспортные aliases.

  3. Модель получает явное указание, что Hyperagent sandbox не является компьютером пользователя.

  4. Модель возвращает JSON-запрос tool call.

  5. Provider восстанавливает настоящее имя инструмента и возвращает вызов OpenCode.

  6. OpenCode выполняет инструмент локально и отправляет результат следующим сообщением.

  7. Только локальный tool result считается подтверждением чтения, изменения или создания файла.

Для очевидных запросов на создание/редактирование/чтение файла и определение рабочей директории provider требует соответствующий локальный tool call. Если модель не возвращает обязательный вызов даже после repair-попытки, запрос завершается ошибкой вместо ложного сообщения об успехе.

Каждый OpenAI completion создаёт временный Hyperagent thread. После завершения или ошибки provider пытается удалить этот thread, поскольку OpenCode на каждом шаге передаёт всю историю заново.

HTTP API provider-а

Метод

Endpoint

Описание

GET

/health

Проверка процесса

GET

/v1/models

Список двух моделей

POST

/v1/chat/completions

OpenAI-compatible chat completions

Поддерживаются обычные и SSE-streaming ответы, OpenAI-style tool calls и tool_choice.

Переменные окружения

Переменная

По умолчанию

Назначение

HYPERAGENT_COOKIES_FILE

<cwd>/cookies.md

Абсолютный или относительный путь к cookie-файлу

HYPERAGENT_PROVIDER_PORT

18457

Локальный порт provider-а

HYPERAGENT_PROVIDER_DEBUG

выключен

Значение 1 включает безопасные shape-логи запросов

Debug-режим записывает роли, количество/имена инструментов и форму результата, но не должен записывать тексты prompt-ов или значения cookies.

Структура репозитория

.
├── src/
│   ├── index.ts              # stdio MCP entry point
│   ├── provider-server.ts    # OpenAI-compatible HTTP provider
│   ├── openai-compat.ts      # сообщения, tool aliases и tool-call parsing
│   ├── hyperagent.ts         # клиент Hyperagent session API
│   ├── cookies.ts            # безопасный разбор cookie-таблицы
│   └── models.ts             # разрешённые модели и runtime
├── scripts/
│   └── provider-service.mjs  # start/stop/status фонового provider-а
├── cookies.example.md        # безопасный шаблон формата
├── cookies.md                # реальные cookies; игнорируются Git
├── package.json
└── tsconfig.json

dist/, node_modules/, logs, PID и cookies не публикуются в Git.

Проверка после установки

npm ci
npm run check
npm run build
npm run provider:start
curl --fail http://127.0.0.1:18457/health
curl --fail http://127.0.0.1:18457/v1/models
opencode models hyperagent
npm run provider:stop

Для live-запроса требуется актуальный cookies.md.

Решение проблем

401 или 403

Браузерная сессия истекла или cookies были скопированы не полностью. Обновите cookies.md из активной сессии Hyperagent. Значения перечитаются при следующем запросе.

Проверьте, что файл разделён TAB-ами, содержит минимум четыре колонки и включает только hyperagent.com/.hyperagent.com. Не вставляйте обычный HTTP Cookie: header вместо таблицы.

Provider не запускается

npm run build
npm run provider:status
cat .hyperagent-provider.log

Также проверьте, свободен ли 127.0.0.1:18457, либо задайте другой HYPERAGENT_PROVIDER_PORT и обновите baseURL OpenCode.

Модель пишет, что файл создан, но файла нет

Убедитесь, что выбрана модель вида hyperagent/fable-5 или hyperagent/gpt-5.6-sol через локальный provider, а не удалённый Hyperagent MCP/agent. Локальный provider должен вернуть tool call, после чего OpenCode покажет фактическое выполнение write, edit или bash.

Hyperagent изменил внутренний API

Проверьте ответы /api/threads, /api/threads/:id/messages и chat SSE. Проект намеренно не использует cookies на сторонних доменах, поэтому нельзя автоматически переключать его на неизвестный endpoint.

Подготовка публикации в GitHub

Перед первым commit:

git init
git check-ignore cookies.md
git status --short
npm ci
npm run check
npm run build

Убедитесь, что в staged-файлах отсутствуют:

  • cookies.md и любые реальные cookie values;

  • .hyperagent-provider.log и .hyperagent-provider.pid;

  • node_modules/, dist/, .env;

  • пользовательские файлы, не относящиеся к MCP/provider.

Затем:

git add .
git status --short
git commit -m "Initial Hyperagent MCP bridge"
git branch -M main
git remote add origin <URL-ВАШЕГО-РЕПОЗИТОРИЯ>
git push -u origin main

Ограничения

  • Внутренние API Hyperagent могут измениться.

  • Cookies истекают и требуют ручного обновления.

  • Image input преобразуется в текстовое уведомление и не передаётся как изображение.

  • Token usage в OpenAI-compatible ответе оценивается приблизительно по числу символов.

  • Официальный удалённый MCP Hyperagent управляет агентами в удалённой песочнице и не даёт им прямой доступ к локальной файловой системе OpenCode.

  • Этот проект не является официальным SDK или продуктом Hyperagent.

Available Tools

2 tools
hyperagent_chatChat through HyperagentA

Sends a prompt to Fable 5 or GPT-5.6 Sol through Hyperagent. Omit thread_id to create a thread; reuse the returned thread_id to continue it.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesModel alias
promptYesPrompt to send
thread_idNoExisting Hyperagent thread ID for continuation
system_promptNoSystem prompt for a new thread, or an explicit update to an existing thread
timeout_secondsNoRequest timeout; default 600 seconds

TDQS

A3.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions thread creation and continuation but lacks details on authentication, side effects, rate limits, or any other behavioral traits beyond the obvious send operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no wasted words. The verb 'sends' and models are front-loaded, immediately conveying the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers core usage (send, create/continue thread) but does not explain parameters like system_prompt or timeout_seconds, nor does it mention return values. Given no output schema, more detail would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the thread_id creation/continuation pattern, which goes beyond the schema's parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool sends a prompt and specifies models (Fable 5, GPT-5.6 Sol). It differentiates between creating a new thread and continuing an existing one, which distinguishes it from the sibling tool hyperagent_models.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance: omit thread_id to create a thread, reuse it to continue. This tells the agent when to use different parameter combinations, though it does not list exclusions or when not to use the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

hyperagent_modelsList Hyperagent modelsA

Lists the two Hyperagent models supported by this local bridge.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided; the description mentions 'supported by this local bridge', which gives some context, but lacks details on any side effects, caching, or performance characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no wasted words, front-loaded with the verb 'Lists'.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter listing tool without an output schema, the description is sufficient; it states the exact number of models and their provenance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the description does not need to add parameter meaning; baseline 4 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Lists' and identifies the resource as 'Hyperagent models' with a precise count of two, clearly distinguishing from the sibling tool 'hyperagent_chat'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states what the tool does, but no explicit guidance on when to use versus alternatives; however, as a simple listing tool with no parameters, usage context is implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedhyperagent_chat
    • First observedhyperagent_models

TDQS

A4.1/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: hyperagent_models lists supported models, and hyperagent_chat handles chat interactions. There is no functional overlap between them.

Naming Consistency5/5

Both tool names follow a consistent snake_case pattern with the 'hyperagent_' prefix, making them easy to understand and predict.

Tool Count4/5

With only 2 tools, the server feels minimal but still covers the core functionality of listing models and chatting. A few more management tools (e.g., thread listing) would be welcome, but the count is not unreasonable for a focused bridge.

Completeness4/5

The essential operations (list models, send prompts, manage threads implicitly via thread_id) are covered. Minor gaps include the lack of explicit thread management tools like list or delete threads, but the core workflow is supported.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PandaNePanda/hyperagent_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server