connect

Connect threefold to your agent

One remote MCP server, https://api.threefold.eco/mcp, works in chat apps and coding agents. Sign in through the browser, use an API key, or try it with no account.

Three ways in

One library behind all three. The same endpoint answers the same way whichever door you use.

Chat apps and coding agents, over MCP

A remote MCP server with browser sign-in. Add it to Claude, ChatGPT, Grok, Claude Code, Codex, Cursor, VS Code or Gemini CLI.

https://api.threefold.eco/mcp

CLI and SDKs

Install into your coding agents in one command, run the i18n check locally, or call the library from TypeScript and Python.

npx threefold mcp install

REST

A plain HTTP API with an OpenAPI 3.1 document and uniform errors, for scripts, backends and CI.

GET https://api.threefold.eco/api/compare

Choose how to sign in

Browser sign-in

OAuth 2.1. Your client opens threefold's sign-in page; you get an emailed link, then choose the workspace and scopes to grant. Chat apps use this.

API key

A tf_live_… key as a Bearer header, scoped to read, track, ingest, analysis or admin. For headless agents and CI.

Sandbox key

A tf_test_… key: fixture data only, never charged, read-only. For tests and CI wiring.

No account

Keyless library reads, capped per IP address per day. Add ?keyless=1 to the MCP URL.

MCP clients

One command for coding agents

npx threefold mcp install

With no flags it writes a threefold entry for Claude Code, Codex, Cursor, Gemini CLI, OpenCode and VS Code. Pick one client with --client. Existing config files are copied to <file>.bak before they change, and running the command again changes nothing.

FlagWhat it does
--client <name>claude-code, codex, cursor, gemini, opencode, vscode or all (default)
--key tf_live_…Writes your API key into the entry as an Authorization: Bearer header
--oauthWrites the URL only; your client signs in through the browser
--url <url>Server URL (default https://api.threefold.eco/mcp)
--dry-runPrints what would change and writes nothing

Without --key, the entry is just the server URL. The first request gets an OAuth challenge, and clients that support MCP authorization open a browser to sign in.

If npx threefold reports that the package does not exist, the npm package has not been published yet. Use the per-client settings below: they are exactly what the installer writes.

Claude Code

claude mcp add --transport http --scope user threefold https://api.threefold.eco/mcp

To use an API key instead of browser sign-in:

claude mcp add --transport http --scope user threefold https://api.threefold.eco/mcp \
  --header "Authorization: Bearer tf_live_your_key"

Claude (claude.ai and Claude Desktop)

Add a custom connector with the URL https://api.threefold.eco/mcp. Claude registers itself with threefold (OAuth 2.1 dynamic client registration), then opens threefold's sign-in page (an emailed link) and a consent screen where you pick the workspace and scopes. threefold is not in the Connectors Directory yet, so add it by URL.

ChatGPT

In developer mode, create a custom app or connector with the URL https://api.threefold.eco/mcp and sign in when asked. The same OAuth 2.1 flow applies. threefold is not in the ChatGPT app directory yet.

Grok

At grok.com/connectors, add a custom connector with the URL https://api.threefold.eco/mcp and sign in.

Chat-app sign-in follows the MCP authorization spec (protected resource metadata, PKCE with S256, dynamic client registration, refresh and revocation) and passes our in-process tests. We have not yet recorded a test in each chat app.

Cursor

~/.cursor/mcp.json:

{
  "mcpServers": {
    "threefold": {
      "url": "https://api.threefold.eco/mcp"
    }
  }
}

Or open this install link in Cursor: cursor://anysphere.cursor-deeplink/mcp/install?name=threefold&config=eyJ0aHJlZWZvbGQiOnsidXJsIjoiaHR0cHM6Ly9hcGkudGhyZWVmb2xkLmVjby9tY3AifX0=

VS Code

User profile mcp.json (macOS ~/Library/Application Support/Code/User/mcp.json, Linux ~/.config/Code/User/mcp.json, Windows %APPDATA%\Code\User\mcp.json):

{
  "servers": {
    "threefold": {
      "type": "http",
      "url": "https://api.threefold.eco/mcp"
    }
  }
}

Codex

~/.codex/config.toml:

[mcp_servers.threefold]
url = "https://api.threefold.eco/mcp"

With a key, add http_headers = { "Authorization" = "Bearer tf_live_your_key" } to the same section.

Gemini CLI

~/.gemini/settings.json:

{
  "mcpServers": {
    "threefold": {
      "url": "https://api.threefold.eco/mcp"
    }
  }
}

OpenCode

~/.config/opencode/opencode.json:

{
  "mcp": {
    "servers": {
      "threefold": {
        "type": "remote",
        "url": "https://api.threefold.eco/mcp"
      }
    }
  }
}

For Cursor, VS Code, Gemini CLI and OpenCode, an API key goes in a headers object next to url: "headers": { "Authorization": "Bearer tf_live_your_key" }.

Try it without an account

Library reads work without signing in, up to 50 requests per IP address per day. Point your client at:

https://api.threefold.eco/mcp?keyless=1

Keyless calls get the read-only library tools. Tools that track apps, pull fresh data or run AI analyses need you to sign in or use a key.

SDKs

Both clients are generated from the OpenAPI document, default to https://api.threefold.eco, and raise a typed error that carries the API's code, whose_error, retryable and hint. Use a tf_test_… key to run them against fixture data in tests.

The TypeScript package (@threefold/client) and the Python package (threefold) are not on npm or PyPI yet. Until they are, the REST examples on this page do the same job with any HTTP client.

TypeScript

import { ThreefoldClient } from "@threefold/client";

const tf = new ThreefoldClient({ apiKey: process.env.THREEFOLD_API_KEY });

const comparison = await tf.compareMarkets({ from: "de", to: "jp", niche: "health-fitness" });
console.log(comparison.shared, comparison.localOnly);

Methods: libraryMeta, compareMarkets, searchApps, searchStore, topApps, getApp, marketBrief, b2bChecklist, searchPaidCreatives, searchOrganicPosts, trackApp, usage, plus get(path) and post(path, body) for any other route. Errors are ThreefoldError.

Python

from threefold import ThreefoldClient

with ThreefoldClient(api_key="tf_live_your_key") as tf:
    comparison = tf.compare_markets("de", "jp", "health-fitness")
    print(comparison["shared"])

Methods: library_meta, compare_markets, search_apps, search_store, top_apps, get_app, market_brief, b2b_checklist, search_paid_creatives, search_organic_posts, track_app, usage, plus get and post. Needs Python 3.9 or later; depends on httpx and pydantic.

REST

Every tool is also an HTTP route. Library reads work without a key, up to the keyless cap:

curl "https://api.threefold.eco/api/compare?from=de&to=jp&niche=health-fitness"

With a key:

curl "https://api.threefold.eco/api/compare?from=es&to=mx&niche=finance" \
  -H "Authorization: Bearer tf_live_your_key"

The OpenAPI 3.1 document is at api.threefold.eco/openapi.json, and llms.txt lists every discoverable endpoint for agents. See the REST API docs and the API reference, or try calls in the Playground.

CLI

The same discover, describe and call loop from a terminal, against https://api.threefold.eco. Sign in once and every command uses the saved login; library reads also work without one.

npx threefold login                         # browser sign-in, refreshed automatically
npx threefold login --key tf_live_your_key  # or save an API key instead
npx threefold discover "compare meditation apps in DE and JP"
npx threefold schema compare_markets
npx threefold call compare_markets --from de --to jp --niche health-fitness

More in the CLI docs.

Then ask it something

Try: “Which finance apps chart in Mexico but not in Spain, and how localised are their listings?”