Skip to main content

A restricted TinyFish MCP gateway for free search and fetch capabilities.

Project description

microfish

中文文档: README_cn.md

microfish is a restricted TinyFish MCP gateway. It exposes only the allowlisted TinyFish Search and Fetch related tools.

Tools

Retained tools:

  • search
  • fetch_content
  • get_search_usage
  • list_fetch_usage

Blocked tool groups:

  • Agent automation
  • Batch automation
  • Browser sessions

Authentication and running modes

microfish only exposes TinyFish Search and Fetch related APIs. TinyFish Agent, Browser, batch, and run lifecycle APIs are intentionally not registered.

Get a TinyFish API key

Generate your API key at https://agent.tinyfish.ai/api-keys.

Client-owned single key

Leave TINYFISH_KEYS unset. Each MCP client sends Authorization: Bearer <YOUR_TINYFISH_API_KEY>. microfish forwards that value to TinyFish as X-API-Key for the current request only.

Server-managed single key

Set TINYFISH_KEYS to one TinyFish API key. MCP clients do not receive the TinyFish key. If MCP_AUTH_TOKEN is set, clients send Authorization: Bearer <YOUR_MCP_AUTH_TOKEN>; if MCP_AUTH_TOKEN is unset, the MCP entrypoint is not protected by a bearer token.

Server-managed key pool

Set TINYFISH_KEYS to multiple comma-separated TinyFish API keys. microfish assigns requests in order. When a whole upstream request fails, it tries the next key, stopping after all available keys for that call are tried or after three extra retries.

Server configuration

microfish reads runtime settings from environment variables:

  • MICROFISH_HOST: bind host for the HTTP server. Defaults to 0.0.0.0.
  • MICROFISH_PORT: bind port for the HTTP server. Defaults to 8000.
  • MICROFISH_MCP_PATH: HTTP path that exposes the MCP entrypoint. Defaults to /mcp.
  • MICROFISH_TRANSPORT: transport for the server. Use http for the HTTP service or stdio for local coding agent subprocesses. Defaults to stdio.
  • TINYFISH_KEYS: comma-separated TinyFish API keys; presence selects server-managed mode.
  • MCP_AUTH_TOKEN: optional bearer token required from MCP clients in server-managed mode.

Client configuration

microfish supports two transports:

  • stdio transport(default) (MICROFISH_TRANSPORT=stdio or --transport stdio): launch uvx microfish --transport stdio as a local subprocess for coding agents.
  • HTTP transport (MICROFISH_TRANSPORT=http): run microfish as an HTTP service and connect clients to http://localhost:8000/mcp.

For the HTTP transport, the value of Authorization: Bearer depends on your running mode:

  • Client-owned single key: set it to your TinyFish API key.
  • Server-managed single/multiple keys with MCP_AUTH_TOKEN: set it to the MCP auth token.
  • Server-managed keys without MCP_AUTH_TOKEN: omit the Authorization header entirely.

The stdio transport requires TINYFISH_KEYS because there is no separate Authorization header on local subprocess pipes.

Claude Code

HTTP transport:

# Without auth header
claude mcp add --transport http microfish http://localhost:8000/mcp

# With auth header
claude mcp add --transport http microfish http://localhost:8000/mcp \
  --header "Authorization: Bearer <YOUR_MCP_OR_TINYFISH_TOKEN>"

stdio transport:

TINYFISH_KEYS=<YOUR_TINYFISH_API_KEY> \
  claude mcp add microfish --env TINYFISH_KEYS -- uvx microfish

Codex

HTTP transport:

[mcp_servers.microfish]
url = "http://localhost:8000/mcp"
bearer_token_env_var = "MICROFISH_MCP_BEARER"

Set MICROFISH_MCP_BEARER in your shell environment to your TinyFish API key (client-owned mode) or MCP auth token (server-managed mode).

stdio transport:

[mcp_servers.microfish]
command = "uvx"
args = ["microfish"]
env = { TINYFISH_KEYS = "<YOUR_TINYFISH_API_KEY>" }

Cursor

HTTP transport:

{
  "mcpServers": {
    "microfish": {
      "url": "http://localhost:8000/mcp",
      "headers": {
        "Authorization": "Bearer ${env:MICROFISH_MCP_BEARER}"
      }
    }
  }
}

Set MICROFISH_MCP_BEARER in your environment to your TinyFish API key (client-owned mode) or MCP auth token (server-managed mode). If no auth token is required, remove the headers block.

stdio transport:

{
  "mcpServers": {
    "microfish": {
      "command": "uvx",
      "args": ["microfish"],
      "env": {
        "TINYFISH_KEYS": "<YOUR_TINYFISH_API_KEY>"
      }
    }
  }
}

Run locally

uv sync
uv run microfish

Or run directly without cloning via uvx microfish.

Docker

Two compose files are provided:

  • docker-compose.yml pulls the published image ghcr.io/vvtommy/microfish:${MICROFISH_IMAGE_TAG:-latest} from GHCR.
  • docker-compose_build.yml builds the local Dockerfile.

Both expose microfish on port 8000. Do not put TinyFish keys directly in compose files; pass them through your deployment environment.

docker compose up -d
claude mcp add --transport http microfish http://localhost:8000/mcp \
  --header "Authorization: Bearer <YOUR_MCP_OR_TINYFISH_TOKEN>"

Releasing

Push a SemVer tag of the form vX.Y.Z to trigger publish workflows:

  • .github/workflows/pypi.yml builds and publishes the Python package to PyPI via PyPI OIDC trusted publishing.
  • .github/workflows/docker.yml builds and publishes ghcr.io/vvtommy/microfish Docker images with version tags and latest.

MCP endpoint

http://localhost:8000/mcp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microfish-1.1.0b7.tar.gz (340.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microfish-1.1.0b7-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file microfish-1.1.0b7.tar.gz.

File metadata

  • Download URL: microfish-1.1.0b7.tar.gz
  • Upload date:
  • Size: 340.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for microfish-1.1.0b7.tar.gz
Algorithm Hash digest
SHA256 7c45a4ac9821931348392f94e63a4a4c6ab24054da6c9cce2bccac01ed683217
MD5 654c97abc0b25373daefa4a73807aa55
BLAKE2b-256 96fc383da5bb8fd9a12b8bca314b6f181e354041dc8d88db9df47937586cf10d

See more details on using hashes here.

Provenance

The following attestation bundles were made for microfish-1.1.0b7.tar.gz:

Publisher: pypi.yml on vvtommy/microfish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file microfish-1.1.0b7-py3-none-any.whl.

File metadata

  • Download URL: microfish-1.1.0b7-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for microfish-1.1.0b7-py3-none-any.whl
Algorithm Hash digest
SHA256 bbbefdc9516fa7b1096d956d01b02b05943248f0492758ecaeedc9a68970f1f5
MD5 2c163109fb626f5677dfb07de3e832d3
BLAKE2b-256 2eadee66687cf419f04fd7908a55a07ab0894ad49dae32e9dd71c2eea62de63f

See more details on using hashes here.

Provenance

The following attestation bundles were made for microfish-1.1.0b7-py3-none-any.whl:

Publisher: pypi.yml on vvtommy/microfish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page