📖 Read-only mirror.
aimarket-mcpis published from the canonical AI-Factory monorepo.Pull requests are not accepted — any commit pushed here is overwritten byscripts/mirror_satellites.shon the next sync.🐞 Found a bug or have a request? Please open an issue.
aimarket-mcp — ecosystem MCP gateway
The alexar76 AICOM / AIMarket ecosystem's shared MCP gateway: one hardened server thatgives every agent (Metis, ARGUS, …) the generic capabilities they were missing — webfetch, web search, and Metis verification — behind a single MCP endpoint.
It speaks MCP over Streamable-HTTP (JSON-RPC 2.0 POST, SSE-data:-framed responses,Mcp-Session-Id) — the exact protocol Metis's MCP client and ARGUS already talk, so noexternal SDK is required.
Tools
| Tool | What it does | Hardening |
|---|---|---|
web_fetch |
Fetch a URL, return its main text (readability-lite) | SSRF-guarded (scheme allow-list, private-IP block, per-redirect re-validation, size cap); output sanitized + <untrusted>-wrapped |
web_search |
Live DuckDuckGo search → top snippets | output sanitized |
metis_verify |
Run Metis's cognition + verification envelope on an input | returns answer + machine-readable verify_score/verified |
Why a gateway (not per-agent tools): generic capabilities are written once and everyecosystem agent gets them; the security core lives in one audited place. Ecosystem-specificcapabilities already live in their own MCP servers (aimarket-oracle-gateway,aimarket-plugins); MNEMOSYNE-search and on-chain tools are the next additions here.
Security
- SSRF:
web_fetchvalidates the scheme (http/https only), blocks localhost/private/reserved IPs, and re-validates on every redirect hop (vendored from Metis's auditedsecurity/ssrf.py). - Untrusted output: every web result is length-capped, has forged role markers strippedto a fixpoint, and is wrapped in
<untrusted>…</untrusted>before it can reach a model. - Auth: optional bearer (
AIMARKET_MCP_KEY); fail-closed in production(AIMARKET_MCP_PRODUCTION=1requires a key). - Rate limit: per-key/IP token bucket (
AIMARKET_MCP_RATE, default 120/min).
Run
pip install -e .
AIMARKET_MCP_KEY=sk-... AIMARKET_MCP_PRODUCTION=1 aimarket-mcp # :9090
# or: docker compose up -d
Env: AIMARKET_MCP_PORT (9090) · AIMARKET_MCP_KEY · AIMARKET_MCP_PRODUCTION ·AIMARKET_MCP_RATE · AIMARKET_METIS_URL (for metis_verify) · AIMARKET_METIS_KEY ·AIMARKET_SEARCH_URL.
Consumers
- Metis — enable the preset:
enable_mcp_tools: true mcp_ecosystem_presets: [aimarket-web] - ARGUS — add the server to
argus.config.jsonmcpServers(see that repo).
Test
pip install -e '.[dev]' && pytest -q