Menu

Integrations / Frameworks & SDKs

CAMEL-AI

MillionShort search for CAMEL agents, through CAMEL's MCP toolkit.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

MCPPythonNothing of ours to installWorks with no keyChecked 2026-11-19

CAMEL's MCPToolkit connects to the MillionShort MCP server by URL and turns its tools into CAMEL function tools, so a ChatAgent can call search, get_domain_info, list_sources and the tools of the other endpoints, such as extract, places, map and crawl (the MCP page lists them all). Without MCP, a plain function tool that calls the API does the same job.

1Install

Python
pip install camel-ai "mcp<2"
export MILLIONSHORT_API_KEY=ms-YOUR_API_KEY

Pin the MCP Python SDK below 2. The current release of camel-ai (0.2.90) asks only for mcp>=1.3.0, so a fresh install gets MCP 2.x, and camel.toolkits then fails to import (it uses a name that MCP 2 removed). With mcp<2 it installs and connects.

The examples use an OpenAI model, which reads your key from OPENAI_API_KEY; any model CAMEL supports works. Get a MillionShort key in the dashboard; an agent can ask for a trial key by itself.

2Connect the server

Describe the server in the same mcpServers shape CAMEL reads from a config file, as a dict, with type set to streamable_http and the key in headers. Without a key, leave headers out.

Python
import os

millionshort_config = {
    "mcpServers": {
        "millionshort": {
            "url": "https://mcp.millionshort.com/mcp",
            "type": "streamable_http",
            "headers": {"Authorization": f"Bearer {os.environ['MILLIONSHORT_API_KEY']}"},
        }
    }
}

A JSON file with the same content works too: MCPToolkit(config_path="config/millionshort.json").

3Give the tools to an agent

MCPToolkit connects in async with; pass toolkit.get_tools() to the agent:

Python
import asyncio
import os

from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.toolkits import MCPToolkit
from camel.types import ModelPlatformType, ModelType

config = {
    "mcpServers": {
        "millionshort": {
            "url": "https://mcp.millionshort.com/mcp",
            "type": "streamable_http",
            "headers": {"Authorization": f"Bearer {os.environ['MILLIONSHORT_API_KEY']}"},
        }
    }
}


async def main():
    model = ModelFactory.create(model_platform=ModelPlatformType.OPENAI, model_type=ModelType.GPT_4O)
    async with MCPToolkit(config_dict=config) as toolkit:
        agent = ChatAgent(
            system_message="Use the millionshort search tool for anything recent or niche, and cite the URLs.",
            model=model,
            tools=toolkit.get_tools(),
        )
        response = await agent.astep("Find independent blogs about home espresso, without the 1,000 most popular sites.")
        print(response.msgs[0].content)


asyncio.run(main())

4Check it works

List the tools without a model:

Python
import asyncio
import os

from camel.toolkits import MCPToolkit

config = {"mcpServers": {"millionshort": {"url": "https://mcp.millionshort.com/mcp", "type": "streamable_http",
                                          "headers": {"Authorization": f"Bearer {os.environ['MILLIONSHORT_API_KEY']}"}}}}


async def main():
    async with MCPToolkit(config_dict=config) as toolkit:
        print([tool.get_function_name() for tool in toolkit.get_tools()])  # search, get_domain_info, list_sources, ...


asyncio.run(main())

With no key you see search and list_sources. Then run step 3: the answer should cite pages. If the agent answers from memory, say when to search in its system message:

Use the MillionShort search tool for anything recent, niche, or that needs a source. To reach lesser-known sites, set remove_top_sites (for example 1000). Cite the URLs it returns.

Without MCP: a function tool

A plain function, wrapped in a FunctionTool, that calls POST /v1/search. CAMEL builds the tool's schema from the signature and the docstring:

Python
import json
import os
import urllib.request

from camel.agents import ChatAgent
from camel.toolkits import FunctionTool


def millionshort_search(query: str, remove_top_sites: int = 1000) -> str:
    """Search the web with MillionShort.

    Args:
        query (str): What to search for.
        remove_top_sites (int): Leave out the N most popular sites.
    """
    request = urllib.request.Request(
        "https://api.millionshort.com/v1/search",
        data=json.dumps({"query": query, "remove_top_sites": remove_top_sites, "num_results": 5}).encode(),
        headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"], "Content-Type": "application/json"},
    )
    with urllib.request.urlopen(request, timeout=30) as response:
        results = json.load(response)["data"]["results"]
    return json.dumps([{"title": r["title"], "url": r["url"], "snippet": r.get("snippet")} for r in results])


agent = ChatAgent(system_message="Search before you answer, and cite the URLs.", tools=[FunctionTool(millionshort_search)])
print(agent.step("Find independent blogs about home espresso.").msgs[0].content)

MCP configuration

The same address for every client: https://mcp.millionshort.com/mcp, streamable HTTP.

ModeHowWhat the agent gets
API keySend Authorization: Bearer ms-YOUR_API_KEYEvery tool, at your plan's limits; calls use your credits
No keySend no Authorization headersearch, list_sources and a few more; one source and up to 5 results a search, 10 free searches a day

Tools

ToolWhat it doesWithout a keyCost
searchSearches the web and the specialist sources, with the popularity, domain, page-type, topic, site and date filtersYes: one source, up to 5 results1 credit per source searched, first 10 results
get_domain_infoPopularity and risk for up to 25 sitesNo1 credit
list_sourcesThe sources, page types and topics search acceptsYes: source namesFree
The tools of the other endpointsextract, map, crawl, places and more: the MCP page lists themA few, such as placesWhat the API call behind each costs

Settings

VariableMeaning
MILLIONSHORT_API_KEYYour key, read by the examples above. Leave headers out for the no-key mode

Costs and limits

A tool call costs what the API call behind it costs: 1 credit per source searched for the first 10 results, 1 credit for a domain lookup, nothing for the list of sources, the price of the endpoint for the other tools, and nothing at all in the no-key mode. An agent that loops can make many calls: give it a step limit, and ask for fewer results when a few will do. Credits and limits has the numbers.

When it fails

What you seeWhyFix
The server does not connect, or no tools are listedThe address or the transport is not the one the server speaksUse exactly https://mcp.millionshort.com/mcp and the streamable HTTP transport (often called http), not SSE
401 or "unauthorized"The key is wrong, or it was sent without Bearer Send Authorization: Bearer ms-..., or leave the header out to use the no-key mode
"10 free searches a day without a key"The no-key mode's daily searches are used upAdd a key: it is free in the dashboard
INSUFFICIENT_CREDITSThe plan's credits are used upStop and add credits; retrying does not help
The agent answers from memory, or uses another searchNothing told it when to use this oneTurn off its own search where it can be (this page says how), and add the line for its instructions
from camel.toolkits import ... fails on FastMCPMCP Python SDK 2.x is installedpip install "mcp<2"
get_tools() returns no MillionShort toolsThe connection failed, and skip_failed (on by default) skipped the serverCheck the URL and the header; pass skip_failed=False to MCPToolkit to see the failure

This page as Markdown ยท llms.txt