{
  "markdown": "<!-- aicom-mirror-notice -->\n> **📖 Read-only mirror.** `aimarket-mcp` is published from the canonical AI-Factory monorepo.\n> **Pull requests are not accepted** — any commit pushed here is overwritten by\n> `scripts/mirror_satellites.sh` on the next sync.\n> 🐞 Found a bug or have a request? Please **[open an issue](https://github.com/alexar76/aimarket-mcp/issues)**.\n\n# aimarket-mcp — ecosystem MCP gateway\n\n<!-- mcp-name: io.github.alexar76/aimarket-mcp -->\n\n<!-- aicom-readme-badges -->\n<p align=\"center\">\n  <a href=\"https://github.com/alexar76/aimarket-mcp/actions/workflows/ci.yml\"><img src=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/ci.svg\" alt=\"CI\" /></a>\n  <a href=\"https://glama.ai/mcp/servers/alexar76/aimarket-mcp\"><img src=\"https://glama.ai/mcp/servers/alexar76/aimarket-mcp/badges/score.svg\" alt=\"aimarket-mcp MCP server\" /></a>\n  <img src=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/mcp.svg\" alt=\"MCP gateway\" />\n  <img src=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/transport.svg\" alt=\"stdio + HTTP\" />\n  <img src=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/tests.svg\" alt=\"14 tests passing\" />\n  <a href=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/coverage.svg\"><img src=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/coverage.svg\" alt=\"Test coverage\" /></a>\n  <a href=\"https://github.com/alexar76/aimarket-mcp/blob/main/LICENSE\"><img src=\"https://raw.githubusercontent.com/alexar76/aimarket-mcp/refs/heads/main/docs/badges/license.svg\" alt=\"License: MIT\" /></a>\n</p>\n<!-- /aicom-readme-badges -->\n\n> 🌐 **English** · [Русский](docs/README.ru.md) · [Español](docs/README.es.md) · [Français](docs/README.fr.md) · [中文](docs/README.zh.md) · [Glossary](https://github.com/alexar76/aicom/blob/main/docs/localization-glossary.md)\n\n\n\n\n> ### 🟢 Just want to try the marketplace? Install nothing.\n> Paste **`https://modelmarket.dev/mcp`** into your MCP client and you have `market_search`\n> + `market_invoke` against the live hub, with a few free trial invokes per caller and a\n> signed receipt for each — no wallet, no key, no install.\n> → [`docs/hosted-mcp-endpoint.md`](https://github.com/alexar76/aicom/blob/main/docs/hosted-mcp-endpoint.md)\n>\n> Install **this** package when you want the other three tools (`web_fetch`, `web_search`,\n> `metis_verify`), or want to point the market tools at a hub of your own.\n\n**One MCP gateway. Five hardened tools. Shared by Metis, ARGUS, and the ecosystem.**\n\nTransport: **stdio** (`aimarket_mcp/stdio_server.py`) for Glama / Claude Desktop / Cursor, built with the\nofficial **Model Context Protocol** Python SDK ([`mcp`](https://github.com/modelcontextprotocol/python-sdk), `FastMCP`).\nAlso ships **Streamable-HTTP** on `:9090` for self-hosted deployments (`aimarket-mcp-http`, Docker Compose).\n\n| Item | Location |\n|------|----------|\n| MCP entrypoint (stdio) | `aimarket_mcp/stdio_server.py` |\n| MCP gateway (HTTP) | [`aimarket_mcp/server.py`](aimarket_mcp/server.py) |\n| Tool handlers + security | [`aimarket_mcp/tools.py`](aimarket_mcp/tools.py), [`aimarket_mcp/security.py`](aimarket_mcp/security.py) |\n| Glama / Docker (stdio) | [`Dockerfile`](Dockerfile), [`glama.json`](glama.json) |\n| Self-host HTTP | [`Dockerfile.http`](Dockerfile.http), [`docker-compose.yml`](docker-compose.yml) |\n\nCompatible hosts: Claude Desktop, Cursor, Glama, and any MCP client that supports stdio or Streamable-HTTP.\n\n## Tools\n\n| Tool | What it does | Hardening |\n|------|--------------|-----------|\n| `web_fetch` | Fetch a URL, return main text (readability-lite) | SSRF-guarded; output sanitized + `<untrusted>`-wrapped |\n| `web_search` | Live DuckDuckGo search → top snippets | output sanitized + `<untrusted>` |\n| `metis_verify` | Metis cognition + verification envelope | returns answer + `verify_score` / `verified` gate |\n| `market_search` | Discover priced capabilities on an AIMarket hub | free; no wallet, key or channel; the hub lists only what it can execute |\n| `market_invoke` | Run one on the hub's free trial tier | returns the signed receipt nonce; reports the hub's 402 verbatim when the allowance is spent |\n\n### Example — buy a GAIA Open-Meteo reading\n\n```text\nmarket_search_tool(intent=\"gaia weather open-meteo\")\nmarket_invoke_tool(\n  capability_id=\"gaia.weather.read@v1\",\n  product_id=\"gaia.gateway\",\n  source_hub=\"https://iot.modelmarket.dev\",\n  # input JSON with device_id om-wx-01 — see tool schema / hub docs\n)\n```\n\nOr the same HTTP the tool wraps:\n\n```bash\ncurl -s -X POST \"${AIMARKET_HUB_URL:-https://modelmarket.dev}/ai-market/v2/invoke\" \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-AIMarket-Sandbox-Visitor: vis_mcp_om_wx' \\\n  -d '{\"capability_id\":\"gaia.weather.read@v1\",\"product_id\":\"gaia.gateway\",\n       \"source_hub\":\"https://iot.modelmarket.dev\",\"input\":{\"device_id\":\"om-wx-01\"}}'\n```\n\nThat is the **easy** path (trial/sandbox). Proving an **external wallet** paid on-chain\nis a separate escrow flow (`openChannel` → DebitAuthorization → hub debit/settle) —\nsee [`docs/onchain-journal.md`](https://github.com/alexar76/aicom/blob/main/docs/onchain-journal.md) §3l–§3m and\n[`gaia/docs/LIVE-RELAYS.md`](https://github.com/alexar76/gaia/blob/main/docs/LIVE-RELAYS.md).\n\nWhy a gateway (not per-agent tools): generic capabilities are written **once**; the security core lives in one audited place. Ecosystem-specific capabilities live in their own MCP servers (`aimarket-oracle-gateway`, `aimarket-plugins`).\n\n## Configure (env)\n\n| var | meaning |\n|-----|---------|\n| `AIMARKET_METIS_URL` | Metis verify API base (default `https://metis.modelmarket.dev`) |\n| `AIMARKET_METIS_KEY` | optional bearer for Metis verify |\n| `AIMARKET_SEARCH_URL` | DuckDuckGo HTML endpoint override |\n| `AIMARKET_HUB_URL` | AIMarket hub for `market_search` / `market_invoke` (default `https://modelmarket.dev`) |\n| `AIMARKET_SANDBOX_VISITOR` | Trial identity for `market_invoke`; random per install, set it to keep an allowance across reinstalls |\n| `AIMARKET_MCP_KEY` | HTTP only — bearer auth key |\n| `AIMARKET_MCP_PRODUCTION` | HTTP only — `1` requires `AIMARKET_MCP_KEY` (fail-closed) |\n| `AIMARKET_MCP_RATE` | HTTP only — requests/min per key/IP (default 120) |\n| `AIMARKET_MCP_PORT` | HTTP only — listen port (default 9090) |\n\n## Run (stdio — Glama / Claude Desktop)\n\nClaude Desktop (`mcpServers` entry) — no clone, no working directory to get wrong:\n\n```json\n{\n  \"mcpServers\": {\n    \"aimarket-mcp\": {\n      \"command\": \"uvx\",\n      \"args\": [\"aimarket-mcp\"]\n    }\n  }\n}\n```\n\n`uvx` fetches the published package and runs its `aimarket-mcp` console script, which is\nthe stdio server. With the package already installed, `\"command\": \"aimarket-mcp\"` and no\nargs does the same thing.\n\nFrom a checkout, for development:\n\n```bash\npip install -e .\npython -m aimarket_mcp.stdio_server\n```\n\n## Run (HTTP — self-host)\n\n```bash\npip install -e .\nAIMARKET_MCP_KEY=sk-... AIMARKET_MCP_PRODUCTION=1 aimarket-mcp-http   # :9090\n# or: docker compose up -d   (uses Dockerfile.http)\n```\n\n### Cursor / Claude (Streamable HTTP)\n\n```json\n{\n  \"mcpServers\": {\n    \"aimarket-web\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"http://127.0.0.1:9090/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer YOUR_AIMARKET_MCP_KEY\"\n      }\n    }\n  }\n}\n```\n\n## Publish on Glama\n\n\nListing: **[glama.ai/mcp/servers/alexar76/aimarket-mcp](https://glama.ai/mcp/servers/alexar76/aimarket-mcp)**\n\nSame pattern as **[aimarket-oracle-gateway](https://github.com/alexar76/aimarket-oracle-gateway)** (working on Glama): repo-root [`glama.json`](glama.json) + [`Dockerfile`](Dockerfile) + `python -m aimarket_mcp.stdio_server`.\n\n| Field | Value |\n|-------|--------|\n| **Dockerfile** | `Dockerfile` (from repo — **not** Glama debian/uv template) |\n| **Command** | `python -m aimarket_mcp.stdio_server` |\n| **Placeholder parameters** | `{}` |\n| **Pinned SHA** | empty (latest) |\n\n**Do not use** the auto-generated `debian:trixie-slim` + `uv sync` + `mcp-proxy -- aimarket-mcp` template — that was the broken HTTP/ENOENT path.\n\n## Consumers\n\n- **Metis** — enable the preset:\n  ```yaml\n  enable_mcp_tools: true\n  mcp_ecosystem_presets: [aimarket-web]\n  ```\n- **ARGUS** — add the server to `argus.config.json` `mcpServers` (see that repo).\n\n## Test\n\n```bash\npip install -e '.[dev]' && pytest -q\n```\n\n## Glama\n\nGlama **ignores** repo Dockerfiles — set **Build steps** in\n[admin/dockerfile](https://glama.ai/mcp/servers/alexar76/aimarket-mcp/admin/dockerfile):\n\n```json\n[\"bash scripts/glama_install.sh\"]\n```\n\nCMD: `[\".venv/bin/python\", \"-m\", \"aimarket_mcp.stdio_server\"]`. Pin **`main`** or tag **`glama-build`** (not a\nfixed SHA). Details: [`docs/GLAMA.md`](docs/GLAMA.md).\n\n## Registries\n\n| Registry | Listing |\n|----------|---------|\n| **Glama** | [glama.ai/mcp/servers/alexar76/aimarket-mcp](https://glama.ai/mcp/servers/alexar76/aimarket-mcp) |\n| **Official MCP Registry** | `io.github.alexar76/aimarket-mcp` — `server.json` + GitHub Actions |\n| **PyPI** | `pip install aimarket-mcp` |\n| **GitHub Releases** | [github.com/alexar76/aimarket-mcp/releases](https://github.com/alexar76/aimarket-mcp/releases) |\n",
  "bytes": 9264,
  "sha": "5c2a08fe76cd377fa7c31063be92eecff41a864069579f29f644bf7b6342d46b",
  "repo_slug": "alexar76/aimarket-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_alexar76_aimarket_mcp_bee32c86/readme"
}