mcpField
A
AAI Gateway

AAI Gateway

Local
github.comAI & Agents91Updated 13w ago

About AAI Gateway

AAI Gateway is a gateway that manages MCP servers and Skill packages as unified Agent Apps shared across AI agents. It loads detailed tool guides on demand to reduce context token usage. It targets developers who use several coding agents with the same tools.

Key features

  1. 01Unified management of MCP servers and Skill packages
  2. 02On-demand Agent App summaries to reduce context tokens
  3. 03Natural language search and installation of tools
  4. 04Single import shared across multiple agents
  5. 05Per-agent enabling or disabling of Agent Apps

Use cases

  1. 01Sharing one tool configuration across Claude Code, Codex and OpenCode
  2. 02Reducing context space taken by many MCP tool schemas
  3. 03Letting an agent find and install a browser automation tool from a request

MCP support

AAI Gateway is itself an MCP server. It exposes built-in tools such as search:discover, mcp:import and aai:exec, and registers imported MCP servers as Agent Apps.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"gybob-aai-gateway": {
"command": "npx",
"args": [
"-y",
"aai-gateway"
]
}
}
}
Run commandnpx -y aai-gateway

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmaai-gateway1.1.10

Tools

8

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
appstringNoRequired for app tools, omit or use "gateway" for gateway tools.
argsobjectNoArguments for the selected tool.
toolstringYesTool name within the app, not prefixed with app id.

Details

From the project README

English | 简体中文 | 日本語 | 한국어


AAI Gateway: Unified MCP & Skill Management, Shared Across AI Agents, 99% Context Token Savings

npm version license


What Is It

AAI = Agent App Interface

AAI Gateway is the interaction gateway for Agent Apps.

What is an Agent App? An Agent App is a collection of capabilities that an Agent can use. For example:

  • An MCP Server is an Agent App — it provides a set of tools
  • A Skill package is an Agent App — it provides one or more skills

In AAI Gateway, they are abstracted as Agent Apps under unified management. Import once, and all AI Agents can use them immediately.


What Problems Does It Solve

Context Bloat

Traditional: 10 MCPs × 5 tools = 50 full schemas ≈ 7,500 tokens injected into every conversation.

AAI Gateway: each Agent App needs only fewer than 50 tokens for a summary, with details loaded on demand. 99% token savings.

Finding Tools Is Hard

Traditional: search GitHub → read READMEs → copy JSON configs → debug connections → restart Agent.

AAI Gateway: tell your Agent "use AAI to search for xxx" — auto-searches, installs, ready to use.

"Use AAI to search for a browser automation tool"

→ Search → finds Playwright MCP → Agent summarizes a one-line Agent App summary → install → ready to use, no restart needed

"Use AAI to search for a PPT creation skill"

→ Search → finds PPT Skill → uses skill description as Agent App summary → install → ready to use, no restart needed

Duplicate Config

Configure the same thing in Claude Code, Codex, and OpenCode separately? Import once through AAI Gateway, all Agents share instantly.


Quick Start (30 Seconds)

Claude Code:

claude mcp add --scope user --transport stdio aai-gateway -- npx -y aai-gateway

Codex:

codex mcp add aai-gateway -- npx -y aai-gateway

OpenCode — add to ~/.config/opencode/opencode.json:

{
  "mcp": {
    "aai-gateway": {
      "type": "local",
      "command": ["npx", "-y", "aai-gateway"],
      "enabled": true
    }
  }
}

OpenClaw:

openclaw plugins install openclaw-aai-gateway-plugin

Once installed, just tell your Agent what you want to do.


Built-in Tools

ToolDescription
search:discoverSearch and install new tools with natural language
mcp:importImport an MCP Server as an Agent App
skill:importImport a Skill package as an Agent App
listAllAaiAppsList all registered Agent Apps
enableApp / disableAppEnable or disable an Agent App per Agent
removeAppRemove an Agent App
aai:execExecute a specific tool within an Agent App

Each imported Agent App generates an app_<app-id> tool that returns the full operation guide and tool list when called.

Preset Agent Apps (auto-discovered when locally installed)
App IDNameDescription
claudeClaude CodeAI coding assistant for code editing, analysis, and development
codexCodexOpenAI-powered AI coding assistant
opencodeOpenCodeAI development assistant for editing files and running commands

Architecture

Architecture


Developers: Get Your Agent App Auto-Discovered

Create an aai.json descriptor and submit it to src/discovery/descriptors/. When a user's local environment meets the discovery.checks conditions, the Agent will auto-discover your Agent App.

{
  "schemaVersion": "2.0",
  "version": "1.0.0",
  "app": {
    "name": { "default": "My App" }
  },
  "discovery": {
    "checks": [
      { "kind": "command", "command": "my-app" }
    ]
  },
  "access": {
    "protocol": "mcp",
    "config": {
      "command": "my-app-mcp",
      "args": ["--stdio"]
    }
  },
  "exposure": {
    "summary": "Use when the user wants to do X."
  }
}

discovery.checks supports three check types: command (command exists), file (file exists), path (directory exists).

Supported protocols: mcp, skill, acp-agent

Welcome to submit a PR to contribute new Agent App descriptors, or open an issue for feedback.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.