Call Desearch web search through MetaMCP
Tested 17 November 2026.
For developers evaluating MetaMCP as a local MCP gateway. This example creates a disposable local gateway, registers the hosted Desearch MCP server, creates an authenticated endpoint and invokes the discovered web-search tool.
Tested versions: MetaMCP 2.4.22 at commit 32b6e9813acfc13d1013eb2452be1899d6654bb9, PostgreSQL 16 Alpine from a fixed image digest, FastMCP 4.2.0 and MCP SDK 2.3.0. The upstream repository was archived on 12 November 2026 and is read-only. Treat this as a pinned evaluation of that archived release. The hosted Desearch endpoint does not expose a pinned server version in this test; its behavior was verified on the test date.
Before you begin
Use Docker Engine 29.5.2, Python 3.12.13 and uv 0.12.1. This example was tested on macOS with Apple Silicon; the MetaMCP image digest below selects Linux ARM64. Keep port 19972 free and allow network access to the image and Python registries and Desearch.
You need a Desearch API key with available credits. Set DESEARCH_API_KEY through your secret manager. Desearch requests use your account credits; check current pricing. No hosted MetaMCP account or model inference is used. Keep the accompanying assets folder beside the guide and run commands there.
Download the assets
Save these files in an assets folder in your working directory, keeping the paths shown:
Install the pinned dependencies
The example binds the gateway to loopback. It generates local passwords and signing secrets in memory, creates an account only inside that disposable gateway, and stores the upstream registration in PostgreSQL on tmpfs. It keeps API keys and session cookies in memory. Its finally block stops both containers and removes the private Docker network. No credentials are written into host configuration files. Use MetaMCP's deployment documentation for a persistent service.
Run a search
Save this as metamcp_search.py in the same directory:
Run with your key already in the environment:
Success prints the discovered, prefixed web-search tool name, the local endpoint's unauthenticated status, and a nonempty title and link. The query is Python official documentation. Result titles and links can change; a link beginning /go/v1/ is a Desearch redirect path.
Troubleshooting
A missing DESEARCH_API_KEY stops the example before containers are created. An unavailable image digest fails with no such image: run both docker pull commands before the script. Port conflicts and app readiness failures stop the test; check port 19972 and Docker resources. An interrupted Python process can leave containers running: inspect only the containers and network named desearch-meta-<random suffix> created by your run and remove those resources.
The guide uses the native frontend tRPC procedures from the pinned release for server, namespace, endpoint and local API-key creation. These are version-specific application APIs; do not assume they are a stable public contract across releases. The endpoint requires the locally generated MetaMCP key. The upstream registration separately forwards your Desearch bearer token. Discovery alone does not prove the upstream key works; a titled result verifies the search call. For a rejected Desearch key or insufficient credits, check your key and account balance before retrying.