datacircle / mcp-tools
Find the best GTM APIs. This package adds four tools to an MCP server that uses the MCP PHP SDK. The tools call Datacircle's public API. You need no API key.
Requires
- php: ^8.2
- ext-json: *
- mcp/sdk: >=0.4 <1.0
- php-http/discovery: ^1
- psr/http-client: ^1
- psr/http-factory: ^1
- psr/http-message: ^1 || ^2
Requires (Dev)
- nyholm/psr7: ^1.8
- phpunit/phpunit: ^11.5 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.
Our website: https://datacircle.dev
This package adds four tools to a server that uses the MCP PHP SDK (mcp/sdk). The tools call Datacircle's open API, https://api.datacircle.dev/v1. You need no key and no account.
| Tool | What the tool gives | Call |
|---|---|---|
datacircle_list_apis |
Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan | GET /apis |
datacircle_best_plans |
One API's plans, sorted by score out of 100, best first. Each plan comes with a rank and a price per 1,000 calls | GET /apis/{slug}/best |
datacircle_search_plans |
Plans that match a provider or plan name, on all APIs or on one API. You can sort them by score, provider or price | GET /plans |
datacircle_provider |
The APIs a provider sells, and the provider's rank on each API | GET /providers/{slug} |
Install
composer require datacircle/mcp-tools
The package needs PHP 8.2 or later and mcp/sdk 0.4.0 or later.
Add the tools to your server
Pass your server's builder to Datacircle::addTools():
<?php require __DIR__.'/vendor/autoload.php'; use Datacircle\Mcp\Datacircle; use Mcp\Server\Server; use Mcp\Server\Transport\StdioTransport; $builder = Server::builder()->setServerInfo('My server', '1.0.0'); Datacircle::addTools($builder); exit($builder->build()->run(new StdioTransport()));
On mcp/sdk 0.9 and older, the server class is Mcp\Server. Write use Mcp\Server; in place of use Mcp\Server\Server;.
Add your own tools to $builder too, in any order. To add one tool alone, call Datacircle::addTool($builder, Datacircle::BEST_PLANS). The tools work the same over the SDK's Streamable HTTP transport.
To try the server, open the MCP Inspector:
npx @modelcontextprotocol/inspector php server.php
What the model reads
Each tool gives a JSON object, as text and as structured content. Each plan comes with a rank, provider, plan, score, price per 1,000 (perThousand, in dollars) and a page on datacircle.dev. That page lists every field.
For an unknown slug, the tool gives an error result with the API's message, as {"error": "..."}. If the network fails, the error gives the network's message. The model can then call the tool again and keep going. The SDK checks the arguments against each tool's input schema before the tool runs. If the arguments are wrong, the client gets an error from the SDK.
The annotations mark all four tools as read only.
Make each call yourself
You can make each call from PHP without running the MCP server. You get the tool's answer as an array:
use Datacircle\Mcp\Datacircle; $answer = Datacircle::bestPlans(['slug' => 'email-finder', 'limit' => 3]); print_r($answer['plans']);
The other calls are Datacircle::listApis(), Datacircle::searchPlans() and Datacircle::provider().
Network
Each tool call sends HTTPS GET requests to https://api.datacircle.dev/v1 and nowhere else. Most calls send one request. datacircle_search_plans sends up to three when the first search finds nothing. The requests hold only the tool's own arguments: no key and nothing from your chats. The API takes up to 60 calls a minute from one IP address. The tool waits once, for a minute at most, when the API says to wait. The package stores nothing.
The tools call through PHP's curl extension. Without curl, they use PHP's own HTTPS streams. To call through a PSR-18 client of your own, such as Guzzle, pass new \Datacircle\Mcp\Client(http: $httpClient) as the last argument of addTools(). Use this to add a proxy or a timeout.
Links
- Datacircle: https://datacircle.dev
- The API: https://datacircle.dev/api
- The API's spec: https://api.datacircle.dev/v1/openapi.json
- What each key means: https://datacircle.dev/fields
MIT license.